[horde] turba: default column prefs for personal address book

Guenter Bartsch guenter.bartsch at gmail.com
Thu Mar 27 21:55:37 UTC 2014


>> Please read the docs in horde/config/prefs.php and
>> horde/config/hook.php.dist.
>
> those don't seem to mention the "search_source" pref we're looking for:
>

nevermind - got it working after some searching on the mailing list.

for the record: kronolith got it's own, separate prefs and hooks. in
order to trigger a prefs_init hook on search_sources, I
modified/created two files in horde/kronolith/config:

$ cat hooks.local.php
<?php
class Kronolith_Hooks
{
    public function prefs_init($pref, $value, $username, $scope_ob)
    {

        $logger = $GLOBALS['injector']->getInstance('Horde_Log_Logger');
        $logger->info('KRONOLITH prefs_init, pref=' . $pref);
        $logger->info('KRONOLITH prefs_init, username=' . $username);
        $logger->info('KRONOLITH prefs_init, scope_ob=' . $scope_ob);
        #$e = new Exception;
        #$logger->info('prefs_init, stack: ' . $e->getTraceAsString());

        switch ($pref) {
            case 'search_sources':
                if (is_null($username)) {
                    return $value;
                }
                return json_encode(array('lXmryQO4pxuU08q7euTq7w1',
'_nUddCdxIp9wQr7YKJs6Ag1'));
        }
    }
}

$ cat prefs.local.php
<?php
$_prefs['search_sources']['hook'] = true;


More information about the horde mailing list