aboutsummaryrefslogtreecommitdiff
path: root/h-source/Library/Call.php
diff options
context:
space:
mode:
authorAntonio Gallo <tonicucoz@gmail.com>2011-07-28 20:27:23 +0000
committerAntonio Gallo <tonicucoz@gmail.com>2011-07-28 20:27:23 +0000
commite7b3717614621f14695ab6ca6dda6dd17ba3d65c (patch)
treec8e6061aef3ff7bad5a17e1aecaf441d35e282cb /h-source/Library/Call.php
parent0de74c6879d263645770de3d6b3ce7123f5241d6 (diff)
added new easygiant library
Diffstat (limited to 'h-source/Library/Call.php')
-rwxr-xr-xh-source/Library/Call.php24
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()