Changeset 7415c02 in github for program/steps/mail/func.inc
- Timestamp:
- Oct 24, 2009 3:09:23 PM (4 years ago)
- Branches:
- master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
- Children:
- 06e0757
- Parents:
- 1d7e4d3
- File:
-
- 1 edited
-
program/steps/mail/func.inc (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
program/steps/mail/func.inc
rb6673c4e r7415c02 518 518 519 519 $OUTPUT->add_gui_object('quotadisplay', $attrib['id']); 520 521 return html::span($attrib, rcmail_quota_content(NULL, $attrib)); 520 521 $quota = rcmail_quota_content(NULL, $attrib); 522 523 if (is_array($quota)) { 524 $OUTPUT->add_script('$(document).ready(function(){ 525 rcmail.set_quota('.json_serialize($quota).')});', 'foot'); 526 $quota = ''; 527 } 528 529 return html::span($attrib, $quota); 522 530 } 523 531 … … 529 537 $display = isset($_SESSION['quota_display']) ? $_SESSION['quota_display'] : ''; 530 538 531 if (is_array($quota) && !empty($quota['used']) && !empty($quota['total'])) 532 { 533 if (!isset($quota['percent'])) 534 $quota['percent'] = $quota['used'] / $quota['total']; 535 } 536 elseif (!$IMAP->get_capability('QUOTA')) 537 return rcube_label('unknown'); 538 else 539 $quota = $IMAP->get_quota(); 539 if (empty($quota)) { 540 if (!$IMAP->get_capability('QUOTA')) 541 return rcube_label('unknown'); 542 else 543 $quota = $IMAP->get_quota(); 544 } 540 545 541 546 if ($quota && !($quota['total']==0 && $RCMAIL->config->get('quota_zero_as_unlimited'))) 542 547 { 543 $quota_text = sprintf('%s / %s (%.0f%%)', 544 show_bytes($quota['used'] * 1024), 545 show_bytes($quota['total'] * 1024), 546 $quota['percent']); 547 548 // show quota as image (by Brett Patterson) 549 if ($display == 'image' && function_exists('imagegif')) 550 { 551 if (!$attrib['width']) 552 $attrib['width'] = isset($_SESSION['quota_width']) ? $_SESSION['quota_width'] : 100; 553 else 554 $_SESSION['quota_width'] = $attrib['width']; 555 556 if (!$attrib['height']) 557 $attrib['height'] = isset($_SESSION['quota_height']) ? $_SESSION['quota_height'] : 14; 558 else 559 $_SESSION['quota_height'] = $attrib['height']; 560 561 $quota_text = sprintf('<img src="./bin/quotaimg.php?u=%s&q=%d&w=%d&h=%d" width="%d" height="%d" alt="%s" title="%s / %s" />', 562 $quota['used'], $quota['total'], 563 $attrib['width'], $attrib['height'], 564 $attrib['width'], $attrib['height'], 565 $quota_text, 566 show_bytes($quota['used'] * 1024), 567 show_bytes($quota['total'] * 1024)); 548 $quota_result = sprintf('%s / %s (%.0f%%)', 549 show_bytes($quota['used'] * 1024), show_bytes($quota['total'] * 1024), 550 $quota['percent']); 551 552 if ($display == 'image') { 553 $quota_result = array( 554 'percent' => $quota['percent'], 555 'title' => $quota_result, 556 ); 557 if ($attrib['width']) 558 $quota_result['width'] = $attrib['width']; 559 if ($attrib['height']) 560 $quota_result['height'] = $attrib['height']; 568 561 } 569 562 } 570 563 else 571 $quota_text =rcube_label('unlimited');572 573 return $quota_ text;564 return rcube_label('unlimited'); 565 566 return $quota_result; 574 567 } 575 568
Note: See TracChangeset
for help on using the changeset viewer.
