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 cSetupMask
25: {
26: function cSetupMask($sStepTemplate, $iStep = false)
27: {
28: $this->_oTpl = new cTemplate();
29: $this->_oStepTemplate = new cTemplate();
30:
31: $this->_sStepTemplate = $sStepTemplate;
32: $this->_iStep = $iStep;
33: $this->_bNavigationEnabled = false;
34: }
35:
36: function setNavigation($sBackstep, $sNextstep)
37: {
38: $this->_bNavigationEnabled = true;
39: $this->_bBackstep = $sBackstep;
40: $this->_bNextstep = $sNextstep;
41: }
42:
43: function ($sHeader)
44: {
45: if (isset($_SESSION['setuptype'])) {
46: $sSetupType = $_SESSION['setuptype'];
47: } else {
48: $sSetupType = '';
49: }
50:
51: switch ($sSetupType) {
52: case "setup":
53: $this->_sHeader = 'Setup - ' . $sHeader;
54: break;
55: case "upgrade":
56: $this->_sHeader = 'Upgrade - ' . $sHeader;
57: break;
58: default:
59: $this->_sHeader = $sHeader;
60: break;
61: }
62: }
63:
64: function _createNavigation()
65: {
66: $link = new cHTMLLink("#");
67:
68: $link->attachEventDefinition("pageAttach", "onclick", "document.setupform.step.value = '".$this->_bNextstep."';");
69: $link->attachEventDefinition("submitAttach", "onclick", "document.setupform.submit();");
70: $link->setClass("nav");
71: $link->setContent("<span>»</span>");
72:
73: if ($this->_bNextstep != "") {
74: $this->_oStepTemplate->set("s", "NEXT", $link->render());
75: } else {
76: $this->_oStepTemplate->set("s", "NEXT", '');
77: }
78:
79: $backlink = new cHTMLLink("#");
80: $backlink->attachEventDefinition("pageAttach", "onclick", "document.setupform.step.value = '".$this->_bBackstep."';");
81: $backlink->attachEventDefinition("submitAttach", "onclick", "document.setupform.submit();");
82: $backlink->setClass("nav navBack");
83: $backlink->setContent("<span>«</span>");
84: $this->_oStepTemplate->set("s", "BACK", $backlink->render());
85: }
86:
87: function render()
88: {
89: if ($this->_bNavigationEnabled) {
90: $this->_createNavigation();
91: }
92:
93: if ($this->_iStep !== false) {
94: $this->_oTpl->set("s", "STEPS", cGenerateSetupStepsDisplay($this->_iStep));
95: } else {
96: $this->_oTpl->set("s", "STEPS", "");
97: }
98:
99: $this->_oTpl->set("s", "HEADER", $this->_sHeader);
100: $this->_oTpl->set("s", "TITLE", "CONTENIDO Setup - " . $this->_sHeader);
101:
102: $this->_oTpl->set("s", "CONTENT", $this->_oStepTemplate->generate($this->_sStepTemplate, true, false));
103:
104: $this->_oTpl->generate("templates/setup.tpl", false, false);
105: }
106:
107: function renderSystemCheck()
108: {
109: if ($this->_bNavigationEnabled) {
110: $this->_createNavigation();
111: }
112:
113: if ($this->_iStep !== false) {
114: $this->_oTpl->set("s", "STEPS", '');
115: } else {
116: $this->_oTpl->set("s", "STEPS", '');
117: }
118:
119: $this->_oTpl->set("s", "HEADER", '');
120: $this->_oTpl->set("s", "TITLE", '');
121:
122: $this->_oTpl->set("s", "CONTENT", $this->_oStepTemplate->generate($this->_sStepTemplate, true, false));
123:
124: $this->_oTpl->generate("templates/systemcheck/setup.tpl", false, false);
125: }
126: }
127:
128: ?>