From 14691cd854be3e9ee272c9619a6368c83d72267b Mon Sep 17 00:00:00 2001 From: Antonio Gallo Date: Sat, 18 Feb 2012 00:07:50 +0000 Subject: upload new EasyGiant library and added added a new filter for the model name (part 2) --- h-source/Library/Controller.php | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'h-source/Library/Controller.php') diff --git a/h-source/Library/Controller.php b/h-source/Library/Controller.php index 5a9ec79..b0eef53 100755 --- a/h-source/Library/Controller.php +++ b/h-source/Library/Controller.php @@ -41,6 +41,9 @@ class Controller { public $argKeys = array(); //the array of keys representing the status args of the view action of the controller (validate function after colon) public $argDefault = array(); //the array containing the default values of the $viewArgs array + + public $argFunc = array(); //the array containing the functions to be applied upon the $viewArgs array + public $viewArgs = array(); //the associative array representing the status args of the main action of the controller. It is the combination of $argKeys and $queryString public $viewStatus = ''; //string containing the additional url string to get the status of the view action of the controller (derived from $this->viewArgs) @@ -220,6 +223,11 @@ class Controller { $this->callInArgKeysFunc(); for ($i = 0; $i < count($this->argKeys); $i++) { + if (isset($_GET[$this->argKeys[$i]]) and strcmp($_GET[$this->argKeys[$i]],'') !== 0) + { + $this->viewArgs[$this->argKeys[$i]] = $this->request->get($this->argKeys[$i],'',$this->argFunc[$i]); + continue; + } if (!isset($this->_queryString[$i])) { $this->viewArgs[$this->argKeys[$i]] = isset($this->argDefault[$i]) ? $this->argDefault[$i] : null; continue; @@ -240,8 +248,14 @@ class Controller { //call the functions defined in $this->argKeys after the colon (ex- 'page:forceInt' => apply the forceInt() function upon the $page arg) final public function callInArgKeysFunc() { for ($i = 0; $i < count($this->argKeys); $i++) { + + $this->argFunc[$i] = 'none'; + if (strstr($this->argKeys[$i],':')) { $temp = explode(':',$this->argKeys[$i]); + + $this->argFunc[$i] = $temp[1]; + //exception if (!in_array($temp[1],explode(',',params::$allowedSanitizeFunc))) { throw new Exception('"'.$temp[1]. '" function not allowed in $this->argKeys'); @@ -293,10 +307,10 @@ class Controller { $here = $this->controller.'/'.$this->scaffold->params['mainAction']; $this->helper('Pages',$here,$this->scaffold->params['pageVariable']); - $this->helper('List',$this->m[$this->modelName]->identifierName); + $this->helper('List',$this->m[$this->modelName]->identifierName,$here,$this->scaffold->params['pageVariable']); - $this->helper('Popup',$here,$popupArray,$this->scaffold->params['popupType'],$this->scaffold->params['pageVariable']); + $this->helper('Popup',$here,$popupArray,$this->scaffold->params['popupType'],$this->scaffold->params['pageVariable'],true); $this->scaffold->pageList = $this->h['Pages']; $this->scaffold->itemList = $this->h['List']; -- cgit v1.2.3