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
  • Smarty
    • Cacher
    • Compiler
    • Config
    • Debug
    • PluginsBlock
    • PluginsFilter
    • PluginsFunction
    • PluginsInternal
    • PluginsModifier
    • PluginsModifierCompiler
    • PluginsShared
    • Security
    • Template
    • TemplateResources
  • Swift
    • ByteStream
    • CharacterStream
    • Encoder
    • Events
    • KeyCache
    • Mailer
    • Mime
    • Plugins
    • Transport

Classes

  • Swift_FailoverTransport
  • Swift_LoadBalancedTransport
  • Swift_MailTransport
  • Swift_Plugins_Loggers_ArrayLogger
  • Swift_Plugins_Loggers_EchoLogger
  • Swift_SendmailTransport
  • Swift_SmtpTransport
  • Swift_Transport_AbstractSmtpTransport
  • Swift_Transport_Esmtp_Auth_CramMd5Authenticator
  • Swift_Transport_Esmtp_Auth_LoginAuthenticator
  • Swift_Transport_Esmtp_Auth_PlainAuthenticator
  • Swift_Transport_Esmtp_AuthHandler
  • Swift_Transport_EsmtpTransport
  • Swift_Transport_FailoverTransport
  • Swift_Transport_LoadBalancedTransport
  • Swift_Transport_MailTransport
  • Swift_Transport_SendmailTransport
  • Swift_Transport_SimpleMailInvoker
  • Swift_Transport_StreamBuffer

Interfaces

  • Swift_Plugins_Logger
  • Swift_Plugins_Pop_Pop3Exception
  • Swift_Transport
  • Swift_Transport_Esmtp_Authenticator
  • Swift_Transport_EsmtpHandler
  • Swift_Transport_IoBuffer
  • Swift_Transport_MailInvoker
  • Swift_Transport_SmtpAgent
  • Swift_TransportException
  • Overview
  • Package
  • Function
  • Todo
  • Download
  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:      * @var 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: 
 82:         $this->setExpanded(false);
 83: 
 84:         $this->addRequiredScript("parameterCollector.js");
 85:         $this->addRequiredScript("cfoldingrow.js");
 86: 
 87:         $user = new cApiUser($auth->auth["uid"]);
 88: 
 89:         if ($bExpanded == NULL) {
 90:             // Check for expandstate
 91:             if (!$user->virgin) {
 92:                 if ($user->getProperty("expandstate", $uuid) == "true") {
 93:                     $this->setExpanded($user->getProperty("expandstate", $uuid));
 94:                 }
 95:             }
 96:         } else {
 97:             if ($bExpanded) {
 98:                 $this->setExpanded(true);
 99:             } else {
100:                 $this->setExpanded(false);
101:             }
102:         }
103:     }
104: 
105:     public function setExpanded($expanded = false) {
106:         if ($expanded == true) {
107:             $this->_foldingImage->setSrc("images/widgets/foldingrow/expanded.gif");
108:             $this->_foldingImage->updateAttributes(array("data-state" => "expanded"));
109:             $this->_contentRow->setStyle("display: ;");
110:             $this->_hiddenField->setValue('expanded');
111:         } else {
112:             $this->_foldingImage->setSrc("images/widgets/foldingrow/collapsed.gif");
113:             $this->_foldingImage->updateAttributes(array("data-state" => "collapsed"));
114:             $this->_contentRow->setStyle("display: none;");
115:             $this->_hiddenField->setValue('collapsed');
116:         }
117:         $this->_expanded = $expanded;
118:     }
119: 
120:     public function setCaption($caption) {
121:         $this->_caption = $caption;
122:     }
123: 
124:     public function setHelpContext($context = false) {
125:         $this->_helpContext = $context;
126:     }
127: 
128:     public function setIndent($indent = 0) {
129:         $this->_indent = $indent;
130:     }
131: 
132:     function setContentData($content) {
133:         $this->_contentData->setContent($content);
134:     }
135: 
136:     public function render() {
137:         // Build the expand/collapse link
138:         $this->_link->setClass("foldingrow");
139:         if ($this->_linkId != NULL) {
140:             $this->_link->setID($this->_linkId);
141:         }
142: 
143:         $imgid = $this->_foldingImage->getID();
144:         $rowid = $this->_contentRow->getID();
145:         $hiddenid = $this->_hiddenField->getID();
146:         $uuid = $this->_uuid;
147: 
148:         $this->_link->setLink("javascript:void(0);");
149:         $this->_link->setContent($this->_foldingImage->render() . $this->_caption);
150: 
151:         $this->_headerData->setContent(array($this->_hiddenField, $this->_link));
152:         $this->_headerRow->setContent($this->_headerData);
153: 
154:         $this->_contentRow->setContent($this->_contentData);
155: 
156:         $output = $this->_headerRow->render();
157:         $output .= $this->_contentRow->render();
158: 
159: $output = <<<HTML
160: <!-- cGuiFoldingRow -->
161: {$output}
162: <script type="text/javascript">
163: (function(Con, $) {
164:     $(function() {
165:         $("#{$this->_linkId}").click(function() {
166:             Con.FoldingRow.toggle("{$imgid}", "{$rowid}", "{$hiddenid}", "{$uuid}");
167:         });
168:     });
169: })(Con, Con.$);
170: </script>
171: <!-- /cGuiFoldingRow -->
172: HTML;
173: 
174:         return ($output);
175:     }
176: 
177: }
178: 
179: ?>
CMS CONTENIDO 4.9.7 API documentation generated by ApiGen