[turba] select box instead of textfield

Jan Schneider jan@horde.org
Thu, 23 May 2002 22:08:36 +0200


Zitat von Jean-Michel Besnard <besnard@tekkno.net>:

> Hi,
> 
> would like to add a source to my turba.
> I want an address book but would like to have select boxes for some
> attributes instead of text fields.
> For example for category so I could choose between 'business', 'private',
> 'whatever'.
> This would consist of generating a select box with predefined values or
> with a selection of existing attributes already availible in the source
> store 
> (like a SELECT DISTINCT Category FROM address_book).
> 
> Do I have to hack the code to get what I want working or is there a trick
> or patch ?

That's currently not possible but should be easy to hack. Add a new type in
attributes.php like:

$attributes['category'] = array(
    'type' => 'enmo',
    'desc' => _("Category"),
    'enum' => array('foo', 'bar')
);

You only have to edit templates/edit/edit.inc to build a select widget if an
attribute has the type 'enum'.

Jan.

--
http://www.horde.org - The Horde Project
http://www.ammma.de - discover your knowledge
http://www.tip4all.de - Deine private Tippgemeinschaft