CoolCMS API

InitializationTrait

Table of Contents

Methods

initializeRender()  : void
visibleItems()  : array<int, MenuItem>
Items the visitor may see: active, for the login state, with a name in the current language.

Methods

initializeRender()

private initializeRender(int $menuId[, string|null $htmlId = null ][, bool $buttonOnLeft = false ][, string|null $label = null ]) : void
Parameters
$menuId : int
$htmlId : string|null = null
$buttonOnLeft : bool = false
$label : string|null = null

visibleItems()

Items the visitor may see: active, for the login state, with a name in the current language.

private visibleItems(array<int|string, MenuItem> $items, bool $loggedIn, int $languageId) : array<int, MenuItem>

IMPORTANT: the filters items.active and items.forLogged / items.forUnlogged in the query only pick the menu (a menu with at least one such item); the included collection items is loaded whole. An item hidden in the admin (the help page item with active = 0) was therefore still rendered. An item without a name in the current language rendered as an empty link (or an empty submenu block). The descendants of a dropped item are dropped with it (nested set: lft/rgt inside its interval), otherwise they would attach to an unrelated node of the tree.

Parameters
$items : array<int|string, MenuItem>
$loggedIn : bool
$languageId : int
Return values
array<int, MenuItem>
On this page

Search results