diff options
author | Andrew Dolgov <[email protected]> | 2021-02-17 09:59:14 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2021-02-17 09:59:14 +0300 |
commit | 273ada7353b185e20452d54a8206d5e0cef9e573 (patch) | |
tree | 42ab1d011537fc2e5cc63c4d45883ce2a79be995 /public.php | |
parent | 7adcada324dc6960cf4a120b1397c1bd60521d9b (diff) |
* implement shortcut syntax for exposed plugin methods
* move shared article rendering code to share plugin
Diffstat (limited to 'public.php')
-rw-r--r-- | public.php | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/public.php b/public.php index 59b5a499c..fadb2f14d 100644 --- a/public.php +++ b/public.php @@ -17,6 +17,17 @@ $method = (string)clean($_REQUEST["op"]); + // shortcut syntax for public (exposed) methods (?op=plugin--pmethod&...params) + if (strpos($method, PluginHost::PUBLIC_METHOD_DELIMITER) !== false) { + list ($plugin, $pmethod) = explode(PluginHost::PUBLIC_METHOD_DELIMITER, $method, 2); + + // TODO: better implementation that won't modify $_REQUEST + $_REQUEST["plugin"] = $plugin; + $_REQUEST["pmethod"] = $pmethod; + + $method = "pluginhandler"; + } + $override = PluginHost::getInstance()->lookup_handler("public", $method); if ($override) { |