From 8dcb2b47628346226b18940b5cde7849f7a24687 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 23 Dec 2012 23:05:51 +0400 Subject: implement plugin routing masks, add example plugin --- public.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'public.php') 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')) { -- cgit v1.2.3