From d30d70afd95653bb356603612db6519d6e6ebead Mon Sep 17 00:00:00 2001 From: Antonio Gallo Date: Sat, 3 Dec 2011 12:30:25 +0000 Subject: improved i18n --- h-source/Library/Theme.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'h-source/Library/Theme.php') 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'); } } -- cgit v1.2.3