summaryrefslogtreecommitdiff
path: root/program/steps
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2009-07-31 09:07:54 +0000
committeralecpl <alec@alec.pl>2009-07-31 09:07:54 +0000
commite54bb72d30cfd88fcef5434b472fb3d9b2cca710 (patch)
tree7497dc73313ac3d17ea6c00795731b9a7b212a93 /program/steps
parent330ef6ca44df4111d6f6b33ba0684e865ba8c30e (diff)
- Added 'display_next' option
Diffstat (limited to 'program/steps')
-rw-r--r--program/steps/mail/func.inc22
-rw-r--r--program/steps/mail/show.inc5
-rw-r--r--program/steps/settings/func.inc10
-rw-r--r--program/steps/settings/save_prefs.inc1
4 files changed, 25 insertions, 13 deletions
diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc
index 21f0fede7..d82c8ef71 100644
--- a/program/steps/mail/func.inc
+++ b/program/steps/mail/func.inc
@@ -93,6 +93,8 @@ if (empty($RCMAIL->action) || $RCMAIL->action == 'list')
$OUTPUT->set_env('read_when_deleted', true);
if ($CONFIG['skip_deleted'])
$OUTPUT->set_env('skip_deleted', true);
+ if ($CONFIG['display_next'])
+ $OUTPUT->set_env('display_next', true);
if ($CONFIG['trash_mbox'])
$OUTPUT->set_env('trash_mailbox', $CONFIG['trash_mbox']);
@@ -686,18 +688,16 @@ function rcmail_wash_html($html, $p = array(), $cid_replaces)
$html = preg_replace_callback('/(<[\/!]*)([^ >]+)/', 'rcmail_html_tag_callback', $html);
// charset was converted to UTF-8 in rcube_imap::get_message_part(),
- // -> change charset specification in HTML accordingly
- $charset_pattern = '(content=[\'"]?\w+\/\w+;\s*charset)=([a-z0-9-_]+)';
- if (preg_match("/<meta\s+[^>]*$charset_pattern/Ui", $html)) {
- $html = preg_replace("/\s+$charset_pattern/i", '\\1='.RCMAIL_CHARSET, $html);
+ // change charset specification in HTML accordingly
+ $charset_pattern = '/(\s+content=[\'"]?\w+\/\w+;\s*charset)=([a-z0-9-_]+)/i';
+ if (preg_match($charset_pattern, $html)) {
+ $html = preg_replace($charset_pattern, '\\1='.RCMAIL_CHARSET, $html);
}
- else {
- // add meta content-type to malformed messages, washtml cannot work without that
- if (!preg_match('/<head[^>]*>(.*)<\/head>/Uims', $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);
- }
-
+ // add head for malformed messages, washtml cannot work without that
+ if (!preg_match('/<head[^>]*>(.*)<\/head>/Uims', $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);
+
// turn relative into absolute urls
$html = rcmail_resolve_base($html);
diff --git a/program/steps/mail/show.inc b/program/steps/mail/show.inc
index 068ccbcd7..88961e9aa 100644
--- a/program/steps/mail/show.inc
+++ b/program/steps/mail/show.inc
@@ -78,7 +78,7 @@ if ($_GET['_uid']) {
$OUTPUT->set_env('trash_mailbox', $CONFIG['trash_mbox']);
if (!$OUTPUT->ajax_call)
$OUTPUT->add_label('checkingmail', 'deletemessage', 'movemessagetotrash', 'movingmessage');
-
+
// check for unset disposition notification
if ($MESSAGE->headers->mdn_to &&
!$MESSAGE->headers->mdn_sent && !$MESSAGE->headers->seen &&
@@ -143,6 +143,9 @@ if ($_GET['_uid']) {
$OUTPUT->set_env('last_uid', $last);
}
+ if ($CONFIG['display_next'])
+ $OUTPUT->set_env('display_next', true);
+
if (!$MESSAGE->headers->seen)
$RCMAIL->plugins->exec_hook('message_read', array('uid' => $MESSAGE->uid,
'mailbox' => $IMAP->mailbox, 'message' => $MESSAGE));
diff --git a/program/steps/settings/func.inc b/program/steps/settings/func.inc
index f72b437c9..f833c1a5c 100644
--- a/program/steps/settings/func.inc
+++ b/program/steps/settings/func.inc
@@ -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));
}
+ // "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));
if ($table->size())
$out = html::tag('fieldset', null, html::tag('legend', null, Q(rcube_label('messagesdisplaying'))) . $table->show($attrib));
break;
-
// Mail composition
case 'compose':
$table = new html_table(array('cols' => 2));
diff --git a/program/steps/settings/save_prefs.inc b/program/steps/settings/save_prefs.inc
index 8430ffd88..910cab692 100644
--- a/program/steps/settings/save_prefs.inc
+++ b/program/steps/settings/save_prefs.inc
@@ -29,6 +29,7 @@ $a_user_prefs = array(
'htmleditor' => isset($_POST['_htmleditor']) ? TRUE : FALSE,
'inline_images' => isset($_POST['_inline_images']) ? 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,
'read_when_deleted' => isset($_POST['_read_when_deleted']) ? TRUE : FALSE,
'skip_deleted' => isset($_POST['_skip_deleted']) ? TRUE : FALSE,