Changeset 3ea0e32 in github for program/steps/mail/func.inc


Ignore:
Timestamp:
Sep 1, 2006 9:43:14 AM (7 years ago)
Author:
thomascube <thomas@…>
Branches:
master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
Children:
8cb245c
Parents:
ea206d3
Message:

Quota display as image

File:
1 edited

Legend:

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

    rea206d3 r3ea0e32  
    612612function rcmail_quota_display($attrib) 
    613613  { 
    614   global $IMAP, $OUTPUT, $JS_OBJECT_NAME; 
     614  global $IMAP, $OUTPUT, $JS_OBJECT_NAME, $COMM_PATH; 
    615615 
    616616  if (!$attrib['id']) 
     
    621621  // allow the following attributes to be added to the <span> tag 
    622622  $attrib_str = create_attrib_string($attrib, array('style', 'class', 'id')); 
    623    
     623 
    624624  if (!$IMAP->get_capability('QUOTA')) 
    625625    $quota_text = rcube_label('unknown'); 
    626   else if (!($quota_text = $IMAP->get_quota())) 
     626  else if ($quota = $IMAP->get_quota()) 
     627    { 
     628    $quota_text = sprintf("%s / %s (%.0f%%)", 
     629                          show_bytes($quota["used"] * 1024), 
     630                          show_bytes($quota["total"] * 1024), 
     631                          $quota["percent"]); 
     632 
     633    // show quota as image (by Brett Patterson) 
     634    if ($attrib['display'] == 'image' && function_exists('imagegif')) 
     635      { 
     636      $quota_text = sprintf('<img src="%s&amp;_action=quotaimg&amp;u=%s&amp;q=%d" alt="%s" width="102" height="15" />', 
     637                            $COMM_PATH, 
     638                            $quota['used'], $quota['total'], 
     639                            $quota_text); 
     640      } 
     641    } 
     642  else 
    627643    $quota_text = rcube_label('unlimited'); 
     644     
    628645 
    629646  $out = '<span' . $attrib_str . '>'; 
Note: See TracChangeset for help on using the changeset viewer.