2012-12-23 10:52:18 +00:00
|
|
|
<?php
|
|
|
|
class PluginHandler extends Handler_Protected {
|
|
|
|
function csrf_ignore($method) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
function catchall($method) {
|
2013-04-18 08:27:34 +00:00
|
|
|
$plugin = PluginHost::getInstance()->get_plugin($_REQUEST["plugin"]);
|
2012-12-23 10:52:18 +00:00
|
|
|
|
2013-03-16 08:26:14 +00:00
|
|
|
if ($plugin) {
|
|
|
|
if (method_exists($plugin, $method)) {
|
|
|
|
$plugin->$method();
|
|
|
|
} else {
|
|
|
|
print json_encode(array("error" => "METHOD_NOT_FOUND"));
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
print json_encode(array("error" => "PLUGIN_NOT_FOUND"));
|
2012-12-23 10:52:18 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|