[dev] Hide empty app prefs in menu

Michael M Slusarz slusarz at horde.org
Fri Aug 29 19:18:22 UTC 2014


Quoting Ralf Lang <lang at b1-systems.de>:

> On 28.08.2014 19:07, Michael M Slusarz wrote:
>> Quoting Ralf Lang <lang at b1-systems.de>:
>>
>>> On 28.08.2014 17:43, Michael M Slusarz wrote:
>>>> Quoting Ralf Lang <lang at b1-systems.de>:
>>>>
>>>>> On 28.08.2014 14:00, Lukas Weiss wrote:
>>>>>> hi,
>>>>>>
>>>>>> in the user preferences menu there are listed all installed apps.
>>>>>> is it possible to hide those which do not have any configured prefs?
>>>>>>
>>>>>> i get this notification for the passwd app und my own module:
>>>>>> "There are no preferences available for this application."
>>>>>>
>>>>>> thank you!
>>>>>>
>>>>> Not currently, afaik. Please create an enhancement ticket in
>>>>> http://bugs.horde.org
>>>>
>>>> This most likely won't be implemented.  It would require us to parse
>>>> every preference from every active application on every page (and this
>>>> data can't be cached).  That's a recipe for terrible performance.
>>>>
>>>> michael
>>>
>>> If this is the case, then yes it's not worth it. I just don't see why we
>>> cannot add an attribute in registry or something similar or why an app
>>> not having settings can't be cached - This won't change on the fly.
>>
>> It can change on the fly.  That's exactly the issue.
>
> How? Can you give an example? An App either has prefs or it has none and
> if they are not managed by prefs.php, are they prefs in the "prefs menu"
> context?

An app can have prefs that are currently hidden based on the current  
view preference (Basic vs. Advanced) or by the current state of the  
system (via 'suppress' option).  So determining the canonical listing  
of viewable prefs can only be accomplished by reading the preferences  
files from disk and interpreting them.

Most apps have at least one preference.  We should not redesign our  
system to support lightly-used apps at the expense of our heavily-used  
core apps which all contain preferences and do not need extra overhead  
everytime we are listing apps w/preferences.

If you can determine that an app has no preferences without checking  
for something like file existence, maybe this would be ok to add.  But  
then again, you are still going to have the situation where a user  
navigates to an app and no preferences can be listed based on the  
current session state.  I would rather be consistent in the way we  
display no currently displayable apps, and the other sane way of doing  
that performance-wise is to only calculate the list of currently  
displayable apps when on that app's preference page.

michael

___________________________________
Michael Slusarz [slusarz at horde.org]



More information about the dev mailing list