Minahito
minah****@users*****
2006年 2月 4日 (土) 01:06:50 JST
Index: xoops2jp/html/modules/base/admin/actions/InstallWizardAction.class.php diff -u /dev/null xoops2jp/html/modules/base/admin/actions/InstallWizardAction.class.php:1.1.2.1 --- /dev/null Sat Feb 4 01:06:50 2006 +++ xoops2jp/html/modules/base/admin/actions/InstallWizardAction.class.php Sat Feb 4 01:06:50 2006 @@ -0,0 +1,81 @@ +<?php +/** + * @version $Id: InstallWizardAction.class.php,v 1.1.2.1 2006/02/03 16:06:50 minahito Exp $ + */ + +require_once XOOPS_BASE_PATH."/admin/actions/AbstractModuleInstallAction.class.php"; +require_once XOOPS_BASE_PATH."/admin/class/ModuleInstaller.class.php"; +require_once XOOPS_BASE_PATH."/admin/forms/InstallWizardForm.class.php"; + +/** + * Install module + */ +class Legacy_InstallWizardAction extends Legacy_AbstractModuleInstallAction +{ + var $mLicence; + var $mLicenceText; + + function &_getInstaller($dirname) + { + $installer =& new Legacy_ModuleInstaller($dirname); + return $installer; + } + + function _setupActionForm() + { + $this->mActionForm =& new Legacy_InstallWizardForm(); + $this->mActionForm->prepare(); + } + + function _loadAgreement() + { + $root =& XCube_Root::getSingleton(); + + $this->mLicence = $this->mModuleObject->modinfo['installer']['licence']['title']; + + $file = $this->mModuleObject->modinfo['installer']['licence']['file']; + $language = $root->mController->getConfig('language'); + + $path = XOOPS_MODULE_PATH . "/" . $this->mModuleObject->getVar('dirname') ."/language/" . $language . "/" . $file; + if (!file_exists($path)) { + $path = XOOPS_MODULE_PATH . "/" . $this->mModuleObject->getVar('dirname') . "pm/language/english/" . $file; + if (!file_exists($path)) { + return; + } + } + + $this->mLicenceText = file_get_contents($path); + } + + function executeViewSuccess(&$controller,&$xoopsUser,&$renderer) + { + $renderer->setTemplateName("module_install_success.html"); + $renderer->setAttribute('log', $this->mLog->mMessages); + } + + function executeViewIndex(&$controller,&$xoopsUser,&$renderer) + { + $renderer->setAttribute('module', $this->mModuleObject); + $renderer->setAttribute('actionForm', $this->mActionForm); + + if (isset($this->mModuleObject->modinfo['installer'])) { + $renderer->setAttribute('image', $this->mModuleObject->modinfo['installer']['image']); + $renderer->setAttribute('description', $this->mModuleObject->modinfo['installer']['description']); + $renderer->setTemplateName("install_wizard.html"); + } + else { + $controller->executeForward("index.php?action=ModuleInstall&dirname=" . $this->mModuleObject->get('dirname')); + } + } + + function executeViewInput(&$controller, &$xoopsUser, &$renderer) + { + $renderer->setTemplateName("install_wizard_licence.html"); + $renderer->setAttribute('module', $this->mModuleObject); + $renderer->setAttribute('actionForm', $this->mActionForm); + $renderer->setAttribute('licence', $this->mLicence); + $renderer->setAttribute('licenceText', $this->mLicenceText); + } +} + +?> \ No newline at end of file