[dev] turba-git hooks

Michael Rubinsky mrubinsk at horde.org
Tue Mar 22 15:15:35 UTC 2011


Quoting Ronan SALMON <rsalmon at mbpgroup.com>:

> Hi all,
>
> I have 3 backends enabled : localsql, localldap, favourites
>
> I'm trying to setup a hook to automatically set pref 'addressbooks'.  
> So far, I've always been able to automatically set backends  
> 'localldap' and 'favourites', but not backend 'localsql'.
>
> Here is my hook :
>
> public function prefs_init($pref, $value, $username)
> {
>     switch ($pref) {
>     case 'addressbooks':
>         return json_encode(array_keys(Turba::availableSources()));
>     }
> }
>
> This returns the 3 backends just fine, but when I login and go to  
> turba's preferences, the 'localsql' backend is never in the selected  
> group.

Probably because localsql is using shares. Try something like:

return  
json_encode(array_keys(Turba:getConfigFromShares((Turba::availableSources()))));


>
> Ronan.
>
> -- 
> Horde developers mailing list
> Frequently Asked Questions: http://horde.org/faq/
> To unsubscribe, mail: dev-unsubscribe at lists.horde.org


mike

The Horde Project (www.horde.org)
mrubinsk at horde.org


More information about the dev mailing list