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
    • ContentSitemapHtml
    • ContentSitemapXml
    • ContentUserForum
    • NavigationTop
    • ScriptCookieDirective
  • mpAutoloaderClassMap
  • None
  • PHP
  • Plugin
    • ContentAllocation
    • CronjobOverview
    • FormAssistant
    • FrontendLogic
    • FrontendUsers
    • Linkchecker
    • ModRewrite
    • Newsletter
    • Repository
      • FrontendNavigation
      • KeywordDensity
    • 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
  • cApiArticleLanguageVersion
  • cApiArticleLanguageVersionCollection
  • cApiArticleSpecification
  • cApiArticleSpecificationCollection
  • cApiCategory
  • cApiCategoryArticle
  • cApiCategoryArticleCollection
  • cApiCategoryCollection
  • cApiCategoryLanguage
  • cApiCategoryLanguageCollection
  • cApiCategoryTree
  • cApiCategoryTreeCollection
  • cApiClient
  • cApiClientCollection
  • cApiClientLanguage
  • cApiClientLanguageCollection
  • cApiCommunication
  • cApiCommunicationCollection
  • cApiContainer
  • cApiContainerCollection
  • cApiContainerConfiguration
  • cApiContainerConfigurationCollection
  • cApiContent
  • cApiContentCollection
  • cApiContentVersion
  • cApiContentVersionCollection
  • 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
  • cApiMetaTagVersion
  • cApiMetaTagVersionCollection
  • 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
  • cApiUserPasswordRequest
  • cApiUserPasswordRequestCollection
  • cApiUserProperty
  • cApiUserPropertyCollection
  • NoteCollection
  • NoteItem
  • TODOCollection
  • TODOItem
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo
  1: <?php
  2: 
  3: /**
  4:  * This file contains the category tree collection and item class.
  5:  *
  6:  * @package Core
  7:  * @subpackage GenericDB_Model
  8:  * @author Timo Hummel
  9:  * @copyright four for business AG <www.4fb.de>
 10:  * @license http://www.contenido.org/license/LIZENZ.txt
 11:  * @link http://www.4fb.de
 12:  * @link http://www.contenido.org
 13:  */
 14: 
 15: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
 16: 
 17: /**
 18:  * Category tree collection
 19:  *
 20:  * @package Core
 21:  * @subpackage GenericDB_Model
 22:  */
 23: class cApiCategoryTreeCollection extends ItemCollection {
 24:     /**
 25:      * Constructor to create an instance of this class.
 26:      *
 27:      * @param bool $select [optional]
 28:      *                     where clause to use for selection (see ItemCollection::select())
 29:      *
 30:      * @throws cDbException
 31:      * @throws cInvalidArgumentException
 32:      */
 33:     public function __construct($select = false) {
 34:         global $cfg;
 35:         parent::__construct($cfg['tab']['cat_tree'], 'idtree');
 36: 
 37:         // set the join partners so that joins can be used via link() method
 38:         $this->_setJoinPartner('cApiCategoryCollection');
 39: 
 40:         $this->_setItemClass('cApiCategoryTree');
 41:         if ($select !== false) {
 42:             $this->select($select);
 43:         }
 44:     }
 45: 
 46:     /**
 47:      * Returns category tree structure by selecting the data from several tables
 48:      * ().
 49:      *
 50:      * @param int $client
 51:      *         Client id
 52:      * @param int $lang
 53:      *         Language id
 54:      *
 55:      * @return array
 56:      *         Category tree structure as follows:
 57:      *         <pre>
 58:      *         $arr[n] (int) idtree value
 59:      *         $arr[n]['idcat'] (int)
 60:      *         $arr[n]['level'] (int)
 61:      *         $arr[n]['idtplcfg'] (int)
 62:      *         $arr[n]['visible'] (int)
 63:      *         $arr[n]['name'] (string)
 64:      *         $arr[n]['public'] (int)
 65:      *         $arr[n]['urlname'] (string)
 66:      *         $arr[n]['is_start'] (int)
 67:      *         </pre>
 68:      * 
 69:      * @throws cDbException
 70:      */
 71:     function getCategoryTreeStructureByClientIdAndLanguageId($client, $lang) {
 72:         global $cfg;
 73: 
 74:         $aCatTree = array();
 75: 
 76:         $sql = 'SELECT * FROM `:cat_tree` AS A, `:cat` AS B, `:cat_lang` AS C ' . 'WHERE A.idcat = B.idcat AND B.idcat = C.idcat AND C.idlang = :idlang AND idclient = :idclient ' . 'ORDER BY idtree';
 77: 
 78:         $sql = $this->db->prepare($sql, array(
 79:             'cat_tree' => $this->table,
 80:             'cat' => $cfg['tab']['cat'],
 81:             'cat_lang' => $cfg['tab']['cat_lang'],
 82:             'idlang' => (int) $lang,
 83:             'idclient' => (int) $client
 84:         ));
 85:         $this->db->query($sql);
 86: 
 87:         while ($this->db->nextRecord()) {
 88:             $aCatTree[$this->db->f('idtree')] = array(
 89:                 'idcat' => $this->db->f('idcat'),
 90:                 'level' => $this->db->f('level'),
 91:                 'idtplcfg' => $this->db->f('idtplcfg'),
 92:                 'visible' => $this->db->f('visible'),
 93:                 'name' => $this->db->f('name'),
 94:                 'public' => $this->db->f('public'),
 95:                 'urlname' => $this->db->f('urlname'),
 96:                 'is_start' => $this->db->f('is_start')
 97:             );
 98:         }
 99: 
100:         return $aCatTree;
101:     }
102: }
103: 
104: /**
105:  * Category tree item
106:  *
107:  * @package Core
108:  * @subpackage GenericDB_Model
109:  */
110: class cApiCategoryTree extends Item {
111:     /**
112:      * Constructor to create an instance of this class.
113:      *
114:      * @param mixed $mId [optional]
115:      *                   Specifies the ID of item to load
116:      *
117:      * @throws cDbException
118:      * @throws cException
119:      */
120:     public function __construct($mId = false) {
121:         global $cfg;
122:         parent::__construct($cfg['tab']['cat_tree'], 'idtree');
123:         $this->setFilters(array(), array());
124:         if ($mId !== false) {
125:             $this->loadByPrimaryKey($mId);
126:         }
127:     }
128: }
129: 
CMS CONTENIDO 4.10.0 API documentation generated by ApiGen 2.8.0