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 cSetupMask
23: {
24: 25: 26:
27: protected $_tpl = null;
28:
29: 30: 31:
32: protected $_stepTemplateClass = null;
33:
34: 35: 36:
37: protected $_stepTemplate = '';
38:
39: 40: 41:
42: protected $_step = 0;
43:
44: 45: 46:
47: protected $_navigationEnabled = false;
48:
49: 50: 51:
52: protected $_backstep;
53:
54: 55: 56:
57: protected $_nextstep;
58:
59: 60: 61:
62: protected ;
63:
64: 65: 66: 67: 68:
69: public function __construct($stepTemplate, $step = false) {
70: $this->_tpl = new cTemplate();
71: $this->_stepTemplateClass = new cTemplate();
72:
73: $this->_stepTemplate = $stepTemplate;
74: $this->_step = $step;
75: }
76:
77: 78: 79: 80: 81: 82:
83: public function cSetupMask($stepTemplate, $step = false) {
84: cDeprecated('This method is deprecated and is not needed any longer. Please use __construct() as constructor function.');
85: $this->__construct($stepTemplate, $step);
86: }
87:
88: 89: 90: 91:
92: public function setNavigation($backstep, $nextstep) {
93: $this->_navigationEnabled = true;
94: $this->_backstep = $backstep;
95: $this->_nextstep = $nextstep;
96: }
97:
98: 99: 100:
101: public function ($header) {
102: if (isset($_SESSION['setuptype'])) {
103: $setupType = $_SESSION['setuptype'];
104: } else {
105: $setupType = '';
106: }
107:
108: switch ($setupType) {
109: case "setup":
110: $this->_sHeader = 'Setup - ' . $header;
111: break;
112: case "upgrade":
113: $this->_sHeader = 'Upgrade - ' . $header;
114: break;
115: default:
116: $this->_sHeader = $header;
117: break;
118: }
119: }
120:
121: protected function _createNavigation() {
122: $link = new cHTMLLink("#");
123:
124: $link->attachEventDefinition("pageAttach", "onclick", "document.setupform.step.value = '".$this->_nextstep."';");
125: $link->attachEventDefinition("submitAttach", "onclick", "document.setupform.submit();");
126: $link->setClass("nav");
127: $link->setContent("<span>»</span>");
128:
129: if ($this->_nextstep != "") {
130: $this->_stepTemplateClass->set("s", "NEXT", $link->render());
131: } else {
132: $this->_stepTemplateClass->set("s", "NEXT", '');
133: }
134:
135: $backlink = new cHTMLLink("#");
136: $backlink->attachEventDefinition("pageAttach", "onclick", "document.setupform.step.value = '".$this->_backstep."';");
137: $backlink->attachEventDefinition("submitAttach", "onclick", "document.setupform.submit();");
138: $backlink->setClass("nav navBack");
139: $backlink->setContent("<span>«</span>");
140: $this->_stepTemplateClass->set("s", "BACK", $backlink->render());
141: }
142:
143: public function render() {
144: if ($this->_navigationEnabled) {
145: $this->_createNavigation();
146: }
147:
148: if ($this->_step !== false) {
149: $this->_tpl->set("s", "STEPS", cGenerateSetupStepsDisplay($this->_step));
150: } else {
151: $this->_tpl->set("s", "STEPS", "");
152: }
153:
154: $this->_tpl->set("s", "HEADER", $this->_sHeader);
155: $this->_tpl->set("s", "TITLE", "CONTENIDO Setup - " . $this->_sHeader);
156:
157: $this->_tpl->set("s", "CONTENT", $this->_stepTemplateClass->generate($this->_stepTemplate, true, false));
158:
159: $this->_tpl->generate("templates/setup.tpl", false, false);
160: }
161:
162: public function renderSystemCheck() {
163: if ($this->_navigationEnabled) {
164: $this->_createNavigation();
165: }
166:
167: if ($this->_step !== false) {
168: $this->_tpl->set("s", "STEPS", '');
169: } else {
170: $this->_tpl->set("s", "STEPS", '');
171: }
172:
173: $this->_tpl->set("s", "HEADER", '');
174: $this->_tpl->set("s", "TITLE", '');
175:
176: $this->_tpl->set("s", "CONTENT", $this->_stepTemplateClass->generate($this->_stepTemplate, true, false));
177:
178: $this->_tpl->generate("templates/systemcheck/setup.tpl", false, false);
179: }
180: }
181:
182: ?>