diff options
author | thomascube <thomas@roundcube.net> | 2007-05-18 12:35:28 +0000 |
---|---|---|
committer | thomascube <thomas@roundcube.net> | 2007-05-18 12:35:28 +0000 |
commit | 06895c3e947e1b15da3bb2f6f425962949edb9d9 (patch) | |
tree | 96349ba7b7b05dcc913e5f07cc95b8412bd554c3 | |
parent | ae895a9d3cbffbcf09d23eab1280173ff748c53e (diff) |
Better refresh of message list; improved HTML mail display
-rw-r--r-- | program/js/app.js | 4 | ||||
-rw-r--r-- | program/steps/mail/func.inc | 22 | ||||
-rw-r--r-- | program/steps/mail/list.inc | 7 |
3 files changed, 19 insertions, 14 deletions
diff --git a/program/js/app.js b/program/js/app.js index 3ee54f684..65bbee9a3 100644 --- a/program/js/app.js +++ b/program/js/app.js @@ -1244,13 +1244,15 @@ function rcube_webmail() if (!page && mbox != this.env.mailbox) { page = 1; - add_url += '&_refresh=1'; this.env.current_page = page; if (this.message_list) this.message_list.clear_selection(); this.show_contentframe(false); } + if (mbox != this.env.mailbox || (mbox == this.env.mailbox && !page && !sort)) + add_url += '&_refresh=1'; + this.select_folder(mbox, this.env.mailbox); this.env.mailbox = mbox; diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc index fc1741700..cc1187bd9 100644 --- a/program/steps/mail/func.inc +++ b/program/steps/mail/func.inc @@ -1207,16 +1207,18 @@ function rcmail_sanitize_html($body, $container_id) $body = preg_replace('/<a\s+([^>]+)>/Uie', "rcmail_alter_html_link('\\1');", $body); // add comments arround html and other tags - $out = preg_replace(array('/(<\/?html[^>]*>)/i', - '/(<\/?head[^>]*>)/i', - '/(<title[^>]*>.*<\/title>)/Ui', - '/(<\/?meta[^>]*>)/i'), - '<!--\\1-->', - $body); - - $out = preg_replace(array('/(<body[^>]*>)/i', - '/(<\/body>)/i'), - array('<div class="rcmBody">', + $out = preg_replace(array( + '/(<!DOCTYPE.+)/i', + '/(<\/?html[^>]*>)/i', + '/(<\/?head[^>]*>)/i', + '/(<title[^>]*>.*<\/title>)/Ui', + '/(<\/?meta[^>]*>)/i'), + '<!--\\1-->', + $body); + + $out = preg_replace(array('/<body([^>]*)>/i', + '/<\/body>/i'), + array('<div class="rcmBody"\\1>', '</div>'), $out); diff --git a/program/steps/mail/list.inc b/program/steps/mail/list.inc index a246254d1..6c727068d 100644 --- a/program/steps/mail/list.inc +++ b/program/steps/mail/list.inc @@ -37,12 +37,13 @@ else $sort_order = isset($_SESSION['sort_order']) ? $_SESSION['sort_order'] : $CONFIG['message_sort_order']; } +$mbox_name = $IMAP->get_mailbox_name(); // fetch message headers -if ($count = $IMAP->messagecount()) +if ($count = $IMAP->messagecount($mbox_name, 'ALL', !empty($_REQUEST['_refresh']))) $a_headers = $IMAP->list_headers($mbox_name, NULL, $sort_col, $sort_order); -$unseen = $IMAP->messagecount($mbox_name, 'UNSEEN', !empty($_REQUEST['_refresh']) ? TRUE : FALSE); +$unseen = $IMAP->messagecount($mbox_name, 'UNSEEN', !empty($_REQUEST['_refresh'])); // update message count display $pages = ceil($count/$IMAP->page_size); @@ -51,7 +52,7 @@ $OUTPUT->set_env('pagecount', $pages); $OUTPUT->command('set_rowcount', rcmail_get_messagecount_text($count)); // update mailboxlist -$OUTPUT->command('set_unread_count', $IMAP->get_mailbox_name(), $unseen); +$OUTPUT->command('set_unread_count', $mbox_name, $unseen); // add message rows |