[horde] Pass a "enum" from hooks -> prefs.php

Otto Stolz Otto.Stolz at uni-konstanz.de
Fri Feb 1 16:14:35 UTC 2008


Hello Andreas,

Jan Schneider has written:
> This preference expects a newline-separated list of addresses. You  
> could use any preference type that returns this, especially types that  
> return a single string only. Enum is one of these types.

So, you could try:

// user preferred 'tie to' addresses
$_prefs['tieto_addr'] = array(
      'value'  => '',
      'locked' => false,
      'shared' => false,
      'hook'   => false,
      'type'   => 'enum',
      'enum'   => "test1 at kwsoft.com\ntest2 at kwsoft.com"
      'desc' => _("Addresses to explicitly tie to this identity:
<em>(optional, enter each address on a new line)</em>"));

And if this works allright, you would replace
"test1 at kwsoft.com\ntest2 at kwsoft.com"
with a call to your own function that yields
a newline-separated string.

However, IIRC pref.php is only called once per session,
so the user will have to log out and in again, to see
changes in your user database being reflected in the
preferences form.

Best wishes,
   Otto Stolz






More information about the horde mailing list