- Added 'display_next' option

release-0.6
alecpl 16 years ago
parent 330ef6ca44
commit e54bb72d30

@ -1,6 +1,7 @@
CHANGELOG RoundCube Webmail CHANGELOG RoundCube Webmail
=========================== ===========================
- Added 'display_next' option
- Fix rcube_mdb2::unixtimestamp for MS SQL (#1486015) - Fix rcube_mdb2::unixtimestamp for MS SQL (#1486015)
- Fix HTML washing to respect character encoding - Fix HTML washing to respect character encoding
- Fix endless loop in iil_C_Login() with Courier IMAP (#1486010) - Fix endless loop in iil_C_Login() with Courier IMAP (#1486010)

@ -437,5 +437,8 @@ $rcmail_config['keep_alive'] = 60;
// If true all folders will be checked for recent messages // If true all folders will be checked for recent messages
$rcmail_config['check_all_folders'] = FALSE; $rcmail_config['check_all_folders'] = FALSE;
// If true, after message delete/move, the next message will be displayed
$rcmail_config['display_next'] = FALSE;
// end of config file // end of config file
?> ?>

@ -1890,19 +1890,21 @@ function rcube_webmail()
var selection = this.message_list.get_selection(); var selection = this.message_list.get_selection();
var rows = this.message_list.rows; var rows = this.message_list.rows;
var id; var id;
for (var n=0; n<selection.length; n++) for (var n=0; n<selection.length; n++) {
{
id = selection[n]; id = selection[n];
a_uids[a_uids.length] = id; a_uids[a_uids.length] = id;
this.message_list.remove_row(id, (n == selection.length-1)); this.message_list.remove_row(id, (this.env.display_next && n == selection.length-1));
} }
// make sure there are no selected rows
if (!this.env.display_next)
this.message_list.clear_selection();
} }
// also send search request to get the right messages // also send search request to get the right messages
if (this.env.search_request) if (this.env.search_request)
add_url += '&_search='+this.env.search_request; add_url += '&_search='+this.env.search_request;
if (this.env.next_uid) if (this.env.display_next && this.env.next_uid)
add_url += '&_next_uid='+this.env.next_uid; add_url += '&_next_uid='+this.env.next_uid;
// send request to server // send request to server
@ -2046,12 +2048,16 @@ function rcube_webmail()
r_uids[r_uids.length] = uid; r_uids[r_uids.length] = uid;
if (this.env.skip_deleted) if (this.env.skip_deleted)
this.message_list.remove_row(uid, (i == this.message_list.selection.length-1)); this.message_list.remove_row(uid, (this.env.display_next && i == this.message_list.selection.length-1));
else else
this.set_message(uid, 'deleted', true); this.set_message(uid, 'deleted', true);
} }
} }
// make sure there are no selected rows
if (this.env.skip_deleted && !this.env.display_next && this.message_list)
this.message_list.clear_selection();
add_url = '&_from='+(this.env.action ? this.env.action : ''); add_url = '&_from='+(this.env.action ? this.env.action : '');
if (r_uids.length) if (r_uids.length)
@ -2061,7 +2067,7 @@ function rcube_webmail()
// also send search request to get the right messages // also send search request to get the right messages
if (this.env.search_request) if (this.env.search_request)
add_url += '&_search='+this.env.search_request; add_url += '&_search='+this.env.search_request;
if (this.env.next_uid) if (this.env.display_next && this.env.next_uid)
add_url += '&_next_uid='+this.env.next_uid; add_url += '&_next_uid='+this.env.next_uid;
} }

@ -305,6 +305,7 @@ $labels['2047folding'] = 'Full RFC 2047 (other)';
$labels['advancedoptions'] = 'Advanced options'; $labels['advancedoptions'] = 'Advanced options';
$labels['focusonnewmessage'] = 'Focus browser window on new message'; $labels['focusonnewmessage'] = 'Focus browser window on new message';
$labels['checkallfolders'] = 'Check all folders for new messages'; $labels['checkallfolders'] = 'Check all folders for new messages';
$labels['displaynext'] = 'After message delete/move display the next message';
$labels['folder'] = 'Folder'; $labels['folder'] = 'Folder';
$labels['folders'] = 'Folders'; $labels['folders'] = 'Folders';

@ -245,6 +245,7 @@ $labels['keepalive'] = 'Sprawdzaj czy nadeszły nowe wiadomości';
$labels['everynminutes'] = 'co $n minut(y)'; $labels['everynminutes'] = 'co $n minut(y)';
$labels['never'] = 'nigdy'; $labels['never'] = 'nigdy';
$labels['focusonnewmessage'] = 'Informuj przeglądarkę o nowej wiadomości'; $labels['focusonnewmessage'] = 'Informuj przeglądarkę o nowej wiadomości';
$labels['displaynext'] = 'Po usunięciu/przeniesieniu wiadomości wyświetl następną';
$labels['folder'] = 'Folder'; $labels['folder'] = 'Folder';
$labels['folders'] = 'Foldery'; $labels['folders'] = 'Foldery';
$labels['foldername'] = 'Nazwa folderu'; $labels['foldername'] = 'Nazwa folderu';

@ -93,6 +93,8 @@ if (empty($RCMAIL->action) || $RCMAIL->action == 'list')
$OUTPUT->set_env('read_when_deleted', true); $OUTPUT->set_env('read_when_deleted', true);
if ($CONFIG['skip_deleted']) if ($CONFIG['skip_deleted'])
$OUTPUT->set_env('skip_deleted', true); $OUTPUT->set_env('skip_deleted', true);
if ($CONFIG['display_next'])
$OUTPUT->set_env('display_next', true);
if ($CONFIG['trash_mbox']) if ($CONFIG['trash_mbox'])
$OUTPUT->set_env('trash_mailbox', $CONFIG['trash_mbox']); $OUTPUT->set_env('trash_mailbox', $CONFIG['trash_mbox']);
@ -686,17 +688,15 @@ function rcmail_wash_html($html, $p = array(), $cid_replaces)
$html = preg_replace_callback('/(<[\/!]*)([^ >]+)/', 'rcmail_html_tag_callback', $html); $html = preg_replace_callback('/(<[\/!]*)([^ >]+)/', 'rcmail_html_tag_callback', $html);
// charset was converted to UTF-8 in rcube_imap::get_message_part(), // charset was converted to UTF-8 in rcube_imap::get_message_part(),
// -> change charset specification in HTML accordingly // change charset specification in HTML accordingly
$charset_pattern = '(content=[\'"]?\w+\/\w+;\s*charset)=([a-z0-9-_]+)'; $charset_pattern = '/(\s+content=[\'"]?\w+\/\w+;\s*charset)=([a-z0-9-_]+)/i';
if (preg_match("/<meta\s+[^>]*$charset_pattern/Ui", $html)) { if (preg_match($charset_pattern, $html)) {
$html = preg_replace("/\s+$charset_pattern/i", '\\1='.RCMAIL_CHARSET, $html); $html = preg_replace($charset_pattern, '\\1='.RCMAIL_CHARSET, $html);
} }
else { // add head for malformed messages, washtml cannot work without that
// add meta content-type to malformed messages, washtml cannot work without that
if (!preg_match('/<head[^>]*>(.*)<\/head>/Uims', $html)) if (!preg_match('/<head[^>]*>(.*)<\/head>/Uims', $html))
$html = '<head></head>'. $html; $html = '<head></head>'. $html;
$html = substr_replace($html, '<meta http-equiv="Content-Type" content="text/html; charset='.RCMAIL_CHARSET.'" />', intval(stripos($html, '<head>')+6), 0); $html = substr_replace($html, '<meta http-equiv="Content-Type" content="text/html; charset='.RCMAIL_CHARSET.'" />', intval(stripos($html, '<head>')+6), 0);
}
// turn relative into absolute urls // turn relative into absolute urls
$html = rcmail_resolve_base($html); $html = rcmail_resolve_base($html);

@ -143,6 +143,9 @@ if ($_GET['_uid']) {
$OUTPUT->set_env('last_uid', $last); $OUTPUT->set_env('last_uid', $last);
} }
if ($CONFIG['display_next'])
$OUTPUT->set_env('display_next', true);
if (!$MESSAGE->headers->seen) if (!$MESSAGE->headers->seen)
$RCMAIL->plugins->exec_hook('message_read', array('uid' => $MESSAGE->uid, $RCMAIL->plugins->exec_hook('message_read', array('uid' => $MESSAGE->uid,
'mailbox' => $IMAP->mailbox, 'message' => $MESSAGE)); 'mailbox' => $IMAP->mailbox, 'message' => $MESSAGE));

@ -258,13 +258,21 @@ function rcmail_user_prefs_block($part, $no_override, $attrib)
$table->add(null, $input_inline_images->show($config['inline_images']?1:0)); $table->add(null, $input_inline_images->show($config['inline_images']?1:0));
} }
// "display after delete" checkbox
if (!isset($no_override['display_next'])) {
$field_id = 'rcmfd_displaynext';
$input_displaynext = new html_checkbox(array('name' => '_display_next', 'id' => $field_id, 'value' => 1));
$table->add('title', html::label($field_id, Q(rcube_label('displaynext'))));
$table->add(null, $input_displaynext->show($config['display_next']?1:0));
}
$RCMAIL->plugins->exec_hook('user_preferences', array('section' => $part, 'table' => $table)); $RCMAIL->plugins->exec_hook('user_preferences', array('section' => $part, 'table' => $table));
if ($table->size()) if ($table->size())
$out = html::tag('fieldset', null, html::tag('legend', null, Q(rcube_label('messagesdisplaying'))) . $table->show($attrib)); $out = html::tag('fieldset', null, html::tag('legend', null, Q(rcube_label('messagesdisplaying'))) . $table->show($attrib));
break; break;
// Mail composition // Mail composition
case 'compose': case 'compose':
$table = new html_table(array('cols' => 2)); $table = new html_table(array('cols' => 2));

@ -29,6 +29,7 @@ $a_user_prefs = array(
'htmleditor' => isset($_POST['_htmleditor']) ? TRUE : FALSE, 'htmleditor' => isset($_POST['_htmleditor']) ? TRUE : FALSE,
'inline_images' => isset($_POST['_inline_images']) ? TRUE : FALSE, 'inline_images' => isset($_POST['_inline_images']) ? TRUE : FALSE,
'preview_pane' => isset($_POST['_preview_pane']) ? TRUE : FALSE, 'preview_pane' => isset($_POST['_preview_pane']) ? TRUE : FALSE,
'display_next' => isset($_POST['_display_next']) ? TRUE : FALSE,
'focus_on_new_message' => isset($_POST['_focus_on_new_message']) ? TRUE : FALSE, 'focus_on_new_message' => isset($_POST['_focus_on_new_message']) ? TRUE : FALSE,
'read_when_deleted' => isset($_POST['_read_when_deleted']) ? TRUE : FALSE, 'read_when_deleted' => isset($_POST['_read_when_deleted']) ? TRUE : FALSE,
'skip_deleted' => isset($_POST['_skip_deleted']) ? TRUE : FALSE, 'skip_deleted' => isset($_POST['_skip_deleted']) ? TRUE : FALSE,

Loading…
Cancel
Save