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: 25:
26: class cHTMLAlphaImage extends cHTMLImage {
27:
28: var $_sClickImage;
29:
30: var $_sMouseoverClickImage;
31:
32: var $_sMouseoverSrc;
33:
34: function cHTMLAlphaImage() {
35: parent::__construct();
36: $this->setAlt("");
37: }
38:
39: function setMouseover($sMouseoverSrc) {
40: $this->_sMouseoverSrc = $sMouseoverSrc;
41: }
42:
43: function setSwapOnClick($sClickSrc, $sMouseoverClickSrc) {
44: $this->_sClickImage = $sClickSrc;
45: $this->_sMouseoverClickImage = $sMouseoverClickSrc;
46: }
47:
48: function toHTML() {
49: $imageLocations = "this.imgnormal = '%s'; this.imgover = '%s'; this.clickimgnormal = '%s'; this.clickimgover = '%s';";
50:
51: $this->attachEventDefinition("imagelocs", "onload", sprintf($imageLocations, $this->getAttribute('src'), $this->_sMouseoverSrc, $this->_sClickImage, $this->_sMouseoverClickImage));
52:
53: if ($this->_sMouseoverSrc != "") {
54: if ($this->_sClickImage != "") {
55: $this->attachEventDefinition("click", "onclick", "clickHandler(this);");
56: $this->attachEventDefinition("mouseover", "onmouseover", "mouseoverHandler(this);");
57: $this->attachEventDefinition("mouseover", "onmouseout", "mouseoutHandler(this);");
58: } else {
59: $sMouseScript = 'this.src=\'%1$s\';';
60: $this->attachEventDefinition("mouseover", "onmouseover", sprintf($sMouseScript, $this->_sMouseoverSrc));
61: $this->attachEventDefinition("mouseover", "onmouseout", sprintf($sMouseScript, $this->getAttribute('src')));
62: }
63: }
64:
65: return parent::toHTML();
66: }
67:
68: }
69:
70: 71: 72: 73: 74: 75:
76: class cHTMLErrorMessageList extends cHTMLDiv {
77:
78: function cHTMLErrorMessageList() {
79: $this->_oTable = new cHTMLTable();
80: $this->_oTable->setWidth("100%");
81: parent::__construct();
82: $this->setClass("errorlist");
83: }
84:
85: function setContent($content) {
86: $this->_oTable->setContent($content);
87: }
88:
89: function toHTML() {
90: $this->_setContent($this->_oTable->render());
91: return parent::toHTML();
92: }
93:
94: }
95:
96: 97: 98: 99: 100: 101:
102: class cHTMLFoldableErrorMessage extends cHTMLTableRow {
103:
104: function cHTMLFoldableErrorMessage($sTitle, $sMessage, $sIcon = false, $sIconText = false) {
105: $this->_oFolding = new cHTMLTableData();
106: $this->_oContent = new cHTMLTableData();
107: $this->_oIcon = new cHTMLTableData();
108: $this->_oIconImg = new cHTMLAlphaImage();
109: $this->_oTitle = new cHTMLDiv();
110: $this->_oMessage = new cHTMLDiv();
111: $this->_oMessage->advanceID();
112:
113: $alphaImage = new cHTMLAlphaImage();
114: $alphaImage->setClass("closer");
115: $alphaImage->setStyle('margin-top:4px;');
116: $alphaImage->setSrc("images/controls/open_all.gif");
117: $alphaImage->setMouseover("images/controls/open_all.gif");
118: $alphaImage->setSwapOnClick("images/controls/close_all.gif", "images/controls/close_all.gif");
119: $alphaImage->attachEventDefinition("showhide", "onclick", "aldiv = document.getElementById('" . $this->_oMessage->getId() . "'); showHideMessage(this, aldiv);");
120:
121: $this->_oTitle->setContent($sTitle);
122: $this->_oTitle->setStyle("cursor:pointer;");
123: $this->_oTitle->attachEventDefinition("showhide", "onclick", "alimg = document.getElementById('" . $alphaImage->getId() . "'); aldiv = document.getElementById('" . $this->_oMessage->getId() . "'); showHideMessage(alimg, aldiv); clickHandler(alimg);");
124:
125: $this->_oMessage->setContent($sMessage);
126: $this->_oMessage->setClass("entry_closed");
127:
128: $this->_oFolding->setVerticalAlignment("top");
129: $this->_oFolding->setContent($alphaImage);
130: $this->_oFolding->setClass("icon");
131:
132: $this->_oContent->setVerticalAlignment("top");
133: $this->_oContent->setClass("entry");
134: $this->_oContent->setContent(array(
135: $this->_oTitle,
136: $this->_oMessage
137: ));
138:
139: $this->_oIcon->setClass("icon");
140: $this->_oIcon->setVerticalAlignment("top");
141: if ($sIcon !== false) {
142: $this->_oIconImg->setSrc($sIcon);
143:
144: if ($sIconText !== false) {
145: $this->_oIconImg->setAlt($sIconText);
146: }
147:
148: $this->_oIcon->setContent($this->_oIconImg);
149: } else {
150: $this->_oIcon->setContent(" ");
151: }
152:
153: parent::__construct();
154: }
155:
156: function toHTML() {
157: $this->setContent(array(
158: $this->_oFolding,
159: $this->_oContent,
160: $this->_oIcon
161: ));
162: return parent::toHTML();
163: }
164:
165: }
166:
167: 168: 169: 170: 171: 172:
173: class cHTMLInfoMessage extends cHTMLTableRow {
174:
175: function cHTMLInfoMessage($sTitle, $sMessage) {
176: $this->_oTitle = new cHTMLTableData();
177: $this->_oMessage = new cHTMLTableData();
178:
179: $this->_oTitle->setContent($sTitle);
180: $this->_oTitle->setClass("entry_nowrap");
181: $this->_oTitle->setAttribute("nowrap", "nowrap");
182: $this->_oTitle->setWidth(1);
183: $this->_oTitle->setVerticalAlignment("top");
184: $this->_oMessage->setContent($sMessage);
185: $this->_oMessage->setClass("entry_nowrap");
186:
187: parent::__construct();
188: }
189:
190: function toHTML() {
191: $this->setContent(array(
192: $this->_oTitle,
193: $this->_oMessage
194: ));
195: return parent::toHTML();
196: }
197:
198: }
199:
200: 201: 202: 203: 204: 205: 206:
207: class cHTMLLanguageLink extends cHTMLDiv {
208:
209: function cHTMLLanguageLink($langcode, $langname, $stepnumber) {
210: parent::__construct();
211:
212: $this->setStyle("height:40px;width:150px;");
213:
214: $link = new cHTMLLink("#");
215: $link->setClass("nav navLabel");
216: $link->setContent($langname . "<span>»</span>");
217: $link->attachEventDefinition("stepAttach", "onclick", "document.setupform.step.value = '$stepnumber';");
218: $link->attachEventDefinition("languageAttach", "onclick", "document.setupform.elements.language.value = '$langcode';");
219: $link->attachEventDefinition("submitAttach", "onclick", "document.setupform.submit();");
220:
221: $this->setContent($link->render());
222: }
223:
224: }
225:
226: 227: 228: 229: 230: 231: 232:
233: class cHTMLButtonLink extends cHTMLDiv {
234:
235: function cHTMLButtonLink($href, $title) {
236: parent::__construct();
237:
238: $this->setStyle("height:40px;width:180px;");
239:
240: $link = new cHTMLLink($href);
241: $link->setAttribute("target", "_blank");
242: $link->setClass("nav navLabel");
243: $link->setContent($title . "<span>»</span>");
244:
245: $this->setContent($link->render());
246: }
247:
248: }
249: