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: 23:
24: class cHTMLAlphaImage extends cHTMLImage {
25:
26: protected $_sClickImage;
27:
28: protected $_sMouseoverClickImage;
29:
30: protected $_sMouseoverSrc;
31:
32: 33: 34:
35: public function __construct() {
36: parent::__construct();
37: $this->setAlt("");
38: }
39:
40: 41: 42: 43:
44: public function cHTMLAlphaImage() {
45: cDeprecated('This method is deprecated and is not needed any longer. Please use __construct() as constructor function.');
46: $this->__construct();
47: }
48:
49: public function setMouseover($sMouseoverSrc) {
50: $this->_sMouseoverSrc = $sMouseoverSrc;
51: }
52:
53: public function setSwapOnClick($sClickSrc, $sMouseoverClickSrc) {
54: $this->_sClickImage = $sClickSrc;
55: $this->_sMouseoverClickImage = $sMouseoverClickSrc;
56: }
57:
58: public function toHtml() {
59: $imageLocations = "this.imgnormal = '%s'; this.imgover = '%s'; this.clickimgnormal = '%s'; this.clickimgover = '%s';";
60:
61: $this->attachEventDefinition("imagelocs", "onload", sprintf($imageLocations, $this->getAttribute('src'), $this->_sMouseoverSrc, $this->_sClickImage, $this->_sMouseoverClickImage));
62:
63: if ($this->_sMouseoverSrc != "") {
64: if ($this->_sClickImage != "") {
65: $this->attachEventDefinition("click", "onclick", "clickHandler(this);");
66: $this->attachEventDefinition("mouseover", "onmouseover", "mouseoverHandler(this);");
67: $this->attachEventDefinition("mouseover", "onmouseout", "mouseoutHandler(this);");
68: } else {
69: $sMouseScript = 'this.src=\'%1$s\';';
70: $this->attachEventDefinition("mouseover", "onmouseover", sprintf($sMouseScript, $this->_sMouseoverSrc));
71: $this->attachEventDefinition("mouseover", "onmouseout", sprintf($sMouseScript, $this->getAttribute('src')));
72: }
73: }
74:
75: return parent::toHtml();
76: }
77:
78: }
79:
80: 81: 82: 83: 84: 85:
86: class cHTMLErrorMessageList extends cHTMLDiv {
87: 88: 89:
90: protected $_oTable;
91:
92: 93: 94:
95: public function __construct() {
96: $this->_oTable = new cHTMLTable();
97: $this->_oTable->setWidth("100%");
98: parent::__construct();
99: $this->setClass("errorlist");
100: }
101:
102: 103: 104: 105:
106: public function cHTMLErrorMessageList() {
107: cDeprecated('This method is deprecated and is not needed any longer. Please use __construct() as constructor function.');
108: $this->__construct();
109: }
110:
111: public function setContent($content) {
112: $this->_oTable->setContent($content);
113: }
114:
115: public function toHtml() {
116: $this->_setContent($this->_oTable->render());
117: return parent::toHtml();
118: }
119:
120: }
121:
122: 123: 124: 125: 126: 127:
128: class cHTMLFoldableErrorMessage extends cHTMLTableRow {
129: 130: 131:
132: protected $_oTitle;
133:
134: 135: 136:
137: protected $_oMessage;
138:
139: 140: 141:
142: protected $_oIcon;
143:
144: 145: 146:
147: protected $_oFolding;
148:
149: 150: 151: 152:
153: public $_oContent;
154:
155: 156: 157:
158: protected $_oIconImg;
159:
160: 161: 162: 163: 164: 165: 166:
167: public function __construct($title, $message, $icon = false, $iconText = false) {
168: $this->_oFolding = new cHTMLTableData();
169: $this->_oContent = new cHTMLTableData();
170: $this->_oIcon = new cHTMLTableData();
171: $this->_oIconImg = new cHTMLAlphaImage();
172: $this->_oTitle = new cHTMLDiv();
173: $this->_oMessage = new cHTMLDiv();
174: $this->_oMessage->advanceID();
175:
176: $alphaImage = new cHTMLAlphaImage();
177: $alphaImage->setClass("closer");
178: $alphaImage->setStyle('margin-top:4px;');
179: $alphaImage->setSrc("images/controls/open_all.gif");
180: $alphaImage->setMouseover("images/controls/open_all.gif");
181: $alphaImage->setSwapOnClick("images/controls/close_all.gif", "images/controls/close_all.gif");
182: $alphaImage->attachEventDefinition("showhide", "onclick", "aldiv = document.getElementById('" . $this->_oMessage->getID() . "'); showHideMessage(this, aldiv);");
183:
184: $this->_oTitle->setContent($title);
185: $this->_oTitle->setStyle("cursor:pointer;");
186: $this->_oTitle->attachEventDefinition("showhide", "onclick", "alimg = document.getElementById('" . $alphaImage->getID() . "'); aldiv = document.getElementById('" . $this->_oMessage->getID() . "'); showHideMessage(alimg, aldiv); clickHandler(alimg);");
187:
188: $this->_oMessage->setContent($message);
189: $this->_oMessage->setClass("entry_closed");
190:
191: $this->_oFolding->setVerticalAlignment("top");
192: $this->_oFolding->setContent($alphaImage);
193: $this->_oFolding->setClass("icon");
194:
195: $this->_oContent->setVerticalAlignment("top");
196: $this->_oContent->setClass("entry");
197: $this->_oContent->setContent(array(
198: $this->_oTitle,
199: $this->_oMessage
200: ));
201:
202: $this->_oIcon->setClass("icon");
203: $this->_oIcon->setVerticalAlignment("top");
204: if ($icon !== false) {
205: $this->_oIconImg->setSrc($icon);
206:
207: if ($iconText !== false) {
208: $this->_oIconImg->setAlt($iconText);
209: }
210:
211: $this->_oIcon->setContent($this->_oIconImg);
212: } else {
213: $this->_oIcon->setContent(" ");
214: }
215:
216: parent::__construct();
217: }
218:
219: 220: 221: 222: 223: 224: 225: 226:
227: public function cHTMLFoldableErrorMessage($title, $message, $icon = false, $iconText = false) {
228: cDeprecated('This method is deprecated and is not needed any longer. Please use __construct() as constructor function.');
229: $this->__construct($title, $message, $icon, $iconText);
230: }
231:
232: public function toHtml() {
233: $this->setContent(array(
234: $this->_oFolding,
235: $this->_oContent,
236: $this->_oIcon
237: ));
238: return parent::toHtml();
239: }
240:
241: }
242:
243: 244: 245: 246: 247: 248:
249: class cHTMLInfoMessage extends cHTMLTableRow {
250: 251: 252: 253:
254: public $_oTitle;
255:
256: 257: 258:
259: protected $_oMessage;
260:
261: 262: 263: 264: 265:
266: public function __construct($title, $message) {
267: $this->_oTitle = new cHTMLTableData();
268: $this->_oMessage = new cHTMLTableData();
269:
270: $this->_oTitle->setContent($title);
271: $this->_oTitle->setClass("entry_nowrap");
272: $this->_oTitle->setAttribute("nowrap", "nowrap");
273: $this->_oTitle->setWidth(1);
274: $this->_oTitle->setVerticalAlignment("top");
275: $this->_oMessage->setContent($message);
276: $this->_oMessage->setClass("entry_nowrap");
277:
278: parent::__construct();
279: }
280:
281: 282: 283: 284: 285: 286:
287: public function cHTMLInfoMessage($title, $message) {
288: cDeprecated('This method is deprecated and is not needed any longer. Please use __construct() as constructor function.');
289: $this->__construct($title, $message);
290: }
291:
292: public function toHtml() {
293: $this->setContent(array(
294: $this->_oTitle,
295: $this->_oMessage
296: ));
297: return parent::toHtml();
298: }
299:
300: }
301:
302: 303: 304: 305: 306: 307: 308:
309: class cHTMLLanguageLink extends cHTMLDiv {
310:
311: 312: 313: 314: 315: 316:
317: public function __construct($langcode, $langname, $stepnumber) {
318: parent::__construct();
319:
320: $this->setStyle("height:40px;width:150px;");
321:
322: $link = new cHTMLLink("#");
323: $link->setClass("nav navLabel");
324: $link->setContent($langname . "<span>»</span>");
325: $link->attachEventDefinition("stepAttach", "onclick", "document.setupform.step.value = '$stepnumber';");
326: $link->attachEventDefinition("languageAttach", "onclick", "document.setupform.elements.language.value = '$langcode';");
327: $link->attachEventDefinition("submitAttach", "onclick", "document.setupform.submit();");
328:
329: $this->setContent($link->render());
330: }
331:
332: 333: 334: 335: 336: 337: 338:
339: public function cHTMLLanguageLink($langcode, $langname, $stepnumber) {
340: cDeprecated('This method is deprecated and is not needed any longer. Please use __construct() as constructor function.');
341: $this->__construct($langcode, $langname, $stepnumber);
342: }
343:
344: }
345:
346: 347: 348: 349: 350: 351: 352:
353: class cHTMLButtonLink extends cHTMLDiv {
354:
355: 356: 357: 358: 359:
360: public function __construct($href, $title) {
361: parent::__construct();
362:
363: $this->setStyle("height:40px;width:180px;");
364:
365: $link = new cHTMLLink($href);
366: $link->setAttribute("target", "_blank");
367: $link->setClass("nav navLabel");
368: $link->setContent($title . "<span>»</span>");
369:
370: $this->setContent($link->render());
371: }
372:
373: 374: 375: 376: 377: 378:
379: function cHTMLButtonLink($href, $title) {
380: cDeprecated('This method is deprecated and is not needed any longer. Please use __construct() as constructor function.');
381: $this->__construct($href, $title);
382: }
383:
384: }
385: