aboutsummaryrefslogtreecommitdiff
path: root/h-source/Library/Theme.php
diff options
context:
space:
mode:
Diffstat (limited to 'h-source/Library/Theme.php')
-rwxr-xr-xh-source/Library/Theme.php40
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');