From: pdontthink Date: Sun, 23 May 2004 06:59:39 +0000 (+0000) Subject: Reinserting configurable body quote X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=a46ecf666765455b3030130111a6156ea582fd63;hp=763b63fe1203f87159a95fb76b0e7e7900967d32;p=squirrelmail.git Reinserting configurable body quote git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@7523 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- diff --git a/include/load_prefs.php b/include/load_prefs.php index e9962c2f..618c64fa 100644 --- a/include/load_prefs.php +++ b/include/load_prefs.php @@ -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 diff --git a/include/options/display.php b/include/options/display.php index aebe8141..0753c943 100644 --- a/include/options/display.php +++ b/include/options/display.php @@ -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); + +} + ?> diff --git a/src/compose.php b/src/compose.php index 2e9724f3..078c7ee9 100644 --- a/src/compose.php +++ b/src/compose.php @@ -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;