Aleksander Machniak
2012-08-26 651c7b6e9df38a3b7cdf6daebed39021d88c3bea
Add option to not include original message on reply, rename option top_posting to reply_mode (#1485149)
8 files modified
53 ■■■■■ changed files
CHANGELOG 1 ●●●● patch | view | raw | blame | history
config/main.inc.php.dist 7 ●●●● patch | view | raw | blame | history
installer/rcube_install.php 11 ●●●● patch | view | raw | blame | history
program/include/rcube_config.php 1 ●●●● patch | view | raw | blame | history
program/localization/en_US/labels.inc 5 ●●●●● patch | view | raw | blame | history
program/steps/mail/compose.inc 9 ●●●●● patch | view | raw | blame | history
program/steps/settings/func.inc 15 ●●●● patch | view | raw | blame | history
program/steps/settings/save_prefs.inc 4 ●●●● patch | view | raw | blame | history
CHANGELOG
@@ -1,6 +1,7 @@
CHANGELOG Roundcube Webmail
===========================
- Add option to not include original message on reply, rename option top_posting to reply_mode (#1485149)
- Fix Larry's messages list filter in IE (#1488632)
- Fix more IE issues by disabling Compat. mode with X-UA-Compatible meta tag (#1488626)
- Fix setting locales under Solaris - use additional .UTF-8 suffix (#1488628)
config/main.inc.php.dist
@@ -783,8 +783,11 @@
// 2 - Expand only threads with unread messages 
$rcmail_config['autoexpand_threads'] = 0;
// When replying place cursor above original message (top posting)
$rcmail_config['top_posting'] = false;
// When replying:
// -1 - don't cite the original message
// 0  - place cursor below the original message
// 1  - place cursor above original message (top posting)
$rcmail_config['reply_mode'] = 0;
// When replying strip original signature from message
$rcmail_config['strip_existing_sig'] = true;
installer/rcube_install.php
@@ -35,13 +35,14 @@
  var $obsolete_config = array('db_backend', 'double_auth');
  var $replaced_config = array(
    'skin_path' => 'skin',
    'locale_string' => 'language',
    'multiple_identities' => 'identities_level',
    'skin_path'            => 'skin',
    'locale_string'        => 'language',
    'multiple_identities'  => 'identities_level',
    'addrbook_show_images' => 'show_images',
    'imap_root' => 'imap_ns_personal',
    'pagesize' => 'mail_pagesize',
    'imap_root'            => 'imap_ns_personal',
    'pagesize'             => 'mail_pagesize',
    'default_imap_folders' => 'default_folders',
    'top_posting'          => 'reply_mode',
  );
  // these config options are required for a working system
program/include/rcube_config.php
@@ -42,6 +42,7 @@
        'default_folders'      => 'default_imap_folders',
        'mail_pagesize'        => 'pagesize',
        'addressbook_pagesize' => 'pagesize',
        'reply_mode'           => 'top_posting',
    );
program/localization/en_US/labels.inc
@@ -429,8 +429,9 @@
$labels['newmessage'] = 'New Message';
$labels['signatureoptions'] = 'Signature Options';
$labels['whenreplying'] = 'When replying';
$labels['replytopposting'] = 'start new message above original';
$labels['replybottomposting'] = 'start new message below original';
$labels['replyempty'] = 'do not quote the original message';
$labels['replytopposting'] = 'start new message above the quote';
$labels['replybottomposting'] = 'start new message below the quote';
$labels['replyremovesignature'] = 'When replying remove original signature from message';
$labels['autoaddsignature'] = 'Automatically add signature';
$labels['newmessageonly'] = 'new message only';
program/steps/mail/compose.inc
@@ -139,7 +139,7 @@
// set current mailbox in client environment
$OUTPUT->set_env('mailbox', $RCMAIL->storage->get_folder());
$OUTPUT->set_env('sig_above', $RCMAIL->config->get('sig_above', false));
$OUTPUT->set_env('top_posting', $RCMAIL->config->get('top_posting', false));
$OUTPUT->set_env('top_posting', intval($RCMAIL->config->get('reply_mode')) > 0);
$OUTPUT->set_env('recipients_separator', trim($RCMAIL->config->get('recipients_separator', ',')));
// default font for HTML editor
@@ -641,7 +641,7 @@
      rcmail_write_forward_attachment($MESSAGE);
  }
  // reply/edit/draft/forward
  else if ($compose_mode) {
  else if ($compose_mode && ($compose_mode != RCUBE_COMPOSE_REPLY || $RCMAIL->config->get('reply_mode') != -1)) {
    $isHtml = rcmail_compose_editor_mode();
    if (!empty($MESSAGE->parts)) {
@@ -906,8 +906,9 @@
    $prefix .= "\n";
    $suffix = '';
    if ($RCMAIL->config->get('top_posting'))
    if (intval($RCMAIL->config->get('reply_mode')) > 0) { // top-posting
      $prefix = "\n\n\n" . $prefix;
    }
  }
  else {
    // save inline images to files
@@ -921,7 +922,7 @@
    $prefix = '<p>' . Q($prefix) . "</p>\n";
    $prefix .= '<blockquote>';
    if ($RCMAIL->config->get('top_posting')) {
    if (intval($RCMAIL->config->get('reply_mode')) > 0) { // top-posting
      $prefix = '<br>' . $prefix;
      $suffix = '</blockquote>';
    }
program/steps/settings/func.inc
@@ -544,16 +544,17 @@
      );
    }
    if (!isset($no_override['top_posting'])) {
      $field_id = 'rcmfd_top_posting';
      $select_replymode = new html_select(array('name' => '_top_posting', 'id' => $field_id,
        'onchange' => "\$('#rcmfd_sig_above').attr('disabled',this.selectedIndex==0)"));
    if (!isset($no_override['reply_mode'])) {
      $field_id = 'rcmfd_reply_mode';
      $select_replymode = new html_select(array('name' => '_reply_mode', 'id' => $field_id,
        'onchange' => "\$('#rcmfd_sig_above').attr('disabled',this.selectedIndex<2)"));
      $select_replymode->add(rcube_label('replyempty'), -1);
      $select_replymode->add(rcube_label('replybottomposting'), 0);
      $select_replymode->add(rcube_label('replytopposting'), 1);
      $blocks['main']['options']['top_posting'] = array(
      $blocks['main']['options']['reply_mode'] = array(
        'title' => html::label($field_id, Q(rcube_label('whenreplying'))),
        'content' => $select_replymode->show($config['top_posting']?1:0),
        'content' => $select_replymode->show(intval($config['reply_mode'])),
      );
    }
@@ -597,7 +598,7 @@
    if (!isset($no_override['sig_above'])) {
      $field_id = 'rcmfd_sig_above';
      $select_sigabove = new html_select(array('name' => '_sig_above', 'id' => $field_id, 'disabled' => !$config['top_posting']));
      $select_sigabove = new html_select(array('name' => '_sig_above', 'id' => $field_id, 'disabled' => $config['reply_mode'] < 1));
      $select_sigabove->add(rcube_label('belowquote'), 0);
      $select_sigabove->add(rcube_label('abovequote'), 1);
program/steps/settings/save_prefs.inc
@@ -82,9 +82,9 @@
      'spellcheck_ignore_nums' => isset($_POST['_spellcheck_ignore_nums']) ? TRUE : FALSE,
      'spellcheck_ignore_caps' => isset($_POST['_spellcheck_ignore_caps']) ? TRUE : FALSE,
      'show_sig'           => isset($_POST['_show_sig']) ? intval($_POST['_show_sig']) : 1,
      'top_posting'        => !empty($_POST['_top_posting']),
      'reply_mode'         => isset($_POST['_reply_mode']) ? intval($_POST['_reply_mode']) : 0,
      'strip_existing_sig' => isset($_POST['_strip_existing_sig']),
      'sig_above'          => !empty($_POST['_sig_above']) && !empty($_POST['_top_posting']),
      'sig_above'          => !empty($_POST['_sig_above']) && $_POST['_reply_mode'] < 1,
      'default_font'       => get_input_value('_default_font', RCUBE_INPUT_POST),
      'forward_attachment' => !empty($_POST['_forward_attachment']),
    );