Overview

Packages

  • CONTENIDO
  • Core
    • Authentication
    • Backend
    • Cache
    • CEC
    • Chain
    • ContentType
    • Database
    • Debug
    • Exception
    • Frontend
      • Search
      • URI
      • Util
    • GenericDB
      • Model
    • GUI
      • HTML
    • I18N
    • LayoutHandler
    • Log
    • Security
    • Session
    • Util
    • Validation
    • Versioning
    • XML
  • Module
    • ContentRssCreator
    • ContentSitemapHtml
    • ContentSitemapXml
    • ContentUserForum
    • NavigationTop
    • ScriptCookieDirective
  • mpAutoloaderClassMap
  • None
  • Plugin
    • ContentAllocation
    • CronjobOverview
    • FormAssistant
    • FrontendLogic
    • FrontendUsers
    • Linkchecker
    • ModRewrite
    • Newsletter
    • Repository
      • FrontendNavigation
      • KeywordDensity
    • SearchSolr
    • SmartyWrapper
    • UrlShortener
    • UserForum
    • Workflow
  • PluginManager
  • Setup
    • Form
    • GUI
    • Helper
      • Environment
      • Filesystem
      • MySQL
      • PHP
    • UpgradeJob

Classes

  • cHTMLAlphaImage
  • cHTMLButtonLink
  • cHTMLErrorMessageList
  • cHTMLFoldableErrorMessage
  • cHTMLInfoMessage
  • cHTMLLanguageLink
  • cSetupMask
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo
  1: <?php
  2: /**
  3:  * This file contains various classes for displaying the setup.
  4:  *
  5:  * @package    Setup
  6:  * @subpackage GUI
  7:  * @author     Unknown
  8:  * @copyright  four for business AG <www.4fb.de>
  9:  * @license    http://www.contenido.org/license/LIZENZ.txt
 10:  * @link       http://www.4fb.de
 11:  * @link       http://www.contenido.org
 12:  */
 13: 
 14: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
 15: 
 16: /**
 17:  * Alpha image class, based on cHTMLImage.
 18:  *
 19:  * @package Setup
 20:  * @subpackage GUI
 21:  * @todo  Remove the usage of this class. We dont need special alpha filter for IE anymore.
 22:  *        The last place where it is still in use are the error lists with content toggle (+ - icons) feature!
 23:  */
 24: class cHTMLAlphaImage extends cHTMLImage {
 25: 
 26:     protected $_sClickImage;
 27: 
 28:     protected $_sMouseoverClickImage;
 29: 
 30:     protected $_sMouseoverSrc;
 31: 
 32:     /**
 33:      * cHTMLAlphaImage constructor.
 34:      */
 35:     public function __construct() {
 36:         parent::__construct();
 37:         $this->setAlt("");
 38:     }
 39: 
 40:     /**
 41:      * Old constructor
 42:      * @deprecated [2016-04-14] This method is deprecated and is not needed any longer. Please use __construct() as constructor function.
 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:  * Setup error message list based on cHTMLDiv.
 82:  *
 83:  * @package Setup
 84:  * @subpackage GUI
 85:  */
 86: class cHTMLErrorMessageList extends cHTMLDiv {
 87:     /**
 88:      * @var cHTMLTable
 89:      */
 90:     protected $_oTable;
 91: 
 92:     /**
 93:      * cHTMLErrorMessageList constructor.
 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:      * Old constructor
104:      * @deprecated [2016-04-14] This method is deprecated and is not needed any longer. Please use __construct() as constructor function.
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:  * Foldable setup error message based on cHTMLTableRow.
124:  *
125:  * @package Setup
126:  * @subpackage GUI
127:  */
128: class cHTMLFoldableErrorMessage extends cHTMLTableRow {
129:     /**
130:      * @var cHTMLDiv
131:      */
132:     protected $_oTitle;
133: 
134:     /**
135:      * @var cHTMLDiv
136:      */
137:     protected $_oMessage;
138: 
139:     /**
140:      * @var cHTMLTableData
141:      */
142:     protected $_oIcon;
143: 
144:     /**
145:      * @var cHTMLTableData
146:      */
147:     protected $_oFolding;
148: 
149:     /**
150:      * TODO: this should not be public
151:      * @var cHTMLTableData
152:      */
153:     public $_oContent;
154: 
155:     /**
156:      * @var cHTMLAlphaImage
157:      */
158:     protected $_oIconImg;
159: 
160:     /**
161:      * cHTMLFoldableErrorMessage constructor.
162:      * @param $title
163:      * @param $message
164:      * @param bool $icon
165:      * @param bool $iconText
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("&nbsp;");
214:         }
215: 
216:         parent::__construct();
217:     }
218: 
219:     /**
220:      * Old constructor
221:      * @deprecated [2016-04-14] This method is deprecated and is not needed any longer. Please use __construct() as constructor function.
222:      * @param $title
223:      * @param $message
224:      * @param bool $icon
225:      * @param bool $iconText
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:  * Setup info message based on cHTMLTableRow.
245:  *
246:  * @package Setup
247:  * @subpackage GUI
248:  */
249: class cHTMLInfoMessage extends cHTMLTableRow {
250:     /**
251:      * TODO: this should not be public!
252:      * @var cHTMLTableData
253:      */
254:     public $_oTitle;
255: 
256:     /**
257:      * @var cHTMLTableData
258:      */
259:     protected $_oMessage;
260: 
261:     /**
262:      * cHTMLInfoMessage constructor.
263:      * @param $title
264:      * @param $message
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:      * Old constructor
283:      * @deprecated [2016-04-14] This method is deprecated and is not needed any longer. Please use __construct() as constructor function.
284:      * @param $title
285:      * @param $message
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:  * Setup language link based on cHTMLDiv, like
304:  * "English    ->"
305:  *
306:  * @package Setup
307:  * @subpackage GUI
308:  */
309: class cHTMLLanguageLink extends cHTMLDiv {
310: 
311:     /**
312:      * cHTMLLanguageLink constructor.
313:      * @param string $langcode
314:      * @param string $langname
315:      * @param string $stepnumber
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>&raquo;</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:      * Old constructor
334:      * @deprecated [2016-04-14] This method is deprecated and is not needed any longer. Please use __construct() as constructor function.
335:      * @param $langcode
336:      * @param $langname
337:      * @param $stepnumber
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:  * Setup button link based on cHTMLDiv, like
348:  * "Backend - CMS    ->"
349:  *
350:  * @package Setup
351:  * @subpackage GUI
352:  */
353: class cHTMLButtonLink extends cHTMLDiv {
354: 
355:     /**
356:      * cHTMLButtonLink constructor.
357:      * @param string $href
358:      * @param string $title
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>&raquo;</span>");
369: 
370:         $this->setContent($link->render());
371:     }
372: 
373:     /**
374:      * Old constructor
375:      * @deprecated [2016-04-14] This method is deprecated and is not needed any longer. Please use __construct() as constructor function.
376:      * @param $href
377:      * @param $title
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: 
CMS CONTENIDO 4.9.11 API documentation generated by ApiGen 2.8.0