diff -ru /home/alec/trunk/roundcubemail/index.php rc-beta/index.php
|
old
|
new
|
|
| 325 | 325 | if ($_action=='rss') |
| 326 | 326 | include('program/steps/mail/rss.inc'); |
| 327 | 327 | |
| 328 | | if ($_action=='quotadisplay') |
| 329 | | include('program/steps/mail/quotadisplay.inc'); |
| 330 | | |
| 331 | | |
| 332 | 328 | // make sure the message count is refreshed |
| 333 | 329 | $IMAP->messagecount($_SESSION['mbox'], 'ALL', TRUE); |
| 334 | 330 | } |
diff -ru /home/alec/trunk/roundcubemail/program/js/app.js rc-beta/program/js/app.js
|
old
|
new
|
|
| 3237 | 3237 | this.set_page_buttons(); |
| 3238 | 3238 | }; |
| 3239 | 3239 | |
| | 3240 | |
| 3240 | 3241 | // replace content of quota display |
| 3241 | | this.set_quota = function() |
| | 3242 | this.set_quota = function(content) |
| 3242 | 3243 | { |
| 3243 | | if (this.gui_objects.quotadisplay && |
| 3244 | | this.gui_objects.quotadisplay.attributes.getNamedItem('display') && |
| 3245 | | this.gui_objects.quotadisplay.attributes.getNamedItem('id')) |
| 3246 | | this.http_request('quotadisplay', '_display='+ |
| 3247 | | this.gui_objects.quotadisplay.attributes.getNamedItem('display').nodeValue+ |
| 3248 | | '&_id='+this.gui_objects.quotadisplay.attributes.getNamedItem('id').nodeValue, false); |
| 3249 | | }; |
| | 3244 | if (this.gui_objects.quotadisplay && content) |
| | 3245 | this.gui_objects.quotadisplay.innerHTML = content; |
| | 3246 | }; |
| 3250 | 3247 | |
| 3251 | 3248 | |
| 3252 | 3249 | // update the mailboxlist |
diff -ru /home/alec/trunk/roundcubemail/program/steps/mail/check_recent.inc rc-beta/program/steps/mail/check_recent.inc
|
old
|
new
|
|
| 37 | 37 | $OUTPUT->set_env('messagecount', $IMAP->messagecount()); |
| 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 |
| 43 | 43 | $a_headers = array(); |
diff -ru /home/alec/trunk/roundcubemail/program/steps/mail/func.inc rc-beta/program/steps/mail/func.inc
|
old
|
new
|
|
| 15 | 15 | | Author: Thomas Bruederli <roundcube@gmail.com> | |
| 16 | 16 | +-----------------------------------------------------------------------+ |
| 17 | 17 | |
| 18 | | $Id: func.inc 1269 2008-04-07 19:48:32Z alec $ |
| | 18 | $Id: func.inc 1214 2008-03-25 00:52:33Z till $ |
| 19 | 19 | |
| 20 | 20 | */ |
| 21 | 21 | |
| … |
… |
|
| 408 | 408 | if (!$attrib['id']) |
| 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 | |
| 413 | 416 | // allow the following attributes to be added to the <span> tag |
| 414 | 417 | $attrib_str = create_attrib_string($attrib, array('style', 'class', 'id', 'display')); |
| 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; |
| 420 | 423 | } |
| 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) |
| 437 | 450 | if ($display == 'image' && function_exists('imagegif')) |
diff -ru /home/alec/trunk/roundcubemail/program/steps/mail/move_del.inc rc-beta/program/steps/mail/move_del.inc
|
old
|
new
|
|
| 92 | 92 | if ($_action=='moveto' && $target) |
| 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) |
| 98 | 98 | if ($_POST['_from']!='show' && ($jump_back || $nextpage_count > 0)) |
diff -ruN /home/alec/trunk/roundcubemail/program/steps/mail/quotadisplay.inc rc-beta/program/steps/mail/quotadisplay.inc
|
old
|
new
|
|
| 1 | | <?php |
| 2 | | |
| 3 | | /* |
| 4 | | +-----------------------------------------------------------------------+ |
| 5 | | | program/steps/mail/quotadisplay.inc | |
| 6 | | | | |
| 7 | | | This file is part of the RoundCube Webmail client | |
| 8 | | | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland | |
| 9 | | | Licensed under the GNU GPL | |
| 10 | | | | |
| 11 | | | PURPOSE: | |
| 12 | | | Remote call to return the quota image or text | |
| 13 | | | | |
| 14 | | +-----------------------------------------------------------------------+ |
| 15 | | | Author: Robin Elfrink <robin@15augustus.nl> | |
| 16 | | +-----------------------------------------------------------------------+ |
| 17 | | |
| 18 | | $Id: quotadisplay.inc 850 2007-10-03 00:13:32Z ihug $ |
| 19 | | |
| 20 | | */ |
| 21 | | |
| 22 | | $display = isset($_GET['_display']) ? $_GET['_display'] : 'text'; |
| 23 | | $id = isset($_GET['_id']) ? $_GET['_id'] : 'rcmquotadisplay'; |
| 24 | | $quota = rcmail_quota_content($display); |
| 25 | | $OUTPUT->remote_response(sprintf("this.gui_objects.%s.innerHTML = '%s';\n", $id, $quota)); |
| 26 | | |
| 27 | | exit; |
| 28 | | ?> |