[kronolith] hook display_cals

Dominique LALOT dom.lalot at gmail.com
Wed Dec 10 16:49:09 UTC 2008


|In the wiki I red that imformation, but using it, I got an error on ->exists which is not found

http://wiki.horde.org/CustomizingPreferences

Is there something missing in that sample? and by the way, is this still the right way to write that hook?

Thanks

Dom


if (!function_exists('_prefs_hook_display_cals')) {
    function _prefs_hook_display_cals($uid = null)
    {
        require_once 'Horde/Share.php';

        if (is_null($uid)) {
            $uid = Auth::getAuth();
        }

        $kronolith_shares = &Horde_Share::singleton('kronolith');
        *if (!**$kronolith_shares->exists($uid**)) {*
            require_once 'Horde/Identity.php';
            $identity = &Identity::singleton();
            $name = $identity->getValue('fullname');
            if (trim($name) == '') {
                $name = Auth::removeHook($uid);
            }
            $share = $kronolith_shares->newShare($uid);
            $share->set('name', sprintf(_("%s's Calendar"), $name));
            $kronolith_shares->addShare($share);
        }

        return 'a:2:{i:0;s:' . strlen($uid) . ':"' . $uid . '";i:1;s:32:"ac2bc478568fa773d9a7530b1a71398b";}';
    }
}
|

-- 
Dominique LALOT
Ingenieur Systeme et Reseaux
Universite de la Mediterrane (Aix-Marseille 2)
http://annuaire.univmed.fr/showuser.php?uid=lalot



More information about the kronolith mailing list