diff --git a/e107_handlers/theme_handler.php b/e107_handlers/theme_handler.php index 189c6be7e..63248a994 100644 --- a/e107_handlers/theme_handler.php +++ b/e107_handlers/theme_handler.php @@ -10,9 +10,9 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_handlers/theme_handler.php,v $ -| $Revision: 1.43 $ -| $Date: 2009-08-16 16:30:56 $ -| $Author: secretr $ +| $Revision: 1.44 $ +| $Date: 2009-08-17 11:25:01 $ +| $Author: e107coders $ +----------------------------------------------------------------------------+ */ @@ -25,6 +25,7 @@ class themeHandler{ var $id; var $frm; var $fl; + var $themeConfigObj = null; /* constructor */ @@ -513,10 +514,21 @@ class themeHandler{ { $confile = e_THEME.$this->id."/".$this->id."_config.php"; - if(is_readable($confile) && !function_exists($this->id."_config")) + if(($this->themeConfigObj === null) && is_readable($confile)) { + include($confile); + $className = 'theme_'.$this->id; + if(class_exists($className)) + { + $this->themeConfigObj = new $className(); + } + else + { + $this->themeConfigObj = FALSE; + } } + } @@ -525,10 +537,11 @@ class themeHandler{ { global $frm; - if(function_exists($this->id."_config")) + $this -> loadThemeConfig(); + + if($this->themeConfigObj) { - $text = ""; - $var = call_user_func($this->id."_config"); + $var = call_user_method("config",$this->themeConfigObj); foreach($var as $val) { $text .= "