1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-13 05:25:56 +00:00

implement plugin routing masks, add example plugin

This commit is contained in:
Andrew Dolgov
2012-12-23 23:05:51 +04:00
parent 5cedb389d2
commit 8dcb2b4762
7 changed files with 108 additions and 7 deletions

View File

@@ -118,10 +118,18 @@
$op = str_replace("-", "_", $op);
if (class_exists($op)) {
$handler = new $op($link, $_REQUEST);
global $pluginhost;
$override = $pluginhost->lookup_handler($op, $method);
if ($handler && is_subclass_of($handler, 'Handler')) {
if (class_exists($op) || $override) {
if ($override) {
$handler = $override;
} else {
$handler = new $op($link, $_REQUEST);
}
if ($handler && implements_interface($handler, 'IHandler')) {
if (validate_csrf($csrf_token) || $handler->csrf_ignore($method)) {
if ($handler->before($method)) {
if ($method && method_exists($handler, $method)) {