{
if (is_null($app)) {
$app = $this->getApp();
+ $pushed = false;
+ } else {
+ $pushed = $this->pushApp($app);
}
/* If there is no logged in user, return an empty Horde_Prefs::
$GLOBALS['prefs']->retrieve($app);
}
}
+
+ if ($pushed) {
+ $this->popApp();
+ }
}
/**
*/
public function getPreference($app, $pref)
{
- $pushed = $GLOBALS['registry']->pushApp($app);
$GLOBALS['registry']->loadPrefs($app);
- $value = $GLOBALS['prefs']->getValue($pref);
- if ($pushed) {
- $GLOBALS['registry']->popApp();
- }
-
- return $value;
+ return $GLOBALS['prefs']->getValue($pref);
}
/**
*/
public function setPreference($app, $pref, $value)
{
- $pushed = $GLOBALS['registry']->pushApp($app);
$GLOBALS['registry']->loadPrefs($app);
- $value = $GLOBALS['prefs']->setValue($pref, $value);
- if ($pushed) {
- $GLOBALS['registry']->popApp();
- }
+ return $GLOBALS['prefs']->setValue($pref, $value);
}
/**