Minahito
minah****@users*****
2006年 10月 16日 (月) 18:55:57 JST
Index: xoops2jp/html/modules/legacyRender/class/ActionFrame.class.php diff -u xoops2jp/html/modules/legacyRender/class/ActionFrame.class.php:1.1.2.6.2.3 xoops2jp/html/modules/legacyRender/class/ActionFrame.class.php:1.1.2.6.2.4 --- xoops2jp/html/modules/legacyRender/class/ActionFrame.class.php:1.1.2.6.2.3 Tue Oct 10 15:13:12 2006 +++ xoops2jp/html/modules/legacyRender/class/ActionFrame.class.php Mon Oct 16 18:55:57 2006 @@ -19,10 +19,18 @@ var $mActionName = null; var $mAction = null; var $mAdminFlag = null; + + /** + * @var XCube_Delegate + */ + var $mCreateAction = null; function LegacyRender_ActionFrame($admin) { $this->mAdminFlag = $admin; + $this->mCreateAction =& new XCube_Delegate(); + $this->mCreateAction->register('LegacyRender_ActionFrame.createAction'); + $this->mCreateAction->add(array(&$this, '_createAction')); } function setActionName($name) @@ -37,18 +45,18 @@ $root->mContext->mModule->setAttribute('actionName', $name); } - function execute(&$controller) + function _createAction(&$actionFrame) { - if (!preg_match("/^\w+$/", $this->mActionName)) { - die(); + if (is_object($this->mAction)) { + return; } - + // // Create action object by mActionName // - $className = "LegacyRender_" . ucfirst($this->mActionName) . "Action"; - $fileName = ucfirst($this->mActionName) . "Action"; - if ($this->mAdminFlag) { + $className = "LegacyRender_" . ucfirst($actionFrame->mActionName) . "Action"; + $fileName = ucfirst($actionFrame->mActionName) . "Action"; + if ($actionFrame->mAdminFlag) { $fileName = XOOPS_MODULE_PATH . "/legacyRender/admin/actions/${fileName}.class.php"; } else { @@ -62,13 +70,25 @@ require_once $fileName; if (class_exists($className)) { - $this->mAction =& new $className($this->mAdminFlag); + $this->mAction =& new $className($actionFrame->mAdminFlag); } + } - if (!is_object($this->mAction)) { + function execute(&$controller) + { + if (!preg_match("/^\w+$/", $this->mActionName)) { die(); } - + + // + // Create action object by mActionName + // + $this->mCreateAction->call(new XCube_Ref($this)); + + if (!(is_object($this->mAction) && is_a($this->mAction, 'LegacyRender_Action'))) { + die(); //< TODO + } + $handler =& xoops_gethandler('config'); $moduleConfig =& $handler->getConfigsByDirname('legacyRender');