Changeset 6d2714b in github
- Timestamp:
- Apr 11, 2008 12:53:59 PM (5 years ago)
- Branches:
- master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
- Children:
- 480f8c5a
- Parents:
- fe6b7ae
- Files:
-
- 1 deleted
- 6 edited
-
index.php (modified) (1 diff)
-
program/js/app.js (modified) (4 diffs)
-
program/steps/mail/check_recent.inc (modified) (1 diff)
-
program/steps/mail/func.inc (modified) (3 diffs)
-
program/steps/mail/move_del.inc (modified) (1 diff)
-
program/steps/mail/quotadisplay.inc (deleted)
-
program/steps/mail/show.inc (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
index.php
reaa3947 r6d2714b 327 327 include('program/steps/mail/rss.inc'); 328 328 329 if ($_action=='quotadisplay')330 include('program/steps/mail/quotadisplay.inc');331 332 333 329 // make sure the message count is refreshed 334 330 $IMAP->messagecount($_SESSION['mbox'], 'ALL', TRUE); -
program/js/app.js
rcb6b51e r6d2714b 180 180 this.enable_command('compose', 'add-contact', false); 181 181 parent.rcmail.show_contentframe(true); 182 parent.rcmail.mark_message('read', this.env.uid);183 182 } 184 183 … … 1570 1569 this.http_post('mark', '_uid='+a_uids.join(',')+'&_flag='+flag); 1571 1570 }; 1571 1572 // set class to read/unread 1573 this.mark_as_read_from_preview = function(uid) 1574 { 1575 var icn_src; 1576 var rows = parent.rcmail.message_list.rows; 1577 if(rows[uid].unread) 1578 { 1579 rows[uid].unread = false; 1580 rows[uid].classname = rows[uid].classname.replace(/\s*unread/, ''); 1581 parent.rcmail.set_classname(rows[uid].obj, 'unread', false); 1582 1583 if (rows[uid].replied && parent.rcmail.env.repliedicon) 1584 icn_src = parent.rcmail.env.repliedicon; 1585 else if (parent.rcmail.env.messageicon) 1586 icn_src = parent.rcmail.env.messageicon; 1587 1588 if (rows[uid].icon && icn_src) 1589 rows[uid].icon.src = icn_src; 1590 } 1591 } 1592 1572 1593 1573 1594 // mark all message rows as deleted/undeleted … … 3255 3276 }; 3256 3277 3278 3257 3279 // replace content of quota display 3258 this.set_quota = function() 3259 { 3260 if (this.gui_objects.quotadisplay && 3261 this.gui_objects.quotadisplay.attributes.getNamedItem('display') && 3262 this.gui_objects.quotadisplay.attributes.getNamedItem('id')) 3263 this.http_request('quotadisplay', '_display='+ 3264 this.gui_objects.quotadisplay.attributes.getNamedItem('display').nodeValue+ 3265 '&_id='+this.gui_objects.quotadisplay.attributes.getNamedItem('id').nodeValue, false); 3266 }; 3280 this.set_quota = function(content) 3281 { 3282 if (this.gui_objects.quotadisplay && content) 3283 this.gui_objects.quotadisplay.innerHTML = content; 3284 }; 3267 3285 3268 3286 … … 3309 3327 }; 3310 3328 3311 3329 // update parent's mailboxlist (from preview) 3330 this.set_unread_count_from_preview = function(mbox, count, set_title) 3331 { 3332 parent.rcmail.set_unread_count(mbox, count, set_title); 3333 } 3334 3312 3335 // add row to contacts list 3313 3336 this.add_contact_row = function(cid, cols, select) -
program/steps/mail/check_recent.inc
rcf1f0f9 r6d2714b 38 38 $OUTPUT->command('set_unread_count', $mbox_name, $unread_count, ($mbox_name == 'INBOX')); 39 39 $OUTPUT->command('set_rowcount', rcmail_get_messagecount_text()); 40 $OUTPUT->command('set_quota', $IMAP->get_quota());40 $OUTPUT->command('set_quota', rcmail_quota_content($IMAP->get_quota())); 41 41 42 42 // add new message headers to list -
program/steps/mail/func.inc
r3790508 r6d2714b 409 409 $attrib['id'] = 'rcmquotadisplay'; 410 410 411 if(isset($attrib['display'])) 412 $_SESSION['quota_display'] = $attrib['display']; 413 411 414 $OUTPUT->add_gui_object('quotadisplay', $attrib['id']); 412 415 … … 415 418 416 419 $out = '<span' . $attrib_str . '>'; 417 $out .= rcmail_quota_content( $attrib['display']);420 $out .= rcmail_quota_content(); 418 421 $out .= '</span>'; 419 422 return $out; … … 421 424 422 425 423 function rcmail_quota_content($ display)426 function rcmail_quota_content($quota=NULL) 424 427 { 425 428 global $IMAP, $COMM_PATH; 426 429 427 if (!$IMAP->get_capability('QUOTA')) 428 $quota_text = rcube_label('unknown'); 429 else if ($quota = $IMAP->get_quota()) 430 { 431 $quota_text = sprintf("%s / %s (%.0f%%)", 432 show_bytes($quota["used"] * 1024), 433 show_bytes($quota["total"] * 1024), 434 $quota["percent"]); 430 $display = isset($_SESSION['quota_display']) ? $_SESSION['quota_display'] : ''; 431 432 if (is_array($quota) && !empty($quota['used']) && !empty($quota['total'])) 433 { 434 if (!isset($quota['percent'])) 435 $quota['percent'] = $quota['used'] / $quota['total']; 436 } 437 elseif (!$IMAP->get_capability('QUOTA')) 438 return rcube_label('unknown'); 439 else 440 $quota = $IMAP->get_quota(); 441 442 if ($quota) 443 { 444 $quota_text = sprintf('%s / %s (%.0f%%)', 445 show_bytes($quota['used'] * 1024), 446 show_bytes($quota['total'] * 1024), 447 $quota['percent']); 435 448 436 449 // show quota as image (by Brett Patterson) -
program/steps/mail/move_del.inc
rd41d67a r6d2714b 93 93 $OUTPUT->command('set_unread_count', $target, $IMAP->messagecount($target, 'UNSEEN')); 94 94 95 $OUTPUT->command('set_quota', $IMAP->get_quota());95 $OUTPUT->command('set_quota', rcmail_quota_content($IMAP->get_quota())); 96 96 97 97 // add new rows from next page (if any) -
program/steps/mail/show.inc
r17b5fb7 r6d2714b 54 54 $MESSAGE['is_safe'] = 1; 55 55 56 $mbox_name = $IMAP->get_mailbox_name(); 57 56 58 // calculate Etag for this request 57 $etag = md5($MESSAGE['UID'].$ IMAP->get_mailbox_name().session_id().intval($MESSAGE['headers']->mdn_sent).intval($MESSAGE['is_safe']).intval($PRINT_MODE));59 $etag = md5($MESSAGE['UID'].$mbox_name.session_id().intval($MESSAGE['headers']->mdn_sent).intval($MESSAGE['is_safe']).intval($PRINT_MODE)); 58 60 59 61 // allow caching, unless remote images are present … … 76 78 $MESSAGE['body'] = $IMAP->get_body($MESSAGE['UID']); 77 79 78 79 80 // mark message as read 80 if (!$MESSAGE['headers']->seen && $_action != 'preview') 81 $IMAP->set_flag($MESSAGE['UID'], 'SEEN'); 81 if (!$MESSAGE['headers']->seen) 82 { 83 $marked = $IMAP->set_flag($MESSAGE['UID'], 'SEEN'); 84 if($_action == 'preview' && $marked != -1) 85 { 86 $OUTPUT->command('set_unread_count_from_preview', $mbox_name, $IMAP->messagecount($mbox_name, 'UNSEEN'), ($mbox_name == 'INBOX')); 87 $OUTPUT->command('mark_as_read_from_preview', $MESSAGE['UID']); 88 } 89 } 82 90 83 91 // give message uid to the client … … 86 94 87 95 // check for unset disposition notification 88 if ($MESSAGE['headers']->mdn_to && !$MESSAGE['headers']->mdn_sent && $ IMAP->get_mailbox_name()!= $CONFIG['drafts_mbox'])96 if ($MESSAGE['headers']->mdn_to && !$MESSAGE['headers']->mdn_sent && $mbox_name != $CONFIG['drafts_mbox']) 89 97 { 90 98 if (intval($CONFIG['mdn_requests']) === 1)
Note: See TracChangeset
for help on using the changeset viewer.
