[phpldapadmin] [ phpldapadmin-Patches-2726394 ] Allow multiple tree_display_formats
"SourceForge.net" <[email protected]>
| Newsgroups | gmane.comp.ldap.davedap |
|---|---|
| Message-ID | <[email protected]> |
Patches item #2726394, was opened at 2009-04-02 08:37
Message generated for change (Comment added) made by nobody
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=498548&aid=2726394&group_id=61828
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Matthijs Kooijman (bigfoot_hunter)
Assigned to: Nobody/Anonymous (nobody)
Summary: Allow multiple tree_display_formats
Initial Comment:
The current code has a tree_display_format, that can be used to customize the display of objects in the tree. This format string allows one to use arbitrary attributes of the object. However, every object will always use the same format string, even when some or all attributes used in it are not defined for a particular object.
As an example: A lot of objects in my directory have a "displayName" attribute. I would like to display that for those objects. However, when I set 'tree_display_format' to '%displayName', any object without a displayName will show up as '<none>', which is pretty useless.
This patch deprecates tree_display_format and introduces a new variable: tree_display_formats. This new variable contains an array of format strings, each of which are tried in turn. The first one that does not use attributes that are not defined for a particular object is used. If there is no such format string, the last one is used.
This allows one to set tree_display_formats to array('%displayName', '%rdn') to use the displayName whenever available, and show the rdn otherwise.
Perhaps it is also worth considering to set the default tree_display_formats value to include %displayName?
The patch is made against 1.1.0.5, but I think it should mostly apply to the SANDPIT branch, though I think there need to be some trivial changes to the config handling.
The patch also updates the documentation in config_default.php. When this patch is accepted, I will also update the wiki.
----------------------------------------------------------------------
Comment By: Nobody/Anonymous (nobody)
Date: 2009-04-03 01:48
Message:
Matthijs, I like the idea of this patch - thank you.
I'll hold it until I get the SANDPIT more stabilized - I am nearly there,
then when it is, I'll let you know so that you can modify this patch to
apply to it. (I dont plan on doing any more work to 1.1.x, so we'll include
this work for the next release of PLA. Anybody who wants it sooner can
apply this themselves :)
We may as well totally remove the old tree_format_display when applying
your patch - PLA 1.2 has a lot of changes, so a new config file will be
needed anyway. (We should just highlight this on the wiki for those who
want to convert their old config files.)
----------------------------------------------------------------------
Comment By: Matthijs Kooijman (bigfoot_hunter)
Date: 2009-04-02 08:38
Message:
I'm also adding the same patch, but generated with --ignore-space-change.
This shows the actual changes more clearly, since a large block of code in
lib/functions.php was only indented and not changed.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=498548&aid=2726394&group_id=61828
------------------------------------------------------------------------------
______________________________________
phpLDAPadmin development mailing list.
To unsbuscribe: https://lists.sourceforge.net/lists/listinfo/phpldapadmin-devel
http://phpldapadmin.sourceforge.net/