1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12:
13:
14: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
15:
16: 17: 18: 19: 20: 21:
22: class cSetupConfigMode extends cSetupMask {
23:
24: 25: 26: 27: 28: 29:
30: public function __construct($step, $previous, $next) {
31: $cfg = cRegistry::getConfig();
32:
33: if ($_SESSION["setuptype"] == "setup") {
34: cSetupMask::__construct("templates/setup/forms/configmode.tpl", $step);
35: } else {
36: cSetupMask::__construct("templates/setup/forms/configmodewopass.tpl", $step);
37: }
38: $this->setHeader(i18n("config.php mode", "setup"));
39: $this->_stepTemplateClass->set("s", "TITLE", i18n("config.php mode", "setup"));
40: $this->_stepTemplateClass->set("s", "DESCRIPTION", i18n("Please choose 'save' or 'download'", "setup"));
41: $this->_stepTemplateClass->set("s", "LABEL_DESCRIPTION", i18n("CONTENIDO requires a configuration file called 'config.php'. This file will be generated by the setup automatically if the filesystem permissions are correct. If 'save' is activated by default, setup can save the file config.php. If not, 'download' is activated by default, and you have to place the file in the directory "data/config/{environment}/" manually when a download prompt appears. The download prompt appears at the end of the setup process.", "setup"));
42:
43: $oConfigSave = new cHTMLRadiobutton("configmode", "save");
44: $oConfigSave->setLabelText(" ");
45: $oConfigSave->setStyle('width:auto;border:0;');
46:
47: $oConfigDownload = new cHTMLRadiobutton("configmode", "download");
48: $oConfigDownload->setLabelText(" ");
49: $oConfigDownload->setStyle('width:auto;border:0;');
50:
51: if (canWriteFile($cfg['path']['contenido_config'] . 'config.php')) {
52: $oConfigSave->setChecked(true);
53: } else {
54: $oConfigDownload->setChecked(true);
55: }
56:
57: $oConfigSaveLabel = new cHTMLLabel(i18n("Save", "setup"), $oConfigSave->getID());
58: $this->_stepTemplateClass->set("s", "CONTROL_SAVE", $oConfigSave->render());
59: $this->_stepTemplateClass->set("s", "CONTROL_SAVELABEL", $oConfigSaveLabel->render());
60:
61: $oConfigDownloadLabel = new cHTMLLabel(i18n("Download", "setup"), $oConfigDownload->getID());
62: $this->_stepTemplateClass->set("s", "CONTROL_DOWNLOAD", $oConfigDownload->render());
63: $this->_stepTemplateClass->set("s", "CONTROL_DOWNLOADLABEL", $oConfigDownloadLabel->render());
64:
65: $this->setNavigation($previous, $next);
66: }
67:
68: 69: 70: 71: 72: 73: 74:
75: public function cSetupConfigMode($step, $previous, $next) {
76: cDeprecated('This method is deprecated and is not needed any longer. Please use __construct() as constructor function.');
77: $this->__construct($step, $previous, $next);
78: }
79:
80: 81: 82: 83:
84: protected function _createNavigation() {
85: $link = new cHTMLLink("#");
86:
87: if ($this->_nextstep == "doinstall") {
88:
89: }
90:
91: $link->attachEventDefinition("pageAttach", "onclick", "document.setupform.step.value = '".$this->_nextstep."'; document.setupform.submit();");
92: $link->setClass("nav");
93: $link->setContent("<span>»</span>");
94: $this->_stepTemplateClass->set("s", "NEXT", $link->render());
95:
96: $backlink = new cHTMLLink("#");
97: $backlink->attachEventDefinition("pageAttach", "onclick", "document.setupform.step.value = '".$this->_backstep."';");
98: $backlink->attachEventDefinition("submitAttach", "onclick", "document.setupform.submit();");
99: $backlink->setClass("nav navBack");
100: $backlink->setContent("<span>»</span>");
101: $this->_stepTemplateClass->set("s", "BACK", $backlink->render());
102: }
103:
104: }
105:
106: ?>