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
    • 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

  • cApiAction
  • cApiActionCollection
  • cApiActionlog
  • cApiActionlogCollection
  • cApiArea
  • cApiAreaCollection
  • cApiArticle
  • cApiArticleCollection
  • cApiArticleLanguage
  • cApiArticleLanguageCollection
  • cApiArticleSpecification
  • cApiArticleSpecificationCollection
  • cApiCategory
  • cApiCategoryArticle
  • cApiCategoryArticleCollection
  • cApiCategoryCollection
  • cApiCategoryLanguage
  • cApiCategoryLanguageCollection
  • cApiCategoryTree
  • cApiCategoryTreeCollection
  • cApiClient
  • cApiClientCollection
  • cApiClientLanguage
  • cApiClientLanguageCollection
  • cApiCommunication
  • cApiCommunicationCollection
  • cApiContainer
  • cApiContainerCollection
  • cApiContainerConfiguration
  • cApiContainerConfigurationCollection
  • cApiContent
  • cApiContentCollection
  • cApiDbfs
  • cApiDbfsCollection
  • cApiFile
  • cApiFileCollection
  • cApiFileInformation
  • cApiFileInformationCollection
  • cApiFrameFile
  • cApiFrameFileCollection
  • cApiFrontendGroup
  • cApiFrontendGroupCollection
  • cApiFrontendGroupMember
  • cApiFrontendGroupMemberCollection
  • cApiFrontendPermission
  • cApiFrontendPermissionCollection
  • cApiFrontendUser
  • cApiFrontendUserCollection
  • cApiGroup
  • cApiGroupCollection
  • cApiGroupMember
  • cApiGroupMemberCollection
  • cApiGroupProperty
  • cApiGroupPropertyCollection
  • cApiInUse
  • cApiInUseCollection
  • cApiIso3166
  • cApiIso3166Collection
  • cApiIso6392
  • cApiIso6392Collection
  • cApiKeyword
  • cApiKeywordCollection
  • cApiLanguage
  • cApiLanguageCollection
  • cApiLayout
  • cApiLayoutCollection
  • cApiMailLog
  • cApiMailLogCollection
  • cApiMailLogSuccess
  • cApiMailLogSuccessCollection
  • cApiMetaTag
  • cApiMetaTagCollection
  • cApiMetaType
  • cApiMetaTypeCollection
  • cApiModule
  • cApiModuleCollection
  • cApiNavMain
  • cApiNavMainCollection
  • cApiNavSub
  • cApiNavSubCollection
  • cApiOnlineUser
  • cApiOnlineUserCollection
  • cApiPathresolveCache
  • cApiPathresolveCacheCollection
  • cApiProperty
  • cApiPropertyCollection
  • cApiRight
  • cApiRightCollection
  • cApiSearchTracking
  • cApiSearchTrackingCollection
  • cApiStat
  • cApiStatCollection
  • cApiSystemProperty
  • cApiSystemPropertyCollection
  • cApiTemplate
  • cApiTemplateCollection
  • cApiTemplateConfiguration
  • cApiTemplateConfigurationCollection
  • cApiType
  • cApiTypeCollection
  • cApiUpload
  • cApiUploadCollection
  • cApiUploadMeta
  • cApiUploadMetaCollection
  • cApiUser
  • cApiUserCollection
  • cApiUserProperty
  • cApiUserPropertyCollection
  • NoteCollection
  • NoteItem
  • TODOCollection
  • TODOItem
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo
  1: <?php
  2: /**
  3:  * This file contains the container configuration collection and item class.
  4:  *
  5:  * @package Core
  6:  * @subpackage GenericDB_Model
  7:  * @version SVN Revision $Rev:$
  8:  *
  9:  * @author Timo Hummel
 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:  * Container configuration collection
 20:  *
 21:  * @package Core
 22:  * @subpackage GenericDB_Model
 23:  */
 24: class cApiContainerConfigurationCollection extends ItemCollection {
 25: 
 26:     /**
 27:      * Create a new collection of items.
 28:      *
 29:      * @param string $select where clause to use for selection (see
 30:      *            ItemCollection::select())
 31:      */
 32:     public function __construct($select = false) {
 33:         global $cfg;
 34:         parent::__construct($cfg['tab']['container_conf'], 'idcontainerc');
 35:         $this->_setItemClass('cApiContainerConfiguration');
 36: 
 37:         // set the join partners so that joins can be used via link() method
 38:         $this->_setJoinPartner('cApiTemplateConfigurationCollection');
 39: 
 40:         if ($select !== false) {
 41:             $this->select($select);
 42:         }
 43:     }
 44: 
 45:     /**
 46:      * Creates a container configuration item
 47:      * @param int $idtplcfg
 48:      * @param int $number
 49:      * @param string $container
 50:      * @return cApiContainerConfiguration
 51:      */
 52:     public function create($idtplcfg, $number, $container) {
 53:         $item = $this->createNewItem();
 54: 
 55:         $item->set('idtplcfg', $idtplcfg);
 56:         $item->set('number', $number);
 57:         $item->set('container', $container);
 58:         $item->store();
 59: 
 60:         return $item;
 61:     }
 62: 
 63:     /**
 64:      * Returns list of all configured container by template configuration id
 65:      *
 66:      * @param  int  $idtplcfg  Template configuration id
 67:      * @return  array  Assoziative array where the key is the number and
 68:      *                 value the container configuration.
 69:      */
 70:     public function getByTemplateConfiguration($idtplcfg) {
 71:         $configuration = array();
 72: 
 73:         $this->select('idtplcfg = ' . (int) $idtplcfg, '', 'number ASC');
 74:         while (($item = $this->next()) !== false) {
 75:             $configuration[(int) $item->get('number')] = $item->get('container');
 76:         }
 77: 
 78:         return $configuration;
 79:     }
 80: }
 81: 
 82: /**
 83:  * Container configuration item
 84:  *
 85:  * @package Core
 86:  * @subpackage GenericDB_Model
 87:  */
 88: class cApiContainerConfiguration extends Item {
 89: 
 90:     /**
 91:      * Constructor Function
 92:      *
 93:      * @param mixed $mId Specifies the ID of item to load
 94:      */
 95:     public function __construct($mId = false) {
 96:         global $cfg;
 97:         parent::__construct($cfg['tab']['container_conf'], 'idcontainerc');
 98:         $this->setFilters(array(), array());
 99:         if ($mId !== false) {
100:             $this->loadByPrimaryKey($mId);
101:         }
102:     }
103: 
104:     /**
105:      * Userdefined setter for container config fields.
106:      *
107:      * @param string $name
108:      * @param mixed $value
109:      * @param bool $bSafe Flag to run defined inFilter on passed value
110:      * @todo should return return value of overloaded method
111:      */
112:     public function setField($name, $value, $bSafe = true) {
113:         switch ($name) {
114:             case 'idtplcfg':
115:             case 'number':
116:                 $value = cSecurity::toInteger($value);
117:                 break;
118:         }
119: 
120:         parent::setField($name, $value, $bSafe);
121:     }
122: 
123:     /**
124:      * Adds a key value pair to passed container string and returns the modified
125:      * container string
126:      * @param string $container
127:      * @param string $key
128:      * @param string $value
129:      * @return string
130:      */
131:     public static function addContainerValue($container, $key, $value) {
132:         $container .= $key . '=' . urlencode(stripslashes($value)) . '&';
133:         return $container;
134:     }
135: 
136:     /**
137:      * Parses the container value to its variables
138:      * @param string $value
139:      * @return array
140:      */
141:     public static function parseContainerValue($value) {
142:         $vars = array();
143: 
144:         $value = preg_replace('/&$/', '', $value);
145:         $parts = preg_split('/&/', $value);
146:         foreach ($parts as $key1 => $value1) {
147:             $param = explode('=', $value1);
148:             foreach ($param as $key2 => $value2) {
149:                 $vars[$param[0]] = urldecode($param[1]);
150:             }
151:         }
152: 
153:         return $vars;
154:     }
155: 
156: }
157: 
CMS CONTENIDO 4.9.5 API documentation generated by ApiGen 2.8.0