[dev] Request for comment : new hook to format how various attributes are diaplyed in Turba

Etienne Goyer etienne.goyer at linuxquebec.com
Wed May 19 08:30:12 PDT 2004


Hi,

Here is another problem I have to solve for a client, and hopefully I 
can submit a patch and have it integrated in Horde.

In turba/browse.php, I would like to display fax number as mailto link 
to our fax gateway.  For example :

     <a href="mailto:14185551212 at fax.mydomain.com">1 (418) 555-1212</a>

or make a link to compose.php with appropriate argument.

I have notice the _turba_hook_encode_* and _turba_hook_encode_* hooks, 
which are somewhat related to what I am trying to achieve.  However, 
these hooks are used Turba_AbstractObject::setValue and getValue, and I 
do not think presentation logic really have their place there.

Instead, my idea right now is to build a _turba_hook_display_* hook, 
which function would be to return HTML snippet for the presentation os a 
specific attribute.  From what I can see, the only place where I would 
need to plug this hook is in turba/templates/browse/contactrow.inc.  The 
patch would be quite trivial.  I guess, beside my formating of fax 
number, it could also be used to format URL appropriately ('website' and 
'freebusyUrl' attribute), extract and format a 'photo' or 'jpegPhoto' 
attribute from an LDAP directory, etc.

Would there be any interest in such a hook ?  If not, would there be a 
better way to approach the problem instead ?

Thanks !
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 252 bytes
Desc: OpenPGP digital signature
Url : http://lists.horde.org/archives/dev/attachments/20040519/1ce2ad2b/signature.bin


More information about the dev mailing list