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

Chuck Hagenbuch chuck at horde.org
Wed May 19 14:00:46 PDT 2004


Quoting Etienne Goyer <etienne.goyer at linuxquebec.com>:

> 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.

Agreed.

> 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.

I'd much rather see this done with custom form types and renderers for those
types, which Turba ought to be using anyway for proper display of things like
pictures.

-chuck

--
"Regard my poor demoralized mule!" - Juan Valdez


More information about the dev mailing list