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

MailingListe lst_hoe01 at kwsoft.de
Fri Feb 1 13:43:37 UTC 2008


i try to pass a "enum" value from a hook to prefs.php to pre-populate
the enum field used in prefs.php with some values obtained from  
database. Unfortunately it does not work at all. I have set a static  
array to test but obviously i have missed something

in hooks.php :
  if (!function_exists('_prefs_hook_tieto_addr')) {
      function _prefs_hook_tieto_addr($user = null)
          global $conf;
          $result = array(0 => 'test1 at kwsoft.com',
                          1 => 'test2 at kwsoft.com');

          return ($result);

in prefs.php (IMP)

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

With this i always get
Feb  1 14:36:29 v554 httpd2-prefork: PHP Notice:  Undefined index:   
enum in /srv/www/horde/templates/prefs/enum.inc on line 3
Feb  1 14:36:29 v554 httpd2-prefork: PHP Warning:  Invalid argument  
supplied for foreach() in /srv/www/horde/templates/prefs/enum.inc on  
line 3

and no list zu choose from.

Many thanks for any help.



More information about the horde mailing list