contenido\classes\Contenido_FrontendNavigation\Contenido_FrontendNavigation.class.php

Show: PublicProtectedPrivateinherited
Table of Contents
Project: Contenido Content Management System

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

Package: Default
Parent(s)
\Contenido_FrontendNavigation_Base

Properties

>VPropertyprotectedarray $aCategories
Details
Type
array
Access
protected  
Inherited_from
\Contenido_FrontendNavigation_Base::$$aCategories  
>VPropertyprotectedarray $aCfg
Details
Type
array
Access
protected  
Inherited_from
\Contenido_FrontendNavigation_Base::$$aCfg  
>VPropertyprotectedarray $aCfgClient
Details
Type
array
Access
protected  
Inherited_from
\Contenido_FrontendNavigation_Base::$$aCfgClient  
>VPropertyprotectedarray $aLevel
Details
Type
array
Access
protected  
>VPropertyprotectedboolean $bDbg
Details
Type
boolean
Access
protected  
Inherited_from
\Contenido_FrontendNavigation_Base::$$bDbg  
>VPropertyprotected$iClient
Details
Type
n/a
Inherited_from
\Contenido_FrontendNavigation_Base::$$iClient  
>VPropertyprotected$iLang
Details
Type
n/a
Inherited_from
\Contenido_FrontendNavigation_Base::$$iLang  
>VPropertyprotectedint $iRootCat
Details
Type
int
Access
protected  
>VPropertyprotected\obj $oAuth
Details
Type
\obj
Access
protected  
>VPropertyprotected\obj $oCategories
Details
Type
\obj
Access
protected  
Inherited_from
\Contenido_FrontendNavigation_Base::$$oCategories  
>VPropertyprotected\obj $oDb
Details
Type
\obj
Access
protected  
Inherited_from
\Contenido_FrontendNavigation_Base::$$oDb  
>VPropertyprotected\obj $oDbg
Details
Type
\obj
Access
protected  
Inherited_from
\Contenido_FrontendNavigation_Base::$$oDbg  
>VPropertyprotectedstring $sDbgMode
Details
Type
string
Access
protected  
Inherited_from
\Contenido_FrontendNavigation_Base::$$sDbgMode  

Methods

methodpublic__construct(\DB_Contenido $oDb, array $aCfg, int $iClient, int $iLang,  $aCfgClient) : void

Constructor.

Parameters
NameTypeDescription
$oDb\DB_Contenido
$aCfgarray
$iClientint
$iLangint
$aCfgClient
Details
Access
public  
Author
Rudi Bieller  
methodpublicgetLevel(int $iIdcat) : int

Get Level of a given idcat.

If idcat wasn't loaded yet, level will be queried.

Parameters
NameTypeDescription
$iIdcatint
Returns
TypeDescription
intLevel of requested idcat. In case of an error, -1 is returned.
Details
Access
public  
methodpublicgetRootCat() : void

methodpublicgetSubCategories(int $iIdcat, boolean $bAsObjects = true, boolean $bWithSubCategories = false, int $iSubCategoriesLoadDepth = 3) : mixed

Load 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.

Parameters
NameTypeDescription
$iIdcatint
$bAsObjectsboolean

If set to true, will load Subcategories as objects, otherwise as Array.

$bWithSubCategoriesboolean

Set to true to also load subcategories of loaded SubCategories

$iSubCategoriesLoadDepthint

Up to shich level should SubCategories be loaded. Defaults to 3 for a 3-level Navigation.

Returns
TypeDescription
mixedContenido_Categories or Array, depending on value for $bAsObjects
Details
Access
public  
Author
Rudi Bieller  
methodpublicgetUrl(array $aParams, string $sStyle = 'custom_path', array $aConfig = array(), boolean $bUseAbsolutePath = false) : void
inherited

Get a URL to a Navigation point.

Inherited from: \Contenido_FrontendNavigation_Base::getUrl()

Depending on style of URL needed, values of $aParams differ.

Parameters
NameTypeDescription
$aParamsarray

Parameters needed to build the URL

$sStylestring

Available styles are: front_content, custom, custom_path

$aConfigarray

As default this is Contenido_UrlBuilderConfig::getConfig(), can be overridden by setting this value

$bUseAbsolutePathboolean

If true, will use absolute http://www.xy.com/ as "prefix"

Throws
ExceptionDescription
\InvalidArgumentException
Details
Access
public  
See
Contenido_UrlBuilder for details on needed params  
methodpublicisActiveChild(\Contenido_Category $oCategory, int $iCurrentIdcat) : boolean

Check if current idcat is an active child category of a given Contenido_Category

Parameters
NameTypeDescription
$oCategory\Contenido_Category
$iCurrentIdcatint
Returns
TypeDescription
boolean
Details
Access
public  
Author
Rudi Bieller  
methodpublicisActiveParent(\Contenido_Category $oCategory, int $iCurrentIdcat) : boolean

Check if current idcat is an active parent category of a given Contenido_Category

Parameters
NameTypeDescription
$oCategory\Contenido_Category
$iCurrentIdcatint
Returns
TypeDescription
boolean
Details
Access
public  
Author
Rudi Bieller  
methodpublicisInPathToRoot(int $iNeedleCat, int $iTreeHaystackCat) : boolean

Checks if needle cat is in breadcrumb of haystack up to top level.

Parameters
NameTypeDescription
$iNeedleCatint
$iTreeHaystackCatint
Returns
TypeDescription
boolean
Details
Access
public  
methodprotectedloadSubCategories(int $iIdcat, boolean $bAsObjects = true, boolean $bWithSubCategories = false, int $iSubCategoriesLoadDepth = 3) : boolean

Load 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.

Parameters
NameTypeDescription
$iIdcatint
$bAsObjectsboolean

If set to true, will load Subcategories as objects, otherwise as Array.

$bWithSubCategoriesboolean

Set to true to also load subcategories of loaded SubCategories

$iSubCategoriesLoadDepthint

Up to shich level should SubCategories be loaded. Defaults to 3 for a 3-level Navigation.

Returns
TypeDescription
boolean
Details
Access
protected  
Author
Rudi Bieller  
methodpublicsetAuth(\Auth $oAuth) : void

Set 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.

Parameters
NameTypeDescription
$oAuth\Auth
Details
Access
public  
Author
Rudi Bieller  
methodpublicsetDebug(boolean $bDebug = true, string $sDebugMode = 'visible') : void
inherited

Set internal property for debugging on/off and choose appropriate debug object

Inherited from: \Contenido_FrontendNavigation_Base::setDebug()
Parameters
NameTypeDescription
$bDebugboolean
$sDebugModestring
Details
Access
public  
Author
Rudi Bieller  
methodpublicsetRootCat( $iIdcat) : void

Parameters
NameTypeDescription
$iIdcat
Documentation was generated by phpDocumentor 2.0.0a12.