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
  • 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 category tree 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:  * Category tree collection
 20:  *
 21:  * @package Core
 22:  * @subpackage GenericDB_Model
 23:  */
 24: class cApiCategoryTreeCollection 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']['cat_tree'], 'idtree');
 35: 
 36:         // set the join partners so that joins can be used via link() method
 37:         $this->_setJoinPartner('cApiCategoryCollection');
 38: 
 39:         $this->_setItemClass('cApiCategoryTree');
 40:         if ($select !== false) {
 41:             $this->select($select);
 42:         }
 43:     }
 44: 
 45:     /**
 46:      * Returns category tree structure by selecting the data from several tables
 47:      * ().
 48:      *
 49:      * @param int $client Client id
 50:      * @param int $lang Language id
 51:      * @return array Category tree structure as follows:
 52:      *         <pre>
 53:      *         $arr[n] (int) idtree value
 54:      *         $arr[n]['idcat'] (int)
 55:      *         $arr[n]['level'] (int)
 56:      *         $arr[n]['idtplcfg'] (int)
 57:      *         $arr[n]['visible'] (int)
 58:      *         $arr[n]['name'] (string)
 59:      *         $arr[n]['public'] (int)
 60:      *         $arr[n]['urlname'] (string)
 61:      *         $arr[n]['is_start'] (int)
 62:      *         </pre>
 63:      */
 64:     function getCategoryTreeStructureByClientIdAndLanguageId($client, $lang) {
 65:         global $cfg;
 66: 
 67:         $aCatTree = array();
 68: 
 69:         $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';
 70: 
 71:         $sql = $this->db->prepare($sql, array(
 72:             'cat_tree' => $this->table,
 73:             'cat' => $cfg['tab']['cat'],
 74:             'cat_lang' => $cfg['tab']['cat_lang'],
 75:             'idlang' => (int) $lang,
 76:             'idclient' => (int) $client
 77:         ));
 78:         $this->db->query($sql);
 79: 
 80:         while ($this->db->nextRecord()) {
 81:             $aCatTree[$this->db->f('idtree')] = array(
 82:                 'idcat' => $this->db->f('idcat'),
 83:                 'level' => $this->db->f('level'),
 84:                 'idtplcfg' => $this->db->f('idtplcfg'),
 85:                 'visible' => $this->db->f('visible'),
 86:                 'name' => $this->db->f('name'),
 87:                 'public' => $this->db->f('public'),
 88:                 'urlname' => $this->db->f('urlname'),
 89:                 'is_start' => $this->db->f('is_start')
 90:             );
 91:         }
 92: 
 93:         return $aCatTree;
 94:     }
 95: }
 96: 
 97: /**
 98:  * Category tree item
 99:  *
100:  * @package Core
101:  * @subpackage GenericDB_Model
102:  */
103: class cApiCategoryTree extends Item {
104: 
105:     /**
106:      * Constructor Function
107:      *
108:      * @param mixed $mId Specifies the ID of item to load
109:      */
110:     public function __construct($mId = false) {
111:         global $cfg;
112:         parent::__construct($cfg['tab']['cat_tree'], 'idtree');
113:         $this->setFilters(array(), array());
114:         if ($mId !== false) {
115:             $this->loadByPrimaryKey($mId);
116:         }
117:     }
118: }
119: 
CMS CONTENIDO 4.9.1 API documentation generated by ApiGen 2.8.0