7 function PlugController($plugin_name)
9 $adminclass = $plugin_name . '_Management';
10 $this->admin = new $adminclass($plugin_name);
13 if (!$this->admin->getActionDir()) {
14 $this->admin->error('Action Directory not found.');
25 function forward($action, $msg = '')
28 $dir = $this->admin->getActionDir();
29 $fprefix = $this->admin->getActionFilePrefix();
30 $cprefix = $this->admin->getActionClassPrefix();
31 $default = $this->admin->getDefaultAction();
33 $action = preg_replace("/[^a-z_]+/", "", $action);
34 $action_file = $dir . $fprefix . $action . ".php";
36 if ($action && is_readable($action_file)) {
37 require_once($action_file);
40 $action_file = $dir . $fprefix . $default . ".php";
41 if (is_readable($action_file)) {
43 require_once($action_file);
48 $this->admin->disallow();
51 $class = $cprefix . $action;
53 if (class_exists($class)) {
56 if (method_exists($obj, "execute")) {
57 $obj->execute(&$this, $msg);
60 $this->admin->error('Method not found.');
64 $this->admin->error('Class not found.');
71 function existsAction($action_name)
73 $class = $this->admin->getActionClassPrefix() . $action_name;
75 if (!class_exists($class)) {
76 $dir = $this->admin->getActionDir();
77 $fprefix = $this->admin->getActionFilePrefix();
78 $action_file = $dir . $fprefix . $action_name . '.php';
79 if (is_readable($action_file)) {
80 require_once($action_file);
84 return (class_exists($class)) ? true : false;