Hi,
Attached, is the patch for displaying quotas for IMAP users.
Regards, Aury
RCS file: /cvsroot/roundcubemail/roundcubemail/program/include/main.inc,v retrieving revision 1.37 diff -r1.37 main.inc 962a963
'quotadisplay' => 'rcmail_quota_display',
RCS file: /cvsroot/roundcubemail/roundcubemail/program/include/rcube_imap.inc,v retrieving revision 1.26 diff -r1.26 rcube_imap.inc 1058a1059,1066
// added by Nuny /*
- Get quota
*/ function get_quota() { $result = iil_C_GetQuota($this->conn); return sprintf("%.2fMB / %.2fMB (%.0f%%)", $result["used"] / 1000.0, $result["total"] / 1000.0, $result["percent"]); }
RCS file: /cvsroot/roundcubemail/roundcubemail/program/js/app.js,v retrieving revision 1.31 diff -r1.31 app.js 2647a2648,2654
// replace content of quota display this.set_quota = function(text) { if (this.gui_objects.quotadisplay) this.gui_objects.quotadisplay.innerHTML = text; };
RCS file: /cvsroot/roundcubemail/roundcubemail/program/steps/mail/check_recent.inc,v retrieving revision 1.2 diff -r1.2 check_recent.inc 33c33,34
$commands .= sprintf("this.set_quota('%s');\n", $IMAP->get_quota());
47c48 < ?> \ No newline at end of file
?>
RCS file: /cvsroot/roundcubemail/roundcubemail/program/steps/mail/func.inc,v retrieving revision 1.25 diff -r1.25 func.inc 546a547,565
function rcmail_quota_display($attrib) { global $IMAP, $OUTPUT, $JS_OBJECT_NAME;
if (!$attrib['id']) $attrib['id'] = 'rcmquotadisplay';
$OUTPUT->add_script(sprintf("%s.gui_object('quotadisplay', '%s');", $JS_OBJECT_NAME, $attrib['id']));
// allow the following attributes to be added to the <span> tag $attrib_str = create_attrib_string($attrib, array('style', 'class', 'id'));
$out = '<span' . $attrib_str . '>'; $out .= $IMAP->get_quota(); $out .= '</span>'; return $out; }
1407c1426 < ?> \ No newline at end of file
?>
RCS file: /cvsroot/roundcubemail/roundcubemail/program/steps/mail/move_del.inc,v retrieving revision 1.5 diff -r1.5 move_del.inc 76c76
$commands .= sprintf("this.set_quota('%s');\n", $IMAP->get_quota());
90c90 < ?> \ No newline at end of file
?>
RCS file: /cvsroot/roundcubemail/roundcubemail/skins/default/mail.css,v retrieving revision 1.14 diff -r1.14 mail.css 751c751,755
#rcmquotadisplay { color: #999999; font-size: 11px; }
RCS file: /cvsroot/roundcubemail/roundcubemail/skins/default/templates/mail.html,v retrieving revision 1.9 diff -r1.9 mail.html 53c53,54
<roundcube:button command="select-none" label="none" classAct="active" /> Quota: <roundcube:object name="quotaDisplay" />
Sure. I think that now it's correct.
Kind regards, Aury
Robin Elfrink wrote:
Aury Fink Filho wrote:
Attached, is the patch for displaying quotas for IMAP users.
Can you re-create the diff with some context, e.g. 'diff -ur' ?
Thanks, Robin
RCS file: /cvsroot/roundcubemail/roundcubemail/program/include/main.inc,v retrieving revision 1.37 diff -u -r1.37 main.inc --- program/include/main.inc 20 Jan 2006 00:01:53 -0000 1.37 +++ program/include/main.inc 2 Feb 2006 15:09:33 -0000 @@ -960,6 +960,7 @@ 'message' => 'rcmail_message_container', 'messages' => 'rcmail_message_list', 'messagecountdisplay' => 'rcmail_messagecount_display',
RCS file: /cvsroot/roundcubemail/roundcubemail/program/include/rcube_imap.inc,v retrieving revision 1.26 diff -u -r1.26 rcube_imap.inc --- program/include/rcube_imap.inc 25 Jan 2006 22:56:52 -0000 1.26 +++ program/include/rcube_imap.inc 2 Feb 2006 15:09:34 -0000 @@ -1056,6 +1056,14 @@ return $sa_unsubscribed; }
// added by Nuny
/*
*/
function get_quota() {
$result = iil_C_GetQuota($this->conn);
return sprintf("%.2fMB / %.2fMB (%.0f%%)", $result["used"] / 1000.0, $result["total"] / 1000.0, $result["percent"]);
}
// subscribe to a specific mailbox(es) function subscribe($mbox, $mode='subscribe')
RCS file: /cvsroot/roundcubemail/roundcubemail/program/js/app.js,v retrieving revision 1.31 diff -u -r1.31 app.js --- program/js/app.js 31 Jan 2006 03:06:13 -0000 1.31 +++ program/js/app.js 2 Feb 2006 15:09:36 -0000 @@ -2645,6 +2645,13 @@ this.set_page_buttons(); };
// replace content of quota display
this.set_quota = function(text)
{
if (this.gui_objects.quotadisplay)
this.gui_objects.quotadisplay.innerHTML = text;
};
// update the mailboxlist this.set_unread_count = function(mbox, count, set_title)
RCS file: /cvsroot/roundcubemail/roundcubemail/program/steps/mail/check_recent.inc,v retrieving revision 1.2 diff -u -r1.2 check_recent.inc --- program/steps/mail/check_recent.inc 25 Jan 2006 22:56:52 -0000 1.2 +++ program/steps/mail/check_recent.inc 2 Feb 2006 15:09:37 -0000 @@ -30,7 +30,8 @@ $commands = sprintf("this.set_unread_count('%s', %d, true);\n", addslashes($mbox), $unread_count); $commands .= sprintf("this.set_env('messagecount', %d);\n", $count); $commands .= sprintf("this.set_rowcount('%s');\n", rcmail_get_messagecount_text());
@@ -44,4 +45,4 @@
rcube_remote_response($commands); -?> \ No newline at end of file +?> Index: program/steps/mail/func.inc =================================================================== RCS file: /cvsroot/roundcubemail/roundcubemail/program/steps/mail/func.inc,v retrieving revision 1.25 diff -u -r1.25 func.inc --- program/steps/mail/func.inc 25 Jan 2006 22:56:52 -0000 1.25 +++ program/steps/mail/func.inc 2 Feb 2006 15:09:38 -0000 @@ -544,6 +544,25 @@ return $out; }
+function rcmail_quota_display($attrib) {
+}
function rcmail_get_messagecount_text() @@ -1404,4 +1423,4 @@ }
-?> \ No newline at end of file +?> Index: program/steps/mail/move_del.inc =================================================================== RCS file: /cvsroot/roundcubemail/roundcubemail/program/steps/mail/move_del.inc,v retrieving revision 1.5 diff -u -r1.5 move_del.inc --- program/steps/mail/move_del.inc 18 Nov 2005 15:32:20 -0000 1.5 +++ program/steps/mail/move_del.inc 2 Feb 2006 15:09:38 -0000 @@ -73,7 +73,7 @@ if ($_action=='moveto') $commands .= sprintf("this.set_unread_count('%s', %d);\n", $_GET['_target_mbox'], $IMAP->messagecount($_GET['_target_mbox'], 'UNSEEN'));
+$commands .= sprintf("this.set_quota('%s');\n", $IMAP->get_quota()); // add new rows from next page (if any) if ($_GET['_from']!='show' && $pages>1 && $IMAP->list_page < $pages) { @@ -87,4 +87,4 @@ rcube_remote_response($commands);
exit; -?> \ No newline at end of file +?> Index: skins/default/mail.css =================================================================== RCS file: /cvsroot/roundcubemail/roundcubemail/skins/default/mail.css,v retrieving revision 1.14 diff -u -r1.14 mail.css --- skins/default/mail.css 13 Jan 2006 17:16:51 -0000 1.14 +++ skins/default/mail.css 2 Feb 2006 15:09:38 -0000 @@ -748,4 +748,8 @@ { margin-top: 8px; }
+#rcmquotadisplay +{
+} Index: skins/default/templates/mail.html =================================================================== RCS file: /cvsroot/roundcubemail/roundcubemail/skins/default/templates/mail.html,v retrieving revision 1.9 diff -u -r1.9 mail.html --- skins/default/templates/mail.html 25 Jan 2006 22:56:53 -0000 1.9 +++ skins/default/templates/mail.html 2 Feb 2006 15:09:38 -0000 @@ -50,7 +50,8 @@ <roundcube:label name="select" />: <roundcube:button command="select-all" label="all" classAct="active" /> <roundcube:button command="select-all" prop="unread" label="unread" classAct="active" /> -<roundcube:button command="select-none" label="none" classAct="active" /> +<roundcube:button command="select-none" label="none" classAct="active" /> +Quota: <roundcube:object name="quotaDisplay" />
</div>
</body>