diff options
author | alecpl <alec@alec.pl> | 2008-11-13 10:30:06 +0000 |
---|---|---|
committer | alecpl <alec@alec.pl> | 2008-11-13 10:30:06 +0000 |
commit | e538b3dc7d740c5a9213ef352437f249be856d3a (patch) | |
tree | 5ff0bf1bf9b0a336ad5da3e29d11e4e3305f6558 /program/steps/mail/func.inc | |
parent | 6fa87f3fa5579da0935dc6ee29af77aea19ad872 (diff) |
- Added message status filter + fixes for r2046 (searching with SORT)
Diffstat (limited to 'program/steps/mail/func.inc')
-rw-r--r-- | program/steps/mail/func.inc | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc index ca7c4e727..d2bc6a9be 100644 --- a/program/steps/mail/func.inc +++ b/program/steps/mail/func.inc @@ -1292,6 +1292,36 @@ function rcmail_send_mdn($uid) } +function rcmail_search_filter($attrib) +{ + global $OUTPUT; + + if (!strlen($attrib['id'])) + $attrib['id'] = 'rcmlistfilter'; + + $attrib['onchange'] = JS_OBJECT_NAME.'.filter_mailbox(this.value)'; + + /* + RFC3501 (6.4.4): 'ALL', 'RECENT', + 'ANSWERED', 'DELETED', 'FLAGGED', 'SEEN', + 'UNANSWERED', 'UNDELETED', 'UNFLAGGED', 'UNSEEN', + 'NEW', // = (RECENT UNSEEN) + 'OLD' // = NOT RECENT + */ + + $select_filter = new html_select($attrib); + $select_filter->add(rcube_label('all'), 'ALL'); + $select_filter->add(rcube_label('unread'), 'UNSEEN'); + $select_filter->add(rcube_label('flagged'), 'FLAGGED'); + $select_filter->add(rcube_label('unanswered'), 'UNANSWERED'); + + $out = $select_filter->show($_SESSION['search_filter']); + + $OUTPUT->add_gui_object('search_filter', $attrib['id']); + + return $out; +} + // register UI objects $OUTPUT->add_handlers(array( 'mailboxlist' => 'rcmail_mailbox_list', @@ -1304,6 +1334,7 @@ $OUTPUT->add_handlers(array( 'messagecontentframe' => 'rcmail_messagecontent_frame', 'messagepartframe' => 'rcmail_message_part_frame', 'messagepartcontrols' => 'rcmail_message_part_controls', + 'searchfilter' => 'rcmail_search_filter', 'searchform' => array($OUTPUT, 'search_form'), )); |