Ignore:
Timestamp:
Sep 17, 2009 8:36:32 AM (4 years ago)
Author:
alec
Message:
  • some code improvements for r2959 change
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/roundcubemail/program/steps/mail/func.inc

    r2944 r2960  
    490490 
    491491 
    492 /** 
    493  * 
    494  */ 
    495492function rcmail_messagecount_display($attrib) 
    496493  { 
     
    506503 
    507504 
    508 /** 
    509  * 
    510  */ 
    511505function rcmail_quota_display($attrib) 
    512506  { 
     
    525519 
    526520 
    527 /** 
    528  * 
    529  */ 
    530521function rcmail_quota_content($quota=NULL, $attrib=NULL) 
    531522  { 
     
    580571 
    581572 
    582 /** 
    583  * 
    584  */ 
    585573function rcmail_get_messagecount_text($count=NULL, $page=NULL) 
    586574  { 
     
    611599  } 
    612600 
    613 /** 
    614  * 
    615  */ 
     601 
    616602function rcmail_mailbox_name_display($attrib) 
    617603{ 
    618     global $RCMAIL; 
    619  
    620     if (!$attrib['id']) 
    621         $attrib['id'] = 'rcmmailboxname'; 
    622  
    623     $RCMAIL->output->add_gui_object('mailboxname', $attrib['id']); 
    624  
    625     return html::span($attrib, rcmail_get_mailbox_name_text()); 
     604  global $RCMAIL; 
     605 
     606  if (!$attrib['id']) 
     607    $attrib['id'] = 'rcmmailboxname'; 
     608 
     609  $RCMAIL->output->add_gui_object('mailboxname', $attrib['id']); 
     610 
     611  return html::span($attrib, rcmail_get_mailbox_name_text()); 
    626612} 
    627613 
    628614function rcmail_get_mailbox_name_text() 
    629615{ 
    630     global $RCMAIL; 
    631     return rcmail_localize_foldername($RCMAIL->imap->get_mailbox_name()); 
    632 } 
     616  global $RCMAIL; 
     617  return rcmail_localize_foldername($RCMAIL->imap->get_mailbox_name()); 
     618} 
     619 
     620 
     621function rcmail_send_unread_count($mbox_name, $force=false) 
     622{ 
     623  global $RCMAIL; 
     624     
     625  $old_unseen = $_SESSION['unseen_count'][$mbox_name]; 
     626  $unseen = $RCMAIL->imap->messagecount($mbox_name, 'UNSEEN', $force); 
     627 
     628  if ($unseen != $old_unseen) 
     629    $RCMAIL->output->command('set_unread_count', $mbox_name, $unseen, ($mbox_name == 'INBOX')); 
     630 
     631  // @TODO: this data is doubled (session and cache tables) if caching is enabled 
     632  $_SESSION['unseen_count'][$mbox_name] = $unseen; 
     633     
     634  return $unseen; 
     635} 
     636                               
    633637 
    634638/** 
Note: See TracChangeset for help on using the changeset viewer.