diff options
author | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-05-18 01:35:52 +0000 |
---|---|---|
committer | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-05-18 01:35:52 +0000 |
commit | 3468b554c90457e0033564ccd209359a4a37abd3 (patch) | |
tree | c1391344c020af895bee8b121a2a022fbfdeac04 /engine | |
parent | f0dee4c85a3599f0711efd33377faa3d59298267 (diff) | |
download | elgg-3468b554c90457e0033564ccd209359a4a37abd3.tar.gz elgg-3468b554c90457e0033564ccd209359a4a37abd3.tar.bz2 |
Fixes #3132 added 'route', $handler plugin hook
git-svn-id: http://code.elgg.org/elgg/trunk@9098 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine')
-rw-r--r-- | engine/lib/pagehandler.php | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/engine/lib/pagehandler.php b/engine/lib/pagehandler.php index e598d6821..31d73b18c 100644 --- a/engine/lib/pagehandler.php +++ b/engine/lib/pagehandler.php @@ -27,6 +27,20 @@ function page_handler($handler, $page) { array_pop($page); } + // return false to stop processing the request (because you handled it) + // return a new $params array if you want to route the request differently + $params = array( + 'handler' => $handler, + 'segments' => $page, + ); + $params = elgg_trigger_plugin_hook('route', $handler, NULL, $params); + if ($params === false) { + return true; + } + + $handler = $params['handler']; + $page = $params['segments']; + if (!isset($CONFIG->pagehandler) || empty($handler)) { $result = false; } else if (isset($CONFIG->pagehandler[$handler]) && is_callable($CONFIG->pagehandler[$handler])) { |