diff options
Diffstat (limited to 'h-source/Library/Controller.php')
-rwxr-xr-x | h-source/Library/Controller.php | 29 |
1 files changed, 11 insertions, 18 deletions
diff --git a/h-source/Library/Controller.php b/h-source/Library/Controller.php index bc1c229..b0eef53 100755 --- a/h-source/Library/Controller.php +++ b/h-source/Library/Controller.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 @@ -31,8 +31,6 @@ class Controller { protected $_queryString = array(); //the array of args coming from the url - public $application = null; - public $applicationUrl = null; //the url of the application public $controller; public $action; public $currPage; //the URL of the current page @@ -59,21 +57,17 @@ class Controller { protected $scaffold = null; //the reference to the scaffold object - function __construct($model, $controller, $queryString = array(), $application = null) - { - $this->application = $application; + function __construct($model, $controller, $queryString = array()) { $this->controller = $controller; $this->modelName = $model; $this->_queryString = $queryString; - $this->theme = new Theme($application, $controller); + $this->theme = new Theme($controller); $this->baseUrl = $this->theme->baseUrl; $this->baseUrlSrc = $this->theme->baseUrlSrc; - + $this->headerObj = new HeaderObj(DOMAIN_NAME); $this->request = new Request(); - - $this->applicationUrl = isset($application) ? $application . "/" : null; } //redirect to $path after the time $time @@ -142,8 +136,8 @@ class Controller { { if (class_exists($controller)) { $model = str_replace('Controller',null,$controller).'Model'; - $application = $this->controller; - $this->c[$controller] = new $controller($model,$application,$this->_queryString); + $application = strtolower(str_replace('Controller',null,$controller)); + $this->c[$controller] = new $controller($model,$application,array()); $this->c[$controller]->theme = $this->theme; } } @@ -240,7 +234,7 @@ class Controller { } $this->viewArgs[$this->argKeys[$i]] = $this->_queryString[$i]; } - $this->viewStatus = Url::createUrl($this->viewArgs); + $this->viewStatus = Url::createUrl(array_values($this->viewArgs)); $this->updateHelpers(); //update the theme @@ -288,7 +282,7 @@ class Controller { //create the viewStatus property final public function buildStatus() { - $this->viewStatus = Url::createUrl($this->viewArgs); + $this->viewStatus = Url::createUrl(array_values($this->viewArgs)); //update the theme $this->theme->viewStatus = $this->viewStatus; $this->theme->viewArgs = $this->viewArgs; @@ -301,9 +295,9 @@ class Controller { if (!in_array($type,$typeArray)) { throw new Exception("the type '$type' is not allowed in ".__METHOD__); } - $this->scaffold = new Scaffold($type,$this->application,$this->controller,$this->m[$this->modelName],$this->viewArgs,$params); + $this->scaffold = new Scaffold($type,$this->controller,$this->m[$this->modelName],$this->viewArgs,$params); - $this->helper('Menu',$this->applicationUrl.$this->controller,$this->scaffold->params['panelController']); + $this->helper('Menu',$this->controller,$this->scaffold->params['panelController']); $this->scaffold->mainMenu = $this->h['Menu']; $this->m[$this->modelName]->popupBuild(); @@ -311,8 +305,7 @@ class Controller { if ($type === 'main') { - $here = $this->applicationUrl.$this->controller.'/'.$this->scaffold->params['mainAction']; - + $here = $this->controller.'/'.$this->scaffold->params['mainAction']; $this->helper('Pages',$here,$this->scaffold->params['pageVariable']); $this->helper('List',$this->m[$this->modelName]->identifierName,$here,$this->scaffold->params['pageVariable']); |