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: function cSetupConfigMode($step, $previous, $next)
27: {
28: global $cfg;
29:
30: if ($_SESSION["setuptype"] == "setup") {
31: cSetupMask::cSetupMask("templates/setup/forms/configmode.tpl", $step);
32: } else {
33: cSetupMask::cSetupMask("templates/setup/forms/configmodewopass.tpl", $step);
34: }
35: $this->setHeader(i18n("config.php mode", "setup"));
36: $this->_oStepTemplate->set("s", "TITLE", i18n("config.php mode", "setup"));
37: $this->_oStepTemplate->set("s", "DESCRIPTION", i18n("Please choose 'save' or 'download'", "setup"));
38: $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"));
39:
40: $oConfigSave = new cHTMLRadiobutton("configmode", "save");
41: $oConfigSave->setLabelText(" ");
42: $oConfigSave->setStyle('width:auto;border:0;');
43:
44: $oConfigDownload = new cHTMLRadiobutton("configmode", "download");
45: $oConfigDownload->setLabelText(" ");
46: $oConfigDownload->setStyle('width:auto;border:0;');
47:
48: if (canWriteFile($cfg['path']['contenido_config'] . 'config.php')) {
49: $oConfigSave->setChecked(true);
50: } else {
51: $oConfigDownload->setChecked(true);
52: }
53:
54: $oConfigSaveLabel = new cHTMLLabel(i18n("Save", "setup"), $oConfigSave->getId());
55: $this->_oStepTemplate->set("s", "CONTROL_SAVE", $oConfigSave->render());
56: $this->_oStepTemplate->set("s", "CONTROL_SAVELABEL", $oConfigSaveLabel->render());
57:
58: $oConfigDownloadLabel = new cHTMLLabel(i18n("Download", "setup"), $oConfigDownload->getId());
59: $this->_oStepTemplate->set("s", "CONTROL_DOWNLOAD", $oConfigDownload->render());
60: $this->_oStepTemplate->set("s", "CONTROL_DOWNLOADLABEL", $oConfigDownloadLabel->render());
61:
62: $this->setNavigation($previous, $next);
63: }
64:
65: function _createNavigation()
66: {
67: $link = new cHTMLLink("#");
68:
69: if ($this->_bNextstep == "doinstall") {
70:
71: }
72:
73: $link->attachEventDefinition("pageAttach", "onclick", "document.setupform.step.value = '".$this->_bNextstep."'; document.setupform.submit();");
74: $link->setClass("nav");
75: $link->setContent("<span>»</span>");
76: $this->_oStepTemplate->set("s", "NEXT", $link->render());
77:
78: $backlink = new cHTMLLink("#");
79: $backlink->attachEventDefinition("pageAttach", "onclick", "document.setupform.step.value = '".$this->_bBackstep."';");
80: $backlink->attachEventDefinition("submitAttach", "onclick", "document.setupform.submit();");
81: $backlink->setClass("nav navBack");
82: $backlink->setContent("<span>»</span>");
83: $this->_oStepTemplate->set("s", "BACK", $backlink->render());
84: }
85: }
86:
87: ?>