1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14:
15:
16: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
17:
18: 19: 20: 21: 22: 23:
24: class cSetupConfigMode extends cSetupMask {
25:
26: 27: 28: 29: 30: 31:
32: function cSetupConfigMode($step, $previous, $next) {
33: global $cfg;
34:
35: if ($_SESSION["setuptype"] == "setup") {
36: cSetupMask::cSetupMask("templates/setup/forms/configmode.tpl", $step);
37: } else {
38: cSetupMask::cSetupMask("templates/setup/forms/configmodewopass.tpl", $step);
39: }
40: $this->setHeader(i18n("config.php mode", "setup"));
41: $this->_oStepTemplate->set("s", "TITLE", i18n("config.php mode", "setup"));
42: $this->_oStepTemplate->set("s", "DESCRIPTION", i18n("Please choose 'save' or 'download'", "setup"));
43: $this->_oStepTemplate->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"));
44:
45: $oConfigSave = new cHTMLRadiobutton("configmode", "save");
46: $oConfigSave->setLabelText(" ");
47: $oConfigSave->setStyle('width:auto;border:0;');
48:
49: $oConfigDownload = new cHTMLRadiobutton("configmode", "download");
50: $oConfigDownload->setLabelText(" ");
51: $oConfigDownload->setStyle('width:auto;border:0;');
52:
53: if (canWriteFile($cfg['path']['contenido_config'] . 'config.php')) {
54: $oConfigSave->setChecked(true);
55: } else {
56: $oConfigDownload->setChecked(true);
57: }
58:
59: $oConfigSaveLabel = new cHTMLLabel(i18n("Save", "setup"), $oConfigSave->getId());
60: $this->_oStepTemplate->set("s", "CONTROL_SAVE", $oConfigSave->render());
61: $this->_oStepTemplate->set("s", "CONTROL_SAVELABEL", $oConfigSaveLabel->render());
62:
63: $oConfigDownloadLabel = new cHTMLLabel(i18n("Download", "setup"), $oConfigDownload->getId());
64: $this->_oStepTemplate->set("s", "CONTROL_DOWNLOAD", $oConfigDownload->render());
65: $this->_oStepTemplate->set("s", "CONTROL_DOWNLOADLABEL", $oConfigDownloadLabel->render());
66:
67: $this->setNavigation($previous, $next);
68: }
69:
70: 71: 72: 73:
74: function _createNavigation() {
75: $link = new cHTMLLink("#");
76:
77: if ($this->_bNextstep == "doinstall") {
78:
79: }
80:
81: $link->attachEventDefinition("pageAttach", "onclick", "document.setupform.step.value = '".$this->_bNextstep."'; document.setupform.submit();");
82: $link->setClass("nav");
83: $link->setContent("<span>»</span>");
84: $this->_oStepTemplate->set("s", "NEXT", $link->render());
85:
86: $backlink = new cHTMLLink("#");
87: $backlink->attachEventDefinition("pageAttach", "onclick", "document.setupform.step.value = '".$this->_bBackstep."';");
88: $backlink->attachEventDefinition("submitAttach", "onclick", "document.setupform.submit();");
89: $backlink->setClass("nav navBack");
90: $backlink->setContent("<span>»</span>");
91: $this->_oStepTemplate->set("s", "BACK", $backlink->render());
92: }
93:
94: }
95:
96: ?>