From 65ac63eb6595bec8f525c5ccd356e8e1a2fd9200 Mon Sep 17 00:00:00 2001 From: Peter Coles Date: Thu, 29 Dec 2011 14:26:00 +0000 Subject: [PATCH] No benefit to exceptional processing for setting theme from config, as the set_theme method isn't fully effective until we know we have theme locations. Could move theme locations earlier in the config file, but that's still no guarantee somebody won't empty the array. Also corrected a few typos for purely pedantic reasons. --- libraries/Template.php | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/libraries/Template.php b/libraries/Template.php index 54105d6..ea89506 100644 --- a/libraries/Template.php +++ b/libraries/Template.php @@ -77,11 +77,6 @@ function initialize($config = array()) { foreach ($config as $key => $val) { - if ($key == 'theme' AND $val != '') - { - $this->set_theme($val); - continue; - } $this->{'_'.$key} = $val; } @@ -252,7 +247,7 @@ public function build($view, $data = array(), $return = FALSE) // Want this file wrapped with a layout file? if ($this->_layout) { - // Added to $this->_data['template'] by refference + // Added to $this->_data['template'] by reference $template['body'] = $this->_body; // Find the main body and 3rd param means parse if its a theme view (only if parser is enabled) @@ -288,7 +283,7 @@ public function title() /** - * Put extra javascipt, css, meta tags, etc before all other head data + * Put extra javascript, css, meta tags, etc before all other head data * * @access public * @param string $line The line being added to head @@ -302,7 +297,7 @@ public function prepend_metadata($line) /** - * Put extra javascipt, css, meta tags, etc after other head data + * Put extra javascript, css, meta tags, etc after other head data * * @access public * @param string $line The line being added to head @@ -695,13 +690,13 @@ private function _find_view($view, array $data, $parse_view = TRUE) } } - // Not found it yet? Just load, its either in the module or root view + // Not found it yet? Just load, it's either in the module or root view return self::_load_view($view, $this->_data + $data, $parse_view); } private function _load_view($view, array $data, $parse_view = TRUE, $override_view_path = NULL) { - // Sevear hackery to load views from custom places AND maintain compatibility with Modular Extensions + // Severe hackery to load views from custom places AND maintain compatibility with Modular Extensions if ($override_view_path !== NULL) { if ($this->_parser_enabled === TRUE AND $parse_view === TRUE)