[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 19:37
Message generated for change (Comment added) made by wurley
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: Closed
>Resolution: Accepted
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: Deon George (wurley)
Date: 2009-06-18 23:09

Message:
I've just committed your patch to the SANDPIT branch. It will be available
in the next WIP drop and the next release of PLA.

Great idea, thank you.

lib/config_default.php 1.19.2.51
lib/functions.php 1.296.2.91

----------------------------------------------------------------------

Comment By: Nobody/Anonymous (nobody)
Date: 2009-04-03 12: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 19: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

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
______________________________________
phpLDAPadmin development mailing list.
To unsbuscribe: https://lists.sourceforge.net/lists/listinfo/phpldapadmin-devel
http://phpldapadmin.sourceforge.net/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.