diff options
Diffstat (limited to 'h-source/Library/Theme.php')
-rwxr-xr-x | h-source/Library/Theme.php | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/h-source/Library/Theme.php b/h-source/Library/Theme.php index 45cace4..a001631 100755 --- a/h-source/Library/Theme.php +++ b/h-source/Library/Theme.php @@ -75,19 +75,22 @@ class Theme { public function render() { extract($this->_data); + //find the View subfolder where to look for view files + $subfolder = isset(Params::$viewSubfolder) ? Params::$viewSubfolder . DS : null; + foreach ($this->_viewFiles as $file) { - if (file_exists(ROOT . DS . APPLICATION_PATH . DS . 'Views' . DS . ucwords($this->controller) . DS . $file . '.php')) { - include (ROOT . DS . APPLICATION_PATH . DS . 'Views' . DS . ucwords($this->controller) . DS . $file . '.php'); + if (file_exists(ROOT . DS . APPLICATION_PATH . DS . 'Views' . DS .$subfolder. ucwords($this->controller) . DS . $file . '.php')) { + include (ROOT . DS . APPLICATION_PATH . DS . 'Views' . DS .$subfolder. ucwords($this->controller) . DS . $file . '.php'); } else { - include (ROOT . DS . APPLICATION_PATH . DS . 'Views' . DS . $file . '.php'); + include (ROOT . DS . APPLICATION_PATH . DS . 'Views' . DS .$subfolder. $file . '.php'); } } if (isset($this->_lastView)) { - if (file_exists(ROOT . DS . APPLICATION_PATH . DS . 'Views' . DS . ucwords($this->controller) . DS . $this->_lastView . '.php')) { - include (ROOT . DS . APPLICATION_PATH . DS . 'Views' . DS . ucwords($this->controller) . DS . $this->_lastView . '.php'); + if (file_exists(ROOT . DS . APPLICATION_PATH . DS . 'Views' . DS .$subfolder. ucwords($this->controller) . DS . $this->_lastView . '.php')) { + include (ROOT . DS . APPLICATION_PATH . DS . 'Views' . DS .$subfolder. ucwords($this->controller) . DS . $this->_lastView . '.php'); } else { - include (ROOT . DS . APPLICATION_PATH . DS . 'Views' . DS . $this->_lastView . '.php'); + include (ROOT . DS . APPLICATION_PATH . DS . 'Views' . DS .$subfolder. $this->_lastView . '.php'); } } |