diff options
author | Andrew Dolgov <[email protected]> | 2012-12-23 23:36:07 +0400 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2012-12-23 23:36:07 +0400 |
commit | 6cbe53c9f5e9c369977b737f897a621f00fba90b (patch) | |
tree | 604f3d1c38be8fe6e056b084da61a8df11080522 /classes/pluginhost.php | |
parent | 8dcb2b47628346226b18940b5cde7849f7a24687 (diff) |
add instances plugin
Diffstat (limited to 'classes/pluginhost.php')
-rw-r--r-- | classes/pluginhost.php | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/classes/pluginhost.php b/classes/pluginhost.php index b28d2511d..46415bd21 100644 --- a/classes/pluginhost.php +++ b/classes/pluginhost.php @@ -9,6 +9,7 @@ class PluginHost { const HOOK_ARTICLE_FILTER = 2; const HOOK_PREFS_TAB = 3; const HOOK_PREFS_SECTION = 4; + const HOOK_PREFS_TABS = 5; function __construct($link) { $this->link = $link; @@ -77,7 +78,7 @@ class PluginHost { } function add_handler($handler, $method, $sender) { - $handler = strtolower($handler); + $handler = str_replace("-", "_", strtolower($handler)); $method = strtolower($method); if (!is_array($this->handlers[$handler])) { @@ -88,18 +89,22 @@ class PluginHost { } function del_handler($handler, $method) { - $handler = strtolower($handler); + $handler = str_replace("-", "_", strtolower($handler)); $method = strtolower($method); unset($this->handlers[$handler][$method]); } function lookup_handler($handler, $method) { - $handler = strtolower($handler); + $handler = str_replace("-", "_", strtolower($handler)); $method = strtolower($method); if (is_array($this->handlers[$handler])) { - return $this->handlers[$handler][$method]; + if (isset($this->handlers[$handler]["*"])) { + return $this->handlers[$handler]["*"]; + } else { + return $this->handlers[$handler][$method]; + } } return false; |