[horde] help writing a hook reading another pref
Jan Schneider
jan at horde.org
Mon Mar 23 10:11:11 UTC 2009
Zitat von LALOT Dominique <dom.lalot at gmail.com>:
> Hello,
>
> I would like to write a hook which is reading another prefs and I don't know
> how to write it:
>
> if (!function_exists('_prefs_hook_show_sidebar')) {
> function _prefs_hook_show_sidebar($name = null)
> {
> #$app = $GLOBALS['prefs']->getValue('initial_application');
> Horde::logMessage("tracedom showsidebar app=$app", __FILE__, __LINE__,
> PEAR_LOG_NOTICE);
> if (strcmp ('dimp',$app)==0)
> return false;
> else
> return true;
> }
> }
>
> It fails saying that I call getValue on a non object. I imagine that I try
> to call before the prefs object is built.
> How can I do that?
Try $this->getValue().
Jan.
--
Do you need professional PHP or Horde consulting?
http://horde.org/consulting/
More information about the horde
mailing list