Overview

Packages

  • Core
    • Authentication
    • Backend
    • Cache
    • CEC
    • Chain
    • ContentType
    • Database
    • Datatype
    • Debug
    • Exception
    • Frontend
      • Search
      • URI
      • Util
    • GenericDB
      • Model
    • GUI
      • HTML
    • I18N
    • LayoutHandler
    • Log
    • Security
    • Session
    • Util
    • Validation
    • Versioning
    • XML
  • Module
    • ContentSitemapHtml
    • ContentSitemapXml
    • ContentUserForum
    • NavigationMain
    • NavigationTop
  • 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

  • ArticleForumRightBottom
  • cApiClickableAction
  • cApiClickableQuestionAction
  • cGuiFoldingRow
  • cGuiList
  • cGuiMenu
  • cGuiNavigation
  • cGuiNotification
  • cGuiObjectPager
  • cGuiPage
  • cGuiScrollList
  • cGuiTableForm
  • cGuiTree
  • cPager
  • cTemplate
  • cTree
  • cTreeItem
  • NoteLink
  • NoteList
  • NoteListItem
  • NoteView
  • TODOBackendList
  • TODOLink
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo
  1: <?php
  2: /**
  3:  * This file contains the foldable table row GUI class.
  4:  *
  5:  * @package          Core
  6:  * @subpackage       GUI
  7:  * @version          SVN Revision $Rev:$
  8:  *
  9:  * @author           Bjoern Behrens
 10:  * @copyright        four for business AG <www.4fb.de>
 11:  * @license          http://www.contenido.org/license/LIZENZ.txt
 12:  * @link             http://www.4fb.de
 13:  * @link             http://www.contenido.org
 14:  */
 15: 
 16: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
 17: 
 18: /**
 19:  * Foldable table row GUI class
 20:  *
 21:  * @package    Core
 22:  * @subpackage GUI
 23:  */
 24: class cGuiFoldingRow extends cHTML {
 25: 
 26:     /**
 27:      * Table row with the header
 28:      * @var cHTMLTableRow
 29:      */
 30:     protected $_headerRow;
 31: 
 32:     /**
 33:      * Table header data
 34:      * @var cHTMLTableHead
 35:      */
 36:     protected $_headerData;
 37: 
 38:     /**
 39:      * Table row with the content
 40:      * @var cHTMLTableRow
 41:      */
 42:     protected $_contentRow;
 43: 
 44:     /**
 45:      * ID for link that triggers expandCollapse
 46:      * @var string
 47:      */
 48:     protected $_linkId;
 49: 
 50:     /**
 51:      * Link
 52:      * @var cHTMLLink
 53:      */
 54:     protected $_link;
 55: 
 56:     /**
 57:      * Table content data
 58:      * @private cHTMLTableData
 59:      */
 60:     protected $_contentData;
 61: 
 62:     public function __construct($uuid, $caption = "", $linkId = "", $bExpanded = null) {
 63:         global $auth;
 64: 
 65:         $this->setCaption($caption);
 66: 
 67:         $this->_headerRow = new cHTMLTableRow();
 68:         $this->_headerData = new cHTMLTableHead();
 69:         $this->_contentRow = new cHTMLTableRow();
 70:         $this->_contentRow->updateAttributes(array("id" => $uuid));
 71:         $this->_contentData = new cHTMLTableData();
 72:         $this->_uuid = $uuid;
 73:         $this->_link = new cHTMLLink();
 74:         $this->_linkId = $linkId;
 75: 
 76:         $this->_headerData->setClass("foldingrow");
 77: 
 78:         $this->_hiddenField = new cHTMLHiddenField("expandstate_" . $this->_contentRow->getID());
 79: 
 80:         $this->_foldingImage = new cHTMLImage();
 81:         $this->_foldingImage->setStyle("margin-right: 4px;");
 82: 
 83:         $this->setExpanded(false);
 84: 
 85:         $this->addRequiredScript("parameterCollector.js");
 86:         $this->addRequiredScript("cfoldingrow.js");
 87: 
 88:         $user = new cApiUser($auth->auth["uid"]);
 89: 
 90:         if ($bExpanded == null) {
 91:             // Check for expandstate
 92:             if (!$user->virgin) {
 93:                 if ($user->getProperty("expandstate", $uuid) == "true") {
 94:                     $this->setExpanded($user->getProperty("expandstate", $uuid));
 95:                 }
 96:             }
 97:         } else {
 98:             if ($bExpanded) {
 99:                 $this->setExpanded(true);
100:             } else {
101:                 $this->setExpanded(false);
102:             }
103:         }
104:     }
105: 
106:     public function setExpanded($expanded = false) {
107:         if ($expanded == true) {
108:             $this->_foldingImage->setSrc("images/widgets/foldingrow/expanded.gif");
109:             $this->_foldingImage->updateAttributes(array("data" => "expanded"));
110:             $this->_contentRow->setStyle("display: ;");
111:             $this->_hiddenField->setValue('expanded');
112:         } else {
113:             $this->_foldingImage->setSrc("images/widgets/foldingrow/collapsed.gif");
114:             $this->_foldingImage->updateAttributes(array("data" => "collapsed"));
115:             $this->_contentRow->setStyle("display: none;");
116:             $this->_hiddenField->setValue('collapsed');
117:         }
118:         $this->_expanded = $expanded;
119:     }
120: 
121:     public function setCaption($caption) {
122:         $this->_caption = $caption;
123:     }
124: 
125:     public function setHelpContext($context = false) {
126:         $this->_helpContext = $context;
127:     }
128: 
129:     public function setIndent($indent = 0) {
130:         $this->_indent = $indent;
131:     }
132: 
133:     function setContentData($content) {
134:         $this->_contentData->setContent($content);
135:     }
136: 
137:     public function render() {
138:         // Build the expand/collapse link
139:         $this->_link->setClass("foldingrow");
140:         if ($this->_linkId != NULL) {
141:             $this->_link->setID($this->_linkId);
142:         }
143: 
144:         $imgid = $this->_foldingImage->getID();
145:         $rowid = $this->_contentRow->getID();
146:         $hiddenid = $this->_hiddenField->getID();
147:         $uuid = $this->_uuid;
148: 
149:         $this->_link->setLink("javascript:cGuiFoldingRow_expandCollapse('$imgid', '$rowid', '$hiddenid', '$uuid');");
150:         $this->_link->setContent($this->_foldingImage->render() . $this->_caption);
151: 
152:         $this->_headerData->setContent(array($this->_hiddenField, $this->_link));
153:         $this->_headerRow->setContent($this->_headerData);
154: 
155:         $this->_contentRow->setContent($this->_contentData);
156: 
157:         $output = $this->_headerRow->render();
158:         $output .= $this->_contentRow->render();
159: 
160:         return ($output);
161:     }
162: 
163: }
164: 
165: ?>
CMS CONTENIDO 4.9.0 API documentation generated by ApiGen 2.8.0