Make optional adding of standard signature separator - sig_separator (#1487768)

pull/294/head
Aleksander Machniak 9 years ago
parent 427ab2f393
commit 399a2d68b6

@ -1,6 +1,7 @@
CHANGELOG Roundcube Webmail CHANGELOG Roundcube Webmail
=========================== ===========================
- Make optional adding of standard signature separator - sig_separator (#1487768)
- Optimize folder_size() on Cyrus IMAP by using special folder annotation (#1490514) - Optimize folder_size() on Cyrus IMAP by using special folder annotation (#1490514)
- Make optional hidding of folders with name starting with a dot - imap_skip_hidden_folders (#1490468) - Make optional hidding of folders with name starting with a dot - imap_skip_hidden_folders (#1490468)
- Add option to enable HTML editor always, except when replying to plain text messages (#1489365) - Add option to enable HTML editor always, except when replying to plain text messages (#1489365)

@ -1116,6 +1116,9 @@ $config['show_sig'] = 1;
// the signature below the quoted text (sig_below = true). // the signature below the quoted text (sig_below = true).
$config['sig_below'] = false; $config['sig_below'] = false;
// Enables adding of standard separator to the signature
$config['sig_separator'] = true;
// Use MIME encoding (quoted-printable) for 8bit characters in message body // Use MIME encoding (quoted-printable) for 8bit characters in message body
$config['force_7bit'] = false; $config['force_7bit'] = false;

@ -511,6 +511,7 @@ $labels['newmessageonly'] = 'new message only';
$labels['replyandforwardonly'] = 'replies and forwards only'; $labels['replyandforwardonly'] = 'replies and forwards only';
$labels['insertsignature'] = 'Insert signature'; $labels['insertsignature'] = 'Insert signature';
$labels['sigbelow'] = 'Place signature below the quoted message'; $labels['sigbelow'] = 'Place signature below the quoted message';
$labels['sigseparator'] = 'Force standard separator in signatures';
$labels['previewpanemarkread'] = 'Mark previewed messages as read'; $labels['previewpanemarkread'] = 'Mark previewed messages as read';
$labels['afternseconds'] = 'after $n seconds'; $labels['afternseconds'] = 'after $n seconds';
$labels['reqmdn'] = 'Always request a return receipt'; $labels['reqmdn'] = 'Always request a return receipt';

@ -484,7 +484,9 @@ function rcmail_compose_header_from($attrib)
$top_posting = intval($RCMAIL->config->get('reply_mode')) > 0 $top_posting = intval($RCMAIL->config->get('reply_mode')) > 0
&& !$RCMAIL->config->get('sig_below') && !$RCMAIL->config->get('sig_below')
&& ($COMPOSE['mode'] == RCUBE_COMPOSE_REPLY || $COMPOSE['mode'] == RCUBE_COMPOSE_FORWARD); && ($COMPOSE['mode'] == RCUBE_COMPOSE_REPLY || $COMPOSE['mode'] == RCUBE_COMPOSE_FORWARD);
$separator = $top_posting ? '---' : '-- '; $separator = $top_posting ? '---' : '-- ';
$add_separator = (bool) $RCMAIL->config->get('sig_separator');
$field_attrib['onchange'] = rcmail_output::JS_OBJECT_NAME.".change_identity(this)"; $field_attrib['onchange'] = rcmail_output::JS_OBJECT_NAME.".change_identity(this)";
$select_from = new html_select($field_attrib); $select_from = new html_select($field_attrib);
@ -500,15 +502,15 @@ function rcmail_compose_header_from($attrib)
if ($sql_arr['html_signature']) { if ($sql_arr['html_signature']) {
$text = $RCMAIL->html2text($html, array('links' => false)); $text = $RCMAIL->html2text($html, array('links' => false));
$text = trim($text); $text = trim($text, "\r\n");
} }
else { else {
$t2h = new rcube_text2html($text, false); $t2h = new rcube_text2html($text, false);
$html = $t2h->get_html(); $html = $t2h->get_html();
} }
if (!preg_match('/^--[ -]\r?\n/m', $text)) { if ($add_separator && !preg_match('/^--[ -]\r?\n/m', $text)) {
$text = $separator . "\n" . $text; $text = $separator . "\n" . ltrim($text, "\r\n");
$html = $separator . "<br>" . $html; $html = $separator . "<br>" . $html;
} }

@ -874,6 +874,20 @@ function rcmail_user_prefs($current = null)
); );
} }
if (!isset($no_override['sig_separator'])) {
if (!$current) {
continue 2;
}
$field_id = 'rcmfd_sig_separator';
$input = new html_checkbox(array('name' => '_sig_separator', 'id' => $field_id, 'value' => 1));
$blocks['sig']['options']['sig_separator'] = array(
'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('sigseparator'))),
'content' => $input->show($RCMAIL->config->get('sig_separator') ? 1 : 0),
);
}
if (!isset($no_override['forward_attachment'])) { if (!isset($no_override['forward_attachment'])) {
if (!$current) { if (!$current) {
continue 2; continue 2;

@ -87,6 +87,7 @@ case 'compose':
'reply_mode' => isset($_POST['_reply_mode']) ? intval($_POST['_reply_mode']) : 0, 'reply_mode' => isset($_POST['_reply_mode']) ? intval($_POST['_reply_mode']) : 0,
'sig_below' => isset($_POST['_sig_below']) ? true : false, 'sig_below' => isset($_POST['_sig_below']) ? true : false,
'strip_existing_sig' => isset($_POST['_strip_existing_sig']), 'strip_existing_sig' => isset($_POST['_strip_existing_sig']),
'sig_separator' => isset($_POST['_sig_separator']) ? true : false,
'default_font' => rcube_utils::get_input_value('_default_font', rcube_utils::INPUT_POST), 'default_font' => rcube_utils::get_input_value('_default_font', rcube_utils::INPUT_POST),
'default_font_size' => rcube_utils::get_input_value('_default_font_size', rcube_utils::INPUT_POST), 'default_font_size' => rcube_utils::get_input_value('_default_font_size', rcube_utils::INPUT_POST),
'reply_all_mode' => intval($_POST['_reply_all_mode']), 'reply_all_mode' => intval($_POST['_reply_all_mode']),

Loading…
Cancel
Save