contenido\classes\Contenido_FrontendNavigation\Contenido_FrontendNavigation.class.php
Description: Object to build a Contenido Frontend Navigation
Requirements:
- Author
- Rudi Bieller
- Con_php_req
- 5.0
- Copyright
- four for business AG
- License
- http://www.contenido.org/license/LIZENZ.txt
- Link
- http://www.4fb.de
- Link
- {@internal created 2008-02-15 modified 2008-04-25 added method getLevel() and property aLevel, modified loadSubCategories() accordingly modified 2008-09-22 Bugfix in loading protected subcategories when logged in as backenduser modified 2009-01-05 Timo Trautmann L:138 commented out not neccessary condidion which makes categories visible which shouldn't be displayed modified 2009-01-05 Rudi Bieller Fixed bug in permission check at strpos() call line 138ff modified 2009-01-13 Rudi Bieller Added methods isActiveChild() and isActiveParent() modified 2009-01-14 Rudi Bieller Changed contenido_security escaping to intval Added method isActiveChildOfRootOfCategory() modified 2009-04-29 Rudi Bieller Bugfix in isActiveChild() $Id: Contenido_FrontendNavigation.class.php 1028 2009-04-29 08:53:47Z rudi.bieller $: }}
- Package
- Contenido Backend classes
- Version
- 0.3.3
\Contenido_FrontendNavigation
- Parent(s)
- \Contenido_FrontendNavigation_Base
Properties

array $aCategories- Type
- array
- Access
- protected
- Inherited_from
- \Contenido_FrontendNavigation_Base::$$aCategories

array $aCfg- Type
- array
- Access
- protected
- Inherited_from
- \Contenido_FrontendNavigation_Base::$$aCfg

array $aCfgClient- Type
- array
- Access
- protected
- Inherited_from
- \Contenido_FrontendNavigation_Base::$$aCfgClient

boolean $bDbg- Type
- boolean
- Access
- protected
- Inherited_from
- \Contenido_FrontendNavigation_Base::$$bDbg

$iClient- Type
- n/a
- Inherited_from
- \Contenido_FrontendNavigation_Base::$$iClient

$iLang- Type
- n/a
- Inherited_from
- \Contenido_FrontendNavigation_Base::$$iLang

\obj $oCategories- Type
- \obj
- Access
- protected
- Inherited_from
- \Contenido_FrontendNavigation_Base::$$oCategories

\obj $oDb- Type
- \obj
- Access
- protected
- Inherited_from
- \Contenido_FrontendNavigation_Base::$$oDb

\obj $oDbg- Type
- \obj
- Access
- protected
- Inherited_from
- \Contenido_FrontendNavigation_Base::$$oDbg

string $sDbgMode- Type
- string
- Access
- protected
- Inherited_from
- \Contenido_FrontendNavigation_Base::$$sDbgMode
Methods

__construct(\DB_Contenido $oDb, array $aCfg, int $iClient, int $iLang, $aCfgClient) : voidConstructor.
| Name | Type | Description |
|---|---|---|
| $oDb | \DB_Contenido | |
| $aCfg | array | |
| $iClient | int | |
| $iLang | int | |
| $aCfgClient |
- Access
- public
- Author
- Rudi Bieller

getLevel(int $iIdcat) : intGet Level of a given idcat.
If idcat wasn't loaded yet, level will be queried.
| Name | Type | Description |
|---|---|---|
| $iIdcat | int |
| Type | Description |
|---|---|
| int | Level of requested idcat. In case of an error, -1 is returned. |
- Access
- public

getSubCategories(int $iIdcat, boolean $bAsObjects = true, boolean $bWithSubCategories = false, int $iSubCategoriesLoadDepth = 3) : mixedLoad and return Subcategories of a given Category.
If you need Categories by FrontendPermission, you need to call method setAuth() before (!) calling loadSubCategories(). loadSubCategories() then automatically checks against FrontendPermission.
| Name | Type | Description |
|---|---|---|
| $iIdcat | int | |
| $bAsObjects | boolean | If set to true, will load Subcategories as objects, otherwise as Array. |
| $bWithSubCategories | boolean | Set to true to also load subcategories of loaded SubCategories |
| $iSubCategoriesLoadDepth | int | Up to shich level should SubCategories be loaded. Defaults to 3 for a 3-level Navigation. |
| Type | Description |
|---|---|
| mixed | Contenido_Categories or Array, depending on value for $bAsObjects |
- Access
- public
- Author
- Rudi Bieller

getUrl(array $aParams, string $sStyle = 'custom_path', array $aConfig = array(), boolean $bUseAbsolutePath = false) : voidGet a URL to a Navigation point.
Inherited from: \Contenido_FrontendNavigation_Base::getUrl()Depending on style of URL needed, values of $aParams differ.
| Name | Type | Description |
|---|---|---|
| $aParams | array | Parameters needed to build the URL |
| $sStyle | string | Available styles are: front_content, custom, custom_path |
| $aConfig | array | As default this is Contenido_UrlBuilderConfig::getConfig(), can be overridden by setting this value |
| $bUseAbsolutePath | boolean | If true, will use absolute http://www.xy.com/ as "prefix" |
| Exception | Description |
|---|---|
| \InvalidArgumentException |
- Access
- public
- See
- Contenido_UrlBuilder for details on needed params

isActiveChild(\Contenido_Category $oCategory, int $iCurrentIdcat) : booleanCheck if current idcat is an active child category of a given Contenido_Category
| Name | Type | Description |
|---|---|---|
| $oCategory | \Contenido_Category | |
| $iCurrentIdcat | int |
| Type | Description |
|---|---|
| boolean |
- Access
- public
- Author
- Rudi Bieller

isActiveParent(\Contenido_Category $oCategory, int $iCurrentIdcat) : booleanCheck if current idcat is an active parent category of a given Contenido_Category
| Name | Type | Description |
|---|---|---|
| $oCategory | \Contenido_Category | |
| $iCurrentIdcat | int |
| Type | Description |
|---|---|
| boolean |
- Access
- public
- Author
- Rudi Bieller

isInPathToRoot(int $iNeedleCat, int $iTreeHaystackCat) : booleanChecks if needle cat is in breadcrumb of haystack up to top level.
| Name | Type | Description |
|---|---|---|
| $iNeedleCat | int | |
| $iTreeHaystackCat | int |
| Type | Description |
|---|---|
| boolean |
- Access
- public

loadSubCategories(int $iIdcat, boolean $bAsObjects = true, boolean $bWithSubCategories = false, int $iSubCategoriesLoadDepth = 3) : booleanLoad Subcategories of a given Category-ID.
If you need Categories by FrontendPermission, you need to call method setAuth() before (!) calling loadSubCategories(). loadSubCategories() then automatically checks against FrontendPermission.
| Name | Type | Description |
|---|---|---|
| $iIdcat | int | |
| $bAsObjects | boolean | If set to true, will load Subcategories as objects, otherwise as Array. |
| $bWithSubCategories | boolean | Set to true to also load subcategories of loaded SubCategories |
| $iSubCategoriesLoadDepth | int | Up to shich level should SubCategories be loaded. Defaults to 3 for a 3-level Navigation. |
| Type | Description |
|---|---|
| boolean |
- Access
- protected
- Author
- Rudi Bieller

setAuth(\Auth $oAuth) : voidSet internal property for Auth object to load only those categories the FE-User has right to see.
Use this method if you have protected Categories and need to check agains FrontendUser Rights.
| Name | Type | Description |
|---|---|---|
| $oAuth | \Auth |
- Access
- public
- Author
- Rudi Bieller

setDebug(boolean $bDebug = true, string $sDebugMode = 'visible') : voidSet internal property for debugging on/off and choose appropriate debug object
Inherited from: \Contenido_FrontendNavigation_Base::setDebug()| Name | Type | Description |
|---|---|---|
| $bDebug | boolean | |
| $sDebugMode | string |
- Access
- public
- Author
- Rudi Bieller