diff options
author | Yuchen Pei <me@ypei.me> | 2021-07-29 14:17:20 +1000 |
---|---|---|
committer | Yuchen Pei <me@ypei.me> | 2021-07-29 14:17:20 +1000 |
commit | 3ff03dc4f0a72432b34c00da620272cf011e4ddd (patch) | |
tree | 5746711ba17a91aed56c6529ea8cceb06c3ad16a /h-source/Library/Theme.php | |
parent | cd4534aa10ba3b122963992741721289fa50d0ab (diff) |
Publishing h-node.org code.
- this is the h-node.org code, except
- removed a js file (3x copies at three different locations) without license / copyright headers
- /Js/linkToForm.js
- /Public/Js/linkToForm.js
- /admin/Public/Js/linkToForm.js
- removed config files containing credentials
- /Application/Include/params.php
- /Config/Config.php
- /admin/Application/Include/params.php
- /admin/Config/Config.php
- added license and copyright header to one php file
- /admin/Library/ErrorReporting.php (almost identical to /Library/ErrorReporting.php which has the headers)
Diffstat (limited to 'h-source/Library/Theme.php')
-rwxr-xr-x | h-source/Library/Theme.php | 40 |
1 files changed, 10 insertions, 30 deletions
diff --git a/h-source/Library/Theme.php b/h-source/Library/Theme.php index 1ddec92..10c0fce 100755 --- a/h-source/Library/Theme.php +++ b/h-source/Library/Theme.php @@ -2,7 +2,7 @@ // EasyGiant is a PHP framework for creating and managing dynamic content // -// Copyright (C) 2009 - 2014 Antonio Gallo (info@laboratoriolibero.com) +// Copyright (C) 2009 - 2011 Antonio Gallo // See COPYRIGHT.txt and LICENSE.txt. // // This file is part of EasyGiant @@ -34,20 +34,15 @@ class Theme { public $viewArgs = array(); public $viewStatus = ''; public $controller = 'controller'; - public $application = null; public $action = ''; public $currPage; //the URL of the current page - function __construct($application, $controller) { - - $this->controller = $controller; - $this->application = $application; - - $langUrl = isset(Params::$lang) ? "/".Params::$lang : null; + function __construct($controller) { + $protocol = Params::$useHttps ? "https" : "http"; - - $this->baseUrl = MOD_REWRITE_MODULE === true ? "$protocol://" . DOMAIN_NAME . $langUrl : "$protocol://" . DOMAIN_NAME . '/index.php' . $langUrl; - + + $this->controller = $controller; + $this->baseUrl = MOD_REWRITE_MODULE === true ? "$protocol://" . DOMAIN_NAME : "$protocol://" . DOMAIN_NAME . '/index.php'; $this->baseUrlSrc = "$protocol://" . DOMAIN_NAME; } @@ -79,22 +74,15 @@ 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 (isset($this->application) and file_exists(ROOT . DS . APPLICATION_PATH . DS . "Apps" . DS . ucfirst($this->application). DS . 'Views' . DS .$subfolder. ucwords($this->controller) . DS . $file . '.php')) - { - include (ROOT . DS . APPLICATION_PATH . DS . "Apps" . DS . ucfirst($this->application). DS . 'Views' . DS . $subfolder. ucwords($this->controller) . DS . $file . '.php'); - } - else if (isset($this->application) and file_exists(ROOT . DS . APPLICATION_PATH . DS . "Apps" . DS . ucfirst($this->application). DS . 'Views' . DS . $subfolder. $file . '.php')) - { - include (ROOT . DS . APPLICATION_PATH . DS . "Apps" . DS . ucfirst($this->application). DS . 'Views' . DS .$subfolder. $file . '.php'); - } - else if (file_exists(ROOT . DS . APPLICATION_PATH . DS . 'Views' . DS .$subfolder. 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 .$subfolder. $file . '.php'); @@ -102,15 +90,7 @@ class Theme { } if (isset($this->_lastView)) { - if (isset($this->application) and file_exists(ROOT . DS . APPLICATION_PATH . DS . "Apps" . DS . ucfirst($this->application). DS . 'Views' . DS .$subfolder. ucwords($this->controller) . DS . $this->_lastView . '.php')) - { - include (ROOT . DS . APPLICATION_PATH . DS . "Apps" . DS . ucfirst($this->application). DS . 'Views' . DS .$subfolder. ucwords($this->controller) . DS . $this->_lastView . '.php'); - } - else if (isset($this->application) and file_exists(ROOT . DS . APPLICATION_PATH . DS . "Apps" . DS . ucfirst($this->application). DS . 'Views' . DS . $subfolder . $this->_lastView . '.php')) - { - include (ROOT . DS . APPLICATION_PATH . DS . "Apps" . DS . ucfirst($this->application). DS . 'Views' . DS .$subfolder . $this->_lastView . '.php'); - } - else if (file_exists(ROOT . DS . APPLICATION_PATH . DS . 'Views' . DS .$subfolder. 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 .$subfolder. $this->_lastView . '.php'); |