diff options
Diffstat (limited to 'h-source/Library/Call.php')
-rwxr-xr-x | h-source/Library/Call.php | 24 |
1 files changed, 20 insertions, 4 deletions
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() |