[horde] How to set quota format

Jan Schneider jan at horde.org
Tue Aug 20 12:26:00 UTC 2013


Zitat von Lukas Engler <engler at rz.uni-frankfurt.de>:

> Zitat von Jan Schneider <jan at horde.org>:
>
>> Zitat von Lukas Engler <engler at rz.uni-frankfurt.de>:
>>
>>> Hi,
>>> I would like to change the quota format from the default short to  
>>> the long format. This is a snippet of my backends.local.php but so  
>>> far nothing changed, it still shows the short format. What am I  
>>> doing wrong?
>>
>> The format name are the *keys*. Read the docs in backends.php again.
>
> I did as you said, but using 'long' as a key followed by a string  
> value like 'Quota status: %.2f [UNIT] / %.2f [UNIT] (%.2f%%)'  
> doesn't change anything. If I use 'sort' as a key it is working more  
> or less.

Of course. Those are different formats for different locations of the  
quota notifications. An occurrence of a quota message will only change  
if you change the related setting in the configuration.

> 'format' => array(
>                  'short' => 'Quota status: %.2f [UNIT] / %.2f [UNIT]  
> (%.2f%%)'),
>
> Unit is not being replaced and it shows only the percentage of the  
> used quota and not the actual used amount of size.

You cannot arbitrarily add new values to those strings. These are just  
sprintf formatting strings, i.e. you can change how the *existing*  
values are displayed.

>>
>>> Using imp 6.1.2
>>>
>>> 'quota' => array(
>>>      'driver' => 'imap',
>>>      'params' => array(
>>>          'hide_when_unlimited' => false,
>>>          'format' => array('long'),
>>>          'unit' => 'GB'
>>>      )
>>>  ),

-- 
Jan Schneider
The Horde Project
http://www.horde.org/



More information about the horde mailing list