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