From 88ee6ea148b6d44674f9555fffb3e1cb2e5f8d9c Mon Sep 17 00:00:00 2001 From: Shish Date: Mon, 5 Mar 2012 14:21:41 +0000 Subject: [PATCH] get_theme_object is only used once, move it closer to where it's used --- core/extension.class.php | 19 ++++++++++++++++++- core/util.inc.php | 18 ------------------ 2 files changed, 18 insertions(+), 19 deletions(-) diff --git a/core/extension.class.php b/core/extension.class.php index ff436ceb..436e17dc 100644 --- a/core/extension.class.php +++ b/core/extension.class.php @@ -89,7 +89,24 @@ abstract class Extension { /** @private */ public function i_am(Extension $child) { $this->_child = $child; - if(is_null($this->theme)) $this->theme = get_theme_object($child, false); + if(is_null($this->theme)) $this->theme = $this->get_theme_object($child, false); + } + + /** + * Find the theme object for a given extension + */ + private function get_theme_object(Extension $class, $fatal=true) { + $base = get_class($class); + if(class_exists('Custom'.$base.'Theme')) { + $class = 'Custom'.$base.'Theme'; + return new $class(); + } + elseif ($fatal || class_exists($base.'Theme')) { + $class = $base.'Theme'; + return new $class(); + } else { + return false; + } } /** diff --git a/core/util.inc.php b/core/util.inc.php index 6364161b..904b569d 100644 --- a/core/util.inc.php +++ b/core/util.inc.php @@ -344,7 +344,6 @@ function make_http(/*string*/ $link) { /** * Make a form tag with relevant auth token and stuff - * (Added optional Form ID field for helping jquery.) * * @retval string */ @@ -507,23 +506,6 @@ function _count_execs($db, $sql, $inputarray) { $null = null; return $null; } -/** - * Find the theme object for a given extension - */ -function get_theme_object(Extension $class, $fatal=true) { - $base = get_class($class); - if(class_exists('Custom'.$base.'Theme')) { - $class = 'Custom'.$base.'Theme'; - return new $class(); - } - elseif ($fatal || class_exists($base.'Theme')) { - $class = $base.'Theme'; - return new $class(); - } else { - return false; - } -} - /** * Compare two Block objects, used to sort them before being displayed *