[imp] New hook for search_sources reg.

Marco falon at csi.it
Wed Nov 4 13:02:08 UTC 2009


ANANT S ATHAVALE <asa <at> isac.gov.in> writes:

> 
> ----- Message from jan <at> horde.org ---------
>      Date: Wed, 30 Sep 2009 11:05:51 +0200
>      From: Jan Schneider <jan <at> horde.org>
>   Subject: Re: [imp] New hook for search_sources reg.
>        To: imp <at> lists.horde.org
> 
> > Zitat von ANANT S ATHAVALE <asa <at> isac.gov.in>:
> >
> >> Dear List Members,
> >>
> >> Yesterday, I applied the Horde Groupware WebMail Edition  
> >> 1.2.3-1.2.4 patches.
> >>
> >> Following are some of the settings in  prefs.php in IMP.
> >>
> >> $_prefs['search_sources'] = array(
> >>    'value' => "localsql\tlocalldap\tfavourites",
> >>    'locked' => true,
> >>    'shared' => true,
> >>    'hook' => true,
> >>    'type' => 'implicit');


Form me the search_sources hook doesn't work if locked. It autoexpand only
localsql and not localldap.

Instead, If I don't lock the preference, the hook works. Into mysql db it sets
the search_sources value rightly and autoexpand works for localsql and localldap
too.

If you like I wrote this hook also for search_field:

// Example hook to set the value of the search_fields pref. Useful when using
// a turba source with shares enabled (i.e. the example localsql
// configuration)

 if (!function_exists('_prefs_hook_search_fields')) {
     function _prefs_hook_search_fields($username = null)
     {
         if (!$username) {
             return;
         }

         if ($GLOBALS['registry']->hasMethod('contacts/sources')) {
            $sources = $GLOBALS['registry']->call('contacts/sources');
            return implode("\tname\temail\tlastname\n",
array_keys($sources))."\tname\temail\tlastname";
         }
     }
 }

Also in this case, the hook works only if I don't lock the preference.

It really seems that these hooks work only if the preference can be written into
db (not locked).

Regards
m.



More information about the imp mailing list