1: <?php
2: 3: 4: 5: 6: 7: 8: 9:
10:
11: if (!defined('XOOPS_ROOT_PATH')) exit();
12:
13: require_once XOOPS_LEGACY_PATH."/admin/actions/AbstractModuleInstallAction.class.php";
14: require_once XOOPS_LEGACY_PATH."/admin/class/ModuleInstaller.class.php";
15: require_once XOOPS_LEGACY_PATH."/admin/forms/InstallWizardForm.class.php";
16:
17: 18: 19: 20: 21:
22: class Legacy_InstallWizardAction extends Legacy_AbstractModuleInstallAction
23: {
24: var $mLicence;
25: var $mLicenceText;
26:
27: function &_getInstaller($dirname)
28: {
29: $installer =new Legacy_ModuleInstaller($dirname);
30: return $installer;
31: }
32:
33: function _setupActionForm()
34: {
35: $this->mActionForm =new Legacy_InstallWizardForm();
36: $this->mActionForm->prepare();
37: }
38:
39: function _loadAgreement()
40: {
41: $root =& XCube_Root::getSingleton();
42:
43: $this->mLicence = $this->mModuleObject->modinfo['installer']['licence']['title'];
44:
45: $file = $this->mModuleObject->modinfo['installer']['licence']['file'];
46: $language = $root->mContext->getXoopsConfig('language');
47:
48:
49:
50:
51: $path = XOOPS_MODULE_PATH . "/" . $this->mModuleObject->get('dirname') ."/language/" . $language . "/" . $file;
52: if (!file_exists($path)) {
53: $path = XOOPS_MODULE_PATH . "/" . $this->mModuleObject->get('dirname') . "/language/english/" . $file;
54: if (!file_exists($path)) {
55: return;
56: }
57: }
58:
59: $this->mLicenceText = file_get_contents($path);
60: }
61:
62: function executeViewSuccess(&$controller, &$xoopsUser, &$render)
63: {
64: $render->setTemplateName("module_install_success.html");
65: $render->setAttribute('log', $this->mLog->mMessages);
66: }
67:
68: function executeViewIndex(&$controller, &$xoopsUser, &$render)
69: {
70: $render->setAttribute('module', $this->mModuleObject);
71: $render->setAttribute('actionForm', $this->mActionForm);
72:
73: if (isset($this->mModuleObject->modinfo['installer'])) {
74: $render->setAttribute('image', $this->mModuleObject->modinfo['installer']['image']);
75: $render->setAttribute('description', $this->mModuleObject->modinfo['installer']['description']);
76: $render->setTemplateName("install_wizard.html");
77: }
78: else {
79: $controller->executeForward("index.php?action=ModuleInstall&dirname=" . $this->mModuleObject->get('dirname'));
80: }
81: }
82:
83: function executeViewInput(&$controller, &$xoopsUser, &$render)
84: {
85: $render->setTemplateName("install_wizard_licence.html");
86: $render->setAttribute('module', $this->mModuleObject);
87: $render->setAttribute('actionForm', $this->mActionForm);
88: $render->setAttribute('licence', $this->mLicence);
89: $render->setAttribute('licenceText', $this->mLicenceText);
90: }
91: }
92:
93: ?>
94: