diff options
author | Andrew Dolgov <[email protected]> | 2012-12-23 23:05:51 +0400 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2012-12-23 23:05:51 +0400 |
commit | 8dcb2b47628346226b18940b5cde7849f7a24687 (patch) | |
tree | ca3ee70e34095455614f4c2c7f9d69ce9f1ed27c /public.php | |
parent | 5cedb389d24861a94c1183d1562900dbe59ee3fb (diff) |
implement plugin routing masks, add example plugin
Diffstat (limited to 'public.php')
-rw-r--r-- | public.php | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/public.php b/public.php index 59e0ef2e3..4cf7653f9 100644 --- a/public.php +++ b/public.php @@ -40,9 +40,16 @@ $method = $_REQUEST["op"]; - $handler = new Handler_Public($link, $_REQUEST); + global $pluginhost; + $override = $pluginhost->lookup_handler("public", $method); - if ($handler->before($method)) { + if ($override) { + $handler = $override; + } else { + $handler = new Handler_Public($link, $_REQUEST); + } + + if (implements_interface($handler, "IHandler") && $handler->before($method)) { if ($method && method_exists($handler, $method)) { $handler->$method(); } else if (method_exists($handler, 'index')) { |