}
function catchall($method) {
- global $pluginhost;
+ $plugin = PluginHost::getInstance()->get_plugin($_REQUEST["plugin"]);
- $plugin = $pluginhost->get_plugin($_REQUEST["plugin"]);
-
- if (method_exists($plugin, $method)) {
- $plugin->$method();
+ if ($plugin) {
+ if (method_exists($plugin, $method)) {
+ $plugin->$method();
+ } else {
+ print error_json(13);
+ }
+ } else {
+ print error_json(14);
}
}
}