Minahito
minah****@users*****
2006年 7月 27日 (木) 14:58:51 JST
Index: xoops2jp/html/modules/base/admin/actions/ModuleInstallAction.class.php diff -u xoops2jp/html/modules/base/admin/actions/ModuleInstallAction.class.php:1.1.2.9 xoops2jp/html/modules/base/admin/actions/ModuleInstallAction.class.php:1.1.2.10 --- xoops2jp/html/modules/base/admin/actions/ModuleInstallAction.class.php:1.1.2.9 Fri Jun 23 10:28:29 2006 +++ xoops2jp/html/modules/base/admin/actions/ModuleInstallAction.class.php Thu Jul 27 14:58:51 2006 @@ -1,6 +1,6 @@ <?php /** - * @version $Id: ModuleInstallAction.class.php,v 1.1.2.9 2006/06/23 01:28:29 minahito Exp $ + * @version $Id: ModuleInstallAction.class.php,v 1.1.2.10 2006/07/27 05:58:51 minahito Exp $ */ if (!defined('XOOPS_ROOT_PATH')) exit(); @@ -17,6 +17,27 @@ var $mLicence; var $mLicenceText; + /** + * @var XCube_NewDelegate + */ + var $mInstallSuccess = null; + + /** + * @var XCube_NewDelegate + */ + var $mInstallFail = null; + + function Legacy_ModuleInstallAction($flag) + { + parent::Legacy_AbstractModuleInstallAction($flag); + + $this->mInstallSuccess =& new XCube_NewDelegate(); + $this->mInstallSuccess->register('Legacy_ModuleInstallAction.InstallSuccess'); + + $this->mInstallFail =& new XCube_NewDelegate(); + $this->mInstallFail->register('Legacy_ModuleInstallAction.InstallFail'); + } + function &_getInstaller($dirname) { $installer =& new Legacy_ModuleInstaller($dirname); @@ -38,6 +59,9 @@ $file = $this->mModuleObject->modinfo['installer']['licence']['file']; $language = $root->mController->getConfig('language'); + // + // TODO Replace with language manager. + // $path = XOOPS_MODULE_PATH . "/" . $this->mModuleObject->getVar('dirname') ."/language/" . $language . "/" . $file; if (!file_exists($path)) { $path = XOOPS_MODULE_PATH . "/" . $this->mModuleObject->getVar('dirname') . "/language/english/" . $file; @@ -51,8 +75,14 @@ function executeViewSuccess(&$controller,&$xoopsUser,&$renderer) { - $root =& XCube_Root::getSingleton(); - $root->mEventManager->raiseEvent("Module.Legacy.ModuleInstall.Success", $this, $this->mModuleObject); + if (!$this->mLog->hasError()) { + $this->mInstallSuccess->call(new XCube_Ref($this->mModuleObject)); + XCube_DelegateUtils::call('Legacy.Admin.Event.ModuleInstall.' . ucfirst($this->mModuleObject->get('dirname') . '.Success'), new XCube_Ref($this->mModuleObject)); + } + else { + $this->mInstallFail->call(new XCube_Ref($this->mModuleObject)); + XCube_DelegateUtils::call('Legacy.Admin.Event.ModuleInstall.' . ucfirst($this->mModuleObject->get('dirname') . '.Fail'), new XCube_Ref($this->mModuleObject)); + } $renderer->setTemplateName("module_install_success.html"); $renderer->setAttribute('module', $this->mLog->mModuleObject); @@ -81,6 +111,11 @@ $renderer->setAttribute('module', $this->mModuleObject); $renderer->setAttribute('actionForm', $this->mActionForm); } + + function executeViewCancel(&$controller, &$xoopsUser, &$renderer) + { + $controller->executeForward("./index.php?action=InstallList"); + } } ?> \ No newline at end of file