22 public function __construct()
24 $root = XCube_Root::getSingleton();
25 $this->act = $root->mContext->mRequest->getRequest(
'action');
26 if (
'' == $this->act) {
29 if (!preg_match(
"/^\w+$/", $this->act)) {
30 exit(
'bad action name');
34 public function execute($controller)
36 $className = $this->act.
'Action';
37 $fileName = _MY_MODULE_PATH.
'actions/'.$className.
'.class.php';
38 if (!is_file($fileName)) {
39 exit(
'file not found');
43 $Action =
new $className($controller);
46 if ($Action->getisError()) {
47 $controller->executeRedirect($Action->getUrl(), 2, $Action->geterrMsg());
49 $Action->executeView($controller->mRoot->mContext->mModule->getRenderTarget());