From: Michael M Slusarz Date: Thu, 4 Nov 2010 21:49:53 +0000 (-0600) Subject: prefsInit() needs to be run earlier because it defines the prefs to update X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=d8529abedf914303e34633b73fc226fcd5953599;p=horde.git prefsInit() needs to be run earlier because it defines the prefs to update --- diff --git a/framework/Core/lib/Horde/Core/Prefs/Ui.php b/framework/Core/lib/Horde/Core/Prefs/Ui.php index 42f48ad65..1a1fab01b 100644 --- a/framework/Core/lib/Horde/Core/Prefs/Ui.php +++ b/framework/Core/lib/Horde/Core/Prefs/Ui.php @@ -97,6 +97,8 @@ class Horde_Core_Prefs_Ui */ public function __construct($vars) { + global $registry; + $this->app = isset($vars->app) ? $vars->app : $this->getDefaultApp(); @@ -105,10 +107,10 @@ class Horde_Core_Prefs_Ui /* Load the application's base environment. */ try { - $GLOBALS['registry']->pushApp($this->app); + $registry->pushApp($this->app); } catch (Horde_Exception $e) { if ($e->getCode() == Horde_Registry::AUTH_FAILURE) { - $GLOBALS['registry']->authenticateFailure($this->app, $e); + $registry->authenticateFailure($this->app, $e); } throw $e; } @@ -118,9 +120,14 @@ class Horde_Core_Prefs_Ui /* Populate enums. */ if ($this->group && - $GLOBALS['registry']->hasAppMethod($this->app, 'prefsEnum') && + $registry->hasAppMethod($this->app, 'prefsEnum') && $this->groupIsEditable($this->group)) { - $GLOBALS['registry']->callAppMethod($this->app, 'prefsEnum', array('args' => array($this))); + $registry->callAppMethod($this->app, 'prefsEnum', array('args' => array($this))); + } + + /* Run app-specific init code. */ + if ($registry->hasAppMethod($this->app, 'prefsInit')) { + $registry->callAppMethod($this->app, 'prefsInit', array('args' => array($this))); } } @@ -354,11 +361,6 @@ class Horde_Core_Prefs_Ui $columns = $pref_list = array(); $identities = false; - /* Run app-specific init code. */ - if ($registry->hasAppMethod($this->app, 'prefsInit')) { - $registry->callAppMethod($this->app, 'prefsInit', array('args' => array($this))); - } - $prefgroups = $this->_getPrefGroups(); if ($this->group) {