-
Backend
-
Behaviors
-
FormController
-
ImportExportController
-
ListController
-
RelationController
- FormController
- ImportExportController
- ListController
- RelationController
- ReorderController
- UserPreferencesModel
-
-
Classes
-
Dashboard
-
NavigationManager
-
WidgetManager
- AuthManager
- BackendController
- Controller
- ControllerBehavior
- DashboardManager
- DashboardWidgetBase
- FilterScope
- FilterWidgetBase
- FormField
- FormTabs
- FormWidgetBase
- ListColumn
- LoginCustomization
- MainMenuItem
- NavigationManager
- ReportDataSourceBase
- ReportDataSourceManager
- ReportWidgetBase
- RoleManager
- RolePermission
- SettingsController
- SideMenuItem
- Skin
- StaticReportWidgetContainer
- VueComponentBase
- WidgetBase
- WidgetManager
- WildcardController
-
-
Controllers
-
Database
-
Facades
-
FilterWidgets
-
FormWidgets
-
Helpers
-
Models
-
BrandSetting
-
ExportModel
-
ImportModel
- AccessLog
- BrandSetting
- Dashboard
- EditorSetting
- ExportModel
- ImportModel
- Preference
- ReportDataCache
- User
- UserGroup
- UserPreference
- UserPreferenceModel
- UserRole
- UserThrottle
-
-
ReportWidgets
-
Skins
-
Traits
-
VueComponents
-
Widgets
-
Filter
-
Form
-
Lists
-
Table
- Filter
- Form
- Lists
- ListStructure
- ReportContainer
- RoleImpersonator
- Search
- SiteSwitcher
- Table
- Toolbar
-
- ServiceProvider
-
-
Cms
-
Classes
-
Controller
-
EditorExtension
-
Layout
-
Page
-
Partial
-
Theme
- AjaxResponse
- Asset
- CmsCompoundObject
- CmsController
- CmsDemoTrafficDataGenerator
- CmsException
- CmsObject
- CmsObjectCache
- CmsObjectCollection
- CmsReportDataSource
- CmsStatusDataSource
- CodeBase
- CodeParser
- ComponentBase
- ComponentBehavior
- ComponentHelpers
- ComponentManager
- ComponentModuleBase
- ComponentPartial
- Content
- Controller
- EditorExtension
- Layout
- LayoutCode
- Meta
- Page
- PageCode
- PageManager
- Partial
- PartialCode
- PartialStack
- PartialWatcher
- Router
- Snippet
- SnippetManager
- Theme
- ThemeManager
- ThisVariable
- TrafficLogger
-
-
Components
-
Console
-
Controllers
-
Database
-
Facades
-
FormWidgets
-
Helpers
-
Models
-
ReportWidgets
-
Traits
-
Twig
- AjaxPartialTokenParser
- ComponentNode
- ComponentTokenParser
- ContentNode
- ContentTokenParser
- DebugExtension
- DefaultNode
- DefaultTokenParser
- Extension
- FlashNode
- FlashTokenParser
- FrameworkNode
- FrameworkTokenParser
- GetAttrAdjuster
- GetAttrNode
- Loader
- MetaNode
- MetaTokenParser
- PageNode
- PageTokenParser
- PartialNode
- PartialTokenParser
- PlaceholderNode
- PlaceholderTokenParser
- PutNode
- PutTokenParser
- ScriptsNode
- ScriptsTokenParser
- StylesNode
- StylesTokenParser
-
VueComponents
-
Widgets
- ServiceProvider
-
-
Editor
-
Behaviors
-
Classes
-
Controllers
-
Traits
-
VueComponents
- ServiceProvider
-
-
Media
-
Classes
-
Controllers
-
FormWidgets
-
Helpers
-
Twig
-
Widgets
- ServiceProvider
-
-
System
-
Behaviors
-
Classes
-
PresetManager
-
SiteManager
-
UiManager
-
UpdateManager
- AppBase
- CombineAssets
- DependencyResolver
- DriverBehavior
- ErrorHandler
- MailManager
- ManifestCache
- MarkupExtensionItem
- MarkupManager
- ModelBehavior
- PagerElement
- PluginBase
- PluginManager
- PresetManager
- ProductDetail
- RateLimiter
- ResizeImageItem
- ResizeImages
- SettingsManager
- SettingsMenuItem
- SiteManager
- SystemController
- SystemReportDataSource
- UiElement
- UiManager
- UpdateManager
- VersionManager
-
-
Console
- ComposerScript
- OctoberAbout
- OctoberDown
- OctoberFresh
- OctoberMigrate
- OctoberMirror
- OctoberOptimize
- OctoberPasswd
- OctoberUp
- OctoberUpdate
- OctoberUtil
- OctoberUtilCommands
- OctoberUtilPatches
- OctoberUtilRefitLang
- PluginCheck
- PluginDisable
- PluginEnable
- PluginInstall
- PluginList
- PluginRefresh
- PluginRemove
- PluginSeed
- PluginTest
- ProjectSync
-
Controllers
-
Database
-
Facades
-
Helpers
-
Middleware
-
Models
-
ReportWidgets
-
Traits
-
Twig
-
Widgets
- ServiceProvider
-
-
Tailor
-
Behaviors
-
Classes
-
Blueprint
-
BlueprintIndexer
-
EditorExtension
-
Relations
-
SchemaBuilder
-
Scopes
- Blueprint
- BlueprintCollection
- BlueprintErrorData
- BlueprintException
- BlueprintIndexer
- BlueprintModel
- BlueprintVerifier
- ComponentVariable
- ContentFieldBase
- EditorExtension
- FieldManager
- Fieldset
- NavigationItem
- PermissionItem
- RecordIndexer
- SchemaBuilder
- SchemaPruner
-
-
Components
-
Console
-
ContentFields
-
Controllers
-
Models
-
EntryRecord
-
GlobalRecord
-
RecordImport
- ContentSchema
- EntryRecord
- GlobalRecord
- NestedFormItem
- PreviewToken
- RecordExport
- RecordImport
- RepeaterItem
-
-
Traits
-
VueComponents
- ServiceProvider
-
-
Events
-
backend
-
ajax
-
brand
-
files
-
filter
-
form
-
list
-
menu
-
page
-
roles
-
site
-
user
-
-
cms
-
ajax
-
block
-
combiner
-
component
-
internalTrafficStatistics
-
object
-
page
-
pageLookup
-
resizer
-
router
-
sitePicker
-
template
-
theme
- extendTwig
-
-
deferredBinding
-
editor
-
extension
-
-
exception
-
halcyon
-
datasource
-
-
mailer
-
media
-
model
-
auth
-
filter
-
form
-
relation
-
/docs/api/model/relation/add
-
/docs/api/model/relation/associate
- attach
-
/docs/api/model/relation/beforeadd
-
/docs/api/model/relation/beforeassociate
- beforeAttach
- beforeDetach
-
/docs/api/model/relation/beforedissociate
-
/docs/api/model/relation/beforeremove
- detach
-
/docs/api/model/relation/dissociate
-
/docs/api/model/relation/remove
-
-
/docs/api/model/afterboot
-
/docs/api/model/aftercreate
-
/docs/api/model/afterdelete
-
/docs/api/model/afterfetch
-
/docs/api/model/afterinit
- afterRelation
- afterRestore
-
/docs/api/model/aftersave
- afterTrash
-
/docs/api/model/afterupdate
- afterValidate
-
/docs/api/model/beforecreate
-
/docs/api/model/beforedelete
-
/docs/api/model/beforefetch
- beforeGetAttribute
- beforeRelation
- beforeReplicate
- beforeRestore
-
/docs/api/model/beforesave
- beforeSetAttribute
-
/docs/api/model/beforeupdate
- beforeValidate
- extendBlueprint
- getAttribute
- newInstance
- saveInternal
- setAttribute
-
-
pages
-
snippet
-
-
site
-
system
-
assets
- beforeAddAsset
-
/docs/api/system/assets/beforebundleasset
-
console
-
mirror
-
-
mail
-
reportwidgets
-
resizer
-
settings
-
site
-
updater
- extendConfigFile
- extendTwig
-
-
tailor
-
user
-
-
Library
-
Argon
-
Assetic
-
Asset
-
Cache
-
Exception
-
Factory
-
Filter
-
Traits
-
Util
- README
- AsseticServiceProvider
- AssetManager
- AssetWriter
- Combiner
- FilterManager
-
-
Auth
-
Combine
-
Composer
-
Config
-
Database
-
Attach
-
Concerns
-
Connections
-
Connectors
-
Factories
-
Models
-
Relations
-
Schema
-
Scopes
-
Traits
-
Updates
- README
- Builder
- Collection
- DatabaseServiceProvider
- Dongle
- ExpandoModel
- MigrationServiceProvider
- Model
- ModelBehavior
- ModelException
- MorphPivot
- NestedTreeScope
- Pivot
- QueryBuilder
- Replicator
- SortableScope
- TreeCollection
- Updater
-
-
Element
-
Filter
-
Form
-
Lists
-
Navigation
- ElementBase
- ElementHolder
-
-
Events
-
Exception
-
Extension
-
Filesystem
-
Flash
-
Foundation
-
Bootstrap
-
Console
-
Exception
-
Http
-
Middleware
- Kernel
-
-
Providers
- Application
-
-
Halcyon
-
Concerns
-
Datasource
-
Exception
-
Processors
-
Traits
- README
- Builder
- Collection
- HalcyonServiceProvider
- Model
-
-
Html
-
Mail
-
Network
-
Parse
-
Resize
-
Router
-
Scaffold
-
Support
-
Debug
-
Facades
-
Traits
- README
- Arr
- ClassLoader
- Collection
- Facade
- ModuleServiceProvider
- SafeCollection
- ServiceProvider
- Singleton
- Str
-
-
Translation
-
Validation
-
- Documentation
- API
- Backend
- Classes
- NavigationManager
Backend\Classes\NavigationManager
Overview
NavigationManager manages the backend navigation.
Protected Properties
protected [[MainMenuItem[]|null]] $items
items contains a list of registered items.
protected array|null $menuDisplayTree
protected string $contextOwner
protected string $contextMainMenuItemCode
protected string $contextSideMenuItemCode
protected array $contextSidenavPartials
Public Methods
public addMainMenuItem()
public addMainMenuItem( string $owner, string $code, array $definition ): void
addMainMenuItem dynamically adds a single main menu item.
public addMainMenuItems()
public addMainMenuItems(string $owner, array $definitions): void
addMainMenuItems dynamically adds an array of main menu items.
public addSideMenuItem()
public addSideMenuItem( string $owner, string $code, string $sideCode, array $definition ): bool
addSideMenuItem dynamically add a single side menu item
public addSideMenuItems()
public addSideMenuItems( string $owner, string $code, array $definitions ): void
addSideMenuItems dynamically adds an array of side menu items
public getActiveMainMenuItem()
public getActiveMainMenuItem(): null|MainMenuItem
getActiveMainMenuItem returns the currently active main menu item
public getContext()
public getContext(): mixed
getContext returns information about the current navigation context.
public getContextSidenavPartial()
public getContextSidenavPartial( string $owner, string $mainMenuItemCode ): mixed
getContextSidenavPartial returns the side navigation partial for a specific main menu previously registered with the registerContextSidenavPartial() method.
public getMainMenuItem()
public getMainMenuItem($owner, $code): Backend\Classes\MainMenuItem|null
getMainMenuItem returns a main menu item
public getSideMenuItem()
public getSideMenuItem( $owner, $code, $sideCode ): Backend\Classes\SideMenuItem|null
getSideMenuItem returns a side menu item
public init()
public init(): void
init this class items
public static instance()
public static instance(): static
instance creates a new instance of this singleton
public isDashboardItemActive()
public isDashboardItemActive(): bool
isDashboardItemActive determines if the dashboard is active.
public isMainMenuItemActive()
public isMainMenuItemActive(MainMenuItem $item): boolean
isMainMenuItemActive determines if a main menu item is active.
public isSideMenuItemActive()
public isSideMenuItemActive(SideMenuItem $item): boolean
isSideMenuItemActive determines if a side menu item is active.
public listMainMenuItems()
public listMainMenuItems(): array
listMainMenuItems returns a list of the main menu items.
public listMainMenuItemsWithSubitems()
public listMainMenuItemsWithSubitems(): void
listMainMenuItemsWithSubitems prepares data for displaying the top menu and side (collapsable) menu. Uses caching to avoid running counter functions twice.
public listMainMenuSubItems()
public listMainMenuSubItems(): void
listMainMenuSubItems uses cached result of listMainMenuItemsWithSubitems to return submenu items and avoid duplicate counter calls.
public listSideMenuItems()
public listSideMenuItems( null $owner = null, null $code = null ): SideMenuItem[]
listSideMenuItems returns a list of side menu items for the currently active main menu item. The currently active main menu item is set with the setContext methods.
public registerCallback()
public registerCallback(callable $callback): void
registerCallback function that defines menu items.
The callback function should register menu items by calling the manager's
registerMenuItems
method. The manager instance is passed to the callback
function as an argument. Usage:
BackendMenu::registerCallback(function ($manager) { $manager->registerMenuItems([...]); });
public registerContextSidenavPartial()
public registerContextSidenavPartial( string $owner, string $mainMenuItemCode, string $partial ): void
registerContextSidenavPartial registers a special side navigation partial for a specific main menu. The sidenav partial replaces the standard side navigation.
public registerMenuItems()
public registerMenuItems(string $owner, array $definitions): void
registerMenuItems for the back-end menu items. The argument is an array of the main menu items. The array keys represent the menu item codes, specific for the plugin/module. Each element in the array should be an associative array with the following keys:
- label - specifies the menu label localization string key, required.
- icon - an icon name from the Font Awesome icon collection, required.
- url - the back-end relative URL the menu item should point to, required.
- permissions - an array of permissions the back-end user should have, optional. The item will be displayed if the user has any of the specified permissions.
- order - a position of the item in the menu, optional.
- counter - an optional numeric value to output near the menu icon. The value should be a number or a callable returning a number.
- counterLabel - an optional string value to describe the numeric reference in counter.
- sideMenu - an array of side menu items, optional. If provided, the array items
should represent the side menu item code, and each value should be an associative
array with the following keys:
- label - specifies the menu label localization string key, required.
- icon - an icon name from the Font Awesome icon collection, required.
- url - the back-end relative URL the menu item should point to, required.
- attributes - an array of attributes and values to apply to the menu item, optional.
- permissions - an array of permissions the back-end user should have, optional.
- counter - an optional numeric value to output near the menu icon. The value should be a number or a callable returning a number.
- counterLabel - an optional string value to describe the numeric reference in counter.
public removeMainMenuItem()
public removeMainMenuItem($owner $owner, $code $code): void
removeMainMenuItem removes a single main menu item
public removeSideMenuItem()
public removeSideMenuItem( string $owner, string $code, string $sideCode ): bool
removeSideMenuItem removes a single main menu item
public removeSideMenuItems()
public removeSideMenuItems( string $owner, string $code, array $sideCodes ): void
removeSideMenuItems with multiple codes
public resetCache()
public resetCache(): void
resetCache resets any memory or cache involved with the sites
public setContext()
public setContext( string $owner, string $mainMenuItemCode, string $sideMenuItemCode = null ): void
setContext sets the navigation context. The function sets the navigation owner, main menu item code and the side menu item code.
public setContextMainMenu()
public setContextMainMenu(string $mainMenuItemCode): void
setContextMainMenu specifies a code of the main menu item in the current navigation context.
public setContextOwner()
public setContextOwner(string $owner): void
setContextOwner sets the navigation context owner. The function sets the navigation owner.
public setContextSideMenu()
public setContextSideMenu(string $sideMenuItemCode): void
setContextSideMenu specifies a code of the side menu item in the current navigation context. If the code is set to TRUE, the first item will be flagged as active.
Protected Methods
protected defineMainMenuItem()
protected defineMainMenuItem($config): Backend\Classes\MainMenuItem
protected defineSideMenuItem()
protected defineSideMenuItem($config): Backend\Classes\SideMenuItem
protected filterItemPermissions()
protected filterItemPermissions( Backend\Models\User $user, array $items ): array
filterItemPermissions removes menu items from an array if the supplied user lacks permission.
protected getCallableCounterValue()
protected getCallableCounterValue($item): void
getCallableCounterValue returns the counter value for a menu item
protected loadItems()
protected loadItems(): void
loadItems from modules and plugins
protected makeItemKey()
protected makeItemKey(string $owner, string $code): string
makeItemKey is an internal method to make a unique key for an item.