Reinserting configurable body quote
authorpdontthink <pdontthink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sun, 23 May 2004 06:59:39 +0000 (06:59 +0000)
committerpdontthink <pdontthink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sun, 23 May 2004 06:59:39 +0000 (06:59 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@7523 7612ce4b-ef26-0410-bec9-ea0150e637f0

include/load_prefs.php
include/options/display.php
src/compose.php

index e9962c2fff06f7f8b2aeb89a9e3b8f74b0e5e6cd..618c64fa90c6e22000d2d6292683e9a25634cb92 100644 (file)
@@ -161,6 +161,9 @@ $reply_citation_style =
 $reply_citation_start = getPref($data_dir, $username, 'reply_citation_start');
 $reply_citation_end = getPref($data_dir, $username, 'reply_citation_end');
 
+$body_quote = getPref($data_dir, $username, 'body_quote', '>');
+if ($body_quote == 'NONE') $body_quote = '';
+
 // who is using those darn block comments?  poo!
 
 // Load preference for cursor behavior for replies
index aebe81416ae699eabdc68cc1309e80799c335097..0753c943ef2865d919857ea667d276f16db3bf76 100644 (file)
@@ -399,6 +399,15 @@ function load_optpage_data_display() {
         'refresh' => SMOPT_REFRESH_NONE
     );
 
+    $optvals[SMOPT_GRP_MESSAGE][] = array(
+        'name'    => 'body_quote',
+        'caption' => _("Prefix for Original Message when Replying"),
+        'type'    => SMOPT_TYPE_STRING,
+        'refresh' => SMOPT_REFRESH_NONE,
+        'size'    => SMOPT_SIZE_TINY,
+        'save'    => 'save_option_reply_prefix'
+    );
+
     $optvals[SMOPT_GRP_MESSAGE][] = array(
         'name'    => 'reply_focus',
         'caption' => _("Cursor Position when Replying"),
@@ -501,4 +510,21 @@ function icon_theme_save($option) {
 
 }
 
+/** 
+ * This function saves the reply prefix (body_quote) character(s)
+ */
+function save_option_reply_prefix($option) {
+    global $data_dir, $username, $new_javascript_setting;
+
+    // save as "NONE" if it was blanked out
+    //
+    if (empty($option->new_value)) $option->new_value = 'NONE';
+
+
+    // Save the option like normal.
+    //
+    save_option($option);
+
+}
+
 ?>
index 2e9724f31e2fc792469135f548d26ae40234a2f3..078c7ee92203d5d152d2611e28ad8350273c74ee 100644 (file)
@@ -580,7 +580,7 @@ function newMail ($mailbox='', $passed_id='', $passed_ent_id='', $action='', $se
     global $editor_size, $default_use_priority, $body, $idents,
            $use_signature, $composesession, $data_dir, $username,
            $username, $key, $imapServerAddress, $imapPort, $compose_messages,
-           $composeMessage;
+           $composeMessage, $body_quote;
     global $languages, $squirrelmail_language, $default_charset;
 
     /*
@@ -800,9 +800,9 @@ function newMail ($mailbox='', $passed_id='', $passed_ent_id='', $action='', $se
                 sqWordWrap($line, ($editor_size));
                 if (preg_match("/^(>+)/", $line, $matches)) {
                     $gt = $matches[1];
-                    $body .= '>' . str_replace("\n", "\n>$gt ", rtrim($line)) ."\n";
+                    $body .= $body_quote . str_replace("\n", "\n$body_quote$gt ", rtrim($line)) ."\n";
                 } else {
-                    $body .= '> ' . str_replace("\n", "\n> ", rtrim($line)) . "\n";
+                    $body .= $body_quote . (!empty($body_quote) ? ' ' : '') . str_replace("\n", "\n$body_quote" . (!empty($body_quote) ? ' ' : ''), rtrim($line)) . "\n";
                 }
             }
             $body = getReplyCitation($from , $orig_header->date) . $body;