From 3417bc8115f976636f54b649e986c840ce11beda Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Wed, 18 Nov 2009 09:24:15 +0000 Subject: [PATCH] "fixed empty settings in infolog, reported on user-list" --- preferences/inc/class.bosettings.inc.php | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/preferences/inc/class.bosettings.inc.php b/preferences/inc/class.bosettings.inc.php index a32d028b25..2b1804644d 100644 --- a/preferences/inc/class.bosettings.inc.php +++ b/preferences/inc/class.bosettings.inc.php @@ -72,11 +72,21 @@ $GLOBALS['egw']->translation->add_app('preferences'); // we need the prefs translations too } - if(!$GLOBALS['egw']->hooks->single('settings',$this->appname)) + // calling the settings hook + $settings = $GLOBALS['egw']->hooks->single('settings',$this->appname); + // it either returns the settings or save it in $GLOBALS['settings'] (deprecated!) + if (isset($settings) && is_array($settings) && $settings) { - return False; + $this->settings = array_merge($this->settings,$settings); + } + elseif(isset($GLOBALS['settings']) && is_array($GLOBALS['settings']) && $GLOBALS['settings']) + { + $this->settings = array_merge($this->settings,$GLOBALS['settings']); + } + else + { + return False; // no settings returned } - $this->settings = array_merge($this->settings,$GLOBALS['settings']); /* Remove ui-only settings */ if($this->xmlrpc)