Aleksander Machniak
2015-09-03 399a2d68b6529f19898b6d6ef3c05add128aadfa
Make optional adding of standard signature separator - sig_separator (#1487768)
6 files modified
30 ■■■■ changed files
CHANGELOG 1 ●●●● patch | view | raw | blame | history
config/defaults.inc.php 3 ●●●●● patch | view | raw | blame | history
program/localization/en_US/labels.inc 1 ●●●● patch | view | raw | blame | history
program/steps/mail/compose.inc 10 ●●●●● patch | view | raw | blame | history
program/steps/settings/func.inc 14 ●●●●● patch | view | raw | blame | history
program/steps/settings/save_prefs.inc 1 ●●●● patch | view | raw | blame | history
CHANGELOG
@@ -1,6 +1,7 @@
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)
- 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)
config/defaults.inc.php
@@ -1116,6 +1116,9 @@
// the signature below the quoted text (sig_below = true).
$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
$config['force_7bit'] = false;
program/localization/en_US/labels.inc
@@ -511,6 +511,7 @@
$labels['replyandforwardonly'] = 'replies and forwards only';
$labels['insertsignature'] = 'Insert signature';
$labels['sigbelow'] = 'Place signature below the quoted message';
$labels['sigseparator'] = 'Force standard separator in signatures';
$labels['previewpanemarkread']  = 'Mark previewed messages as read';
$labels['afternseconds']  = 'after $n seconds';
$labels['reqmdn'] = 'Always request a return receipt';
program/steps/mail/compose.inc
@@ -484,7 +484,9 @@
        $top_posting  = intval($RCMAIL->config->get('reply_mode')) > 0
            && !$RCMAIL->config->get('sig_below')
            && ($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)";
        $select_from = new html_select($field_attrib);
@@ -500,15 +502,15 @@
                if ($sql_arr['html_signature']) {
                    $text = $RCMAIL->html2text($html, array('links' => false));
                    $text = trim($text);
                    $text = trim($text, "\r\n");
                }
                else {
                    $t2h  = new rcube_text2html($text, false);
                    $html = $t2h->get_html();
                }
                if (!preg_match('/^--[ -]\r?\n/m', $text)) {
                    $text = $separator . "\n" . $text;
                if ($add_separator && !preg_match('/^--[ -]\r?\n/m', $text)) {
                    $text = $separator . "\n" . ltrim($text, "\r\n");
                    $html = $separator . "<br>" . $html;
                }
program/steps/settings/func.inc
@@ -874,6 +874,20 @@
                );
            }
            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 (!$current) {
                    continue 2;
program/steps/settings/save_prefs.inc
@@ -87,6 +87,7 @@
        'reply_mode'         => isset($_POST['_reply_mode']) ? intval($_POST['_reply_mode']) : 0,
        'sig_below'          => isset($_POST['_sig_below']) ? true : false,
        '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_size'  => rcube_utils::get_input_value('_default_font_size', rcube_utils::INPUT_POST),
        'reply_all_mode'     => intval($_POST['_reply_all_mode']),