Backend\Classes\NavigationManager\HasNavigationContext


Protected Properties

protected string $contextOwner

protected string $contextMainMenuItemCode

protected string $contextSideMenuItemCode

protected array $contextSidenavPartials


Public Methods

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