summaryrefslogtreecommitdiff
path: root/roundcubemail/program/steps/mail/func.inc
diff options
context:
space:
mode:
authoralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2008-09-12 16:48:23 +0000
committeralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2008-09-12 16:48:23 +0000
commitd2857fa5443a904a49075a9d5df3cd50c20e4ad2 (patch)
tree64749cf1050c15ac3836c1d11e06df52443bb3e5 /roundcubemail/program/steps/mail/func.inc
parent8aafb85c8c07c67dd1ba3cfb7002456e12a522a0 (diff)
- Fixed quota img height/width setting from template (#1484857)
git-svn-id: https://svn.roundcube.net/trunk@1776 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/steps/mail/func.inc')
-rw-r--r--roundcubemail/program/steps/mail/func.inc19
1 files changed, 14 insertions, 5 deletions
diff --git a/roundcubemail/program/steps/mail/func.inc b/roundcubemail/program/steps/mail/func.inc
index 6a885a07c..6d23b6f8e 100644
--- a/roundcubemail/program/steps/mail/func.inc
+++ b/roundcubemail/program/steps/mail/func.inc
@@ -446,7 +446,7 @@ function rcmail_quota_display($attrib)
$attrib_str = create_attrib_string($attrib, array('style', 'class', 'id', 'display'));
$out = '<span' . $attrib_str . '>';
- $out .= rcmail_quota_content();
+ $out .= rcmail_quota_content(NULL, $attrib);
$out .= '</span>';
return $out;
}
@@ -455,7 +455,7 @@ function rcmail_quota_display($attrib)
/**
*
*/
-function rcmail_quota_content($quota=NULL)
+function rcmail_quota_content($quota=NULL, $attrib=NULL)
{
global $IMAP, $COMM_PATH, $RCMAIL;
@@ -481,14 +481,23 @@ function rcmail_quota_content($quota=NULL)
// show quota as image (by Brett Patterson)
if ($display == 'image' && function_exists('imagegif'))
{
- $attrib = array('width' => 100, 'height' => 14);
+ if (!$attrib['width'])
+ $attrib['width'] = isset($_SESSION['quota_width']) ? $_SESSION['quota_width'] : 100;
+ else
+ $_SESSION['quota_width'] = $attrib['width'];
+
+ if (!$attrib['height'])
+ $attrib['height'] = isset($_SESSION['quota_height']) ? $_SESSION['quota_height'] : 14;
+ else
+ $_SESSION['quota_height'] = $attrib['height'];
+
$quota_text = sprintf('<img src="./bin/quotaimg.php?u=%s&amp;q=%d&amp;w=%d&amp;h=%d" width="%d" height="%d" alt="%s" title="%s / %s" />',
$quota['used'], $quota['total'],
$attrib['width'], $attrib['height'],
$attrib['width'], $attrib['height'],
$quota_text,
- show_bytes($quota["used"] * 1024),
- show_bytes($quota["total"] * 1024));
+ show_bytes($quota['used'] * 1024),
+ show_bytes($quota['total'] * 1024));
}
}
else