Ticket #1483873: interface_total_messages.patch
| File interface_total_messages.patch, 5.5 kB (added by Scr34m, 2 years ago) |
|---|
-
include/main.inc
1829 1849 console(sprintf("%s: %0.4f sec", $label, $diff)); 1830 1850 } 1831 1851 1852 function interface_total_messages($mbox_name, $force = FALSE ) 1853 { 1854 global $IMAP; 1855 1856 $unsee = $IMAP->messagecount($mbox_name, 'UNSEEN', $force); 1857 $all = $IMAP->messagecount($mbox_name, 'ALL', $force); 1858 1859 if ( $unsee ) { 1860 return sprintf("this.set_unread_count('%s', '%d/%d');\n", addslashes($mbox_name), $unsee, $all); 1861 } else { 1862 return sprintf("this.set_unread_count('%s', '%d');\n", addslashes($mbox_name), $all); 1863 } 1864 1865 } // end func 1866 1832 1867 ?> -
js/app.js
3357 3363 { 3358 3364 // set new text 3359 3365 text_obj = item.firstChild; 3360 reg = /\s+\( [0-9]+\)$/i;3366 reg = /\s+\(.*?\)$/i; 3361 3367 3362 3368 if (count && text_obj.innerHTML.match(reg)) 3363 3369 text_obj.innerHTML = text_obj.innerHTML.replace(reg, ' ('+count+')'); … … 3371 3377 } 3372 3378 3373 3379 // set unread count to window title 3374 reg = /^\( [0-9]+\)\s+/i;3380 reg = /^\(.*?\)\s+/i; 3375 3381 if (set_title && document.title) 3376 3382 { 3377 3383 var doc_title = String(document.title); -
steps/mail/check_recent.inc
30 30 if ($recent_count = $IMAP->messagecount(NULL, 'RECENT', TRUE)) 31 31 { 32 32 $count = $IMAP->messagecount(); 33 $unread_count = $IMAP->messagecount(NULL, 'UNSEEN', TRUE);34 33 35 $commands .= sprintf("this.set_unread_count('%s', %d);\n", addslashes($mbox_name), $unread_count);34 $commands .= interface_total_messages(NULL, TRUE); 36 35 $commands .= sprintf("this.set_env('messagecount', %d);\n", $count); 37 36 $commands .= sprintf("this.set_rowcount('%s');\n", rcmail_get_messagecount_text()); 38 37 $commands .= sprintf("this.set_quota('%s');\n", $IMAP->get_quota()); … … 52 51 else 53 52 { 54 53 if ($IMAP->messagecount($mbox_name, 'RECENT')) 55 $commands .= sprintf("this.set_unread_count('%s', %d);\n", addslashes($mbox_name), $IMAP->messagecount($mbox_name, 'UNSEEN'));54 $commands .= interface_total_messages($mbox_name); 56 55 } 57 56 } 58 57 -
steps/mail/folders.inc
49 49 $commands .= "this.set_env('messagecount', 0);\n"; 50 50 $commands .= "this.set_env('pagecount', 0);\n"; 51 51 $commands .= sprintf("this.set_rowcount('%s');\n", rcmail_get_messagecount_text()); 52 $commands .= sprintf("this.set_unread_count('%s', 0);\n", addslashes($mbox_name));52 $commands .= interface_total_messages($mbox_name); 53 53 } 54 54 else 55 55 $commands = "// purged: $success"; -
steps/mail/getunread.inc
27 27 { 28 28 foreach ($a_folders as $mbox_row) 29 29 { 30 $commands = sprintf("this.set_unread_count('%s', %d);\n", addslashes($mbox_row), $IMAP->messagecount($mbox_row, 'UNSEEN'));30 $commands = interface_total_messages($mbox_row); 31 31 rcube_remote_response($commands, TRUE); 32 32 } 33 33 } -
steps/mail/list.inc
55 55 $a_headers = $IMAP->list_headers($mbox_name, NULL, $sort_col, $sort_order); 56 56 } 57 57 58 $unseen = $IMAP->messagecount($mbox_name, 'UNSEEN', !empty($_GET['_refresh']) ? TRUE : FALSE);59 60 58 // update message count display 61 59 $pages = ceil($count/$IMAP->page_size); 62 60 $commands = sprintf("this.set_env('messagecount', %d);\n", $count); … … 65 63 66 64 // update mailboxlist 67 65 $mbox_name = $IMAP->get_mailbox_name(); 68 $commands .= sprintf("this.set_unread_count('%s', %d);\n", addslashes($mbox_name), $unseen);66 $commands .= interface_total_messages($mbox_name, !empty($_GET['_refresh']) ? TRUE : FALSE); 69 67 70 68 71 69 // add message rows -
steps/mail/mark.inc
32 32 if ($marked != -1) 33 33 { 34 34 $mbox_name = $IMAP->get_mailbox_name(); 35 $commands = sprintf("this.set_unread_count('%s', %d);\n", $mbox_name, $IMAP->messagecount($mbox_name, 'UNSEEN')); 35 36 $commands = interface_total_messages($mbox_name); 36 37 rcube_remote_response($commands); 37 38 } 38 39 } -
steps/mail/move_del.inc
68 68 69 69 // update mailboxlist 70 70 $mbox = $IMAP->get_mailbox_name(); 71 $commands .= sprintf("this.set_unread_count('%s', %d);\n", $mbox, $IMAP->messagecount($mbox, 'UNSEEN'));71 $commands .= interface_total_messages($mbox); 72 72 73 73 if ($_action=='moveto') 74 $commands .= sprintf("this.set_unread_count('%s', %d);\n", $_GET['_target_mbox'], $IMAP->messagecount($_GET['_target_mbox'], 'UNSEEN'));74 $commands .= interface_total_messages($_GET['_target_mbox']); 75 75 76 76 $commands .= sprintf("this.set_quota('%s');\n", $IMAP->get_quota()); 77 77
