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 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.7 API documentation generated by ApiGen