From e7b3717614621f14695ab6ca6dda6dd17ba3d65c Mon Sep 17 00:00:00 2001 From: Antonio Gallo Date: Thu, 28 Jul 2011 20:27:23 +0000 Subject: added new easygiant library --- h-source/Library/Call.php | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'h-source/Library/Call.php') diff --git a/h-source/Library/Call.php b/h-source/Library/Call.php index 092e59b..f941907 100755 --- a/h-source/Library/Call.php +++ b/h-source/Library/Call.php @@ -62,6 +62,8 @@ function checkRegisterGlobals() function callHook() { + $currentUrl = null; + if (MOD_REWRITE_MODULE === true) { $url = isset($_GET['url']) ? $_GET['url'] : DEFAULT_CONTROLLER . '/' . DEFAULT_ACTION; @@ -74,7 +76,9 @@ function callHook() // rewrite the URL if (Route::$rewrite === 'yes') { - $url = rewrite($url); + $res = rewrite($url); + $url = $res[0]; + $currentUrl = $res[1]; } // echo $url; @@ -178,7 +182,12 @@ function callHook() //pass the action to the controller object $dispatch->action = $action; + $dispatch->currPage = $dispatch->baseUrl.'/'.$dispatch->controller.'/'.$dispatch->action; + if (isset($currentUrl)) + { + $dispatch->currPage = $dispatch->baseUrl.'/'.$currentUrl; + } //require the file containing the set of actions to carry out after the initialization of the controller class Hooks::load(ROOT . DS . APPLICATION_PATH . DS . 'Hooks' . DS . 'AfterInitialization.php'); @@ -190,7 +199,11 @@ function callHook() //pass the action to the theme object $dispatch->theme->action = $action; $dispatch->theme->currPage = $dispatch->baseUrl.'/'.$dispatch->controller.'/'.$dispatch->action; - + if (isset($currentUrl)) + { + $dispatch->theme->currPage = $dispatch->baseUrl.'/'.$currentUrl; + } + call_user_func_array(array($dispatch,$action),$queryString); } else @@ -221,10 +234,13 @@ function rewrite($url) $key = str_replace('/','\/',$key); if (preg_match('/^'.$key.'/',$url)) { - return preg_replace('/^'.$key.'/',$address,$url); + $nurl = preg_replace('/^'.$key.'/',$address,$url); + return array($nurl,$key); +// return preg_replace('/^'.$key.'/',$address,$url); } } - return $url; +// return $url; + return array($url,null); } function getQueryString() -- cgit v1.2.3