PHP Класс Piwik\Menu\MenuAbstract

There are three menus in Piwik, the main menu, the top menu and the admin menu. Each menu has a class that manages the menu's content. Each class invokes a different event to allow plugins to add new menu items.
Наследование: extends Piwik\Singleton
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$edits
$menu
$menuEntries
$menuEntriesToRemove
$menuIcons
$menus
$orderingApplied
$renames

Открытые методы

Метод Описание
addItem ( string $menuName, string $subMenuName, string | array $url, integer $order = 50, boolean | string $tooltip = false ) Adds a new entry to the menu.
clearMenus ( ) To use only for tests.
editUrl ( $mainMenuToEdit, $subMenuToEdit, $newUrl ) Edits a URL of an existing menu entry.
getMenu ( ) : Array Builds the menu, applies edits, renames and orders the entries.
registerMenuIcon ( string $menuName, string $iconCssClass ) lets you register a menu icon for a certain menu category to replace the default arrow icon.
remove ( string $menuName, boolean | string $subMenuName = false ) Removes an existing entry from the menu.
rename ( $mainMenuOriginal, $subMenuOriginal, $mainMenuRenamed, $subMenuRenamed ) Renames a single menu entry.

Защищенные методы

Метод Описание
getAllMenus ( ) : Menu[] Returns a list of available plugin menu instances.
menuCompare ( array $itemOne, array $itemTwo ) : boolean Compares two menu entries. Used for ordering.

Приватные методы

Метод Описание
applyEdits ( ) Applies all edits to the menu.
applyOrdering ( ) Orders the menu according to their order.
applyRemoves ( )
applyRenames ( ) Applies renames to the menu.
buildMenu ( ) Builds the menu from the $this->menuEntries variable.
buildMenuItem ( string $menuName, string $subMenuName, string $url, integer $order = 50, boolean | string $tooltip = false ) Builds a single menu item

Описание методов

addItem() публичный Метод

Adds a new entry to the menu.
С версии: 2.7.0
public addItem ( string $menuName, string $subMenuName, string | array $url, integer $order = 50, boolean | string $tooltip = false )
$menuName string The menu's category name. Can be a translation token.
$subMenuName string The menu item's name. Can be a translation token.
$url string | array The URL the admin menu entry should link to, or an array of query parameters that can be used to build the URL.
$order integer The order hint.
$tooltip boolean | string An optional tooltip to display or false to display the tooltip.

clearMenus() публичный статический Метод

To use only for tests.
Устаревший: The whole $menus cache should be replaced by a real transient cache
public static clearMenus ( )

editUrl() публичный Метод

Edits a URL of an existing menu entry.
public editUrl ( $mainMenuToEdit, $subMenuToEdit, $newUrl )
$mainMenuToEdit
$subMenuToEdit
$newUrl

getAllMenus() защищенный Метод

Returns a list of available plugin menu instances.
protected getAllMenus ( ) : Menu[]
Результат Piwik\Plugin\Menu[]

getMenu() публичный Метод

Builds the menu, applies edits, renames and orders the entries.
public getMenu ( ) : Array
Результат Array

menuCompare() защищенный Метод

Compares two menu entries. Used for ordering.
protected menuCompare ( array $itemOne, array $itemTwo ) : boolean
$itemOne array
$itemTwo array
Результат boolean

registerMenuIcon() публичный Метод

lets you register a menu icon for a certain menu category to replace the default arrow icon.
public registerMenuIcon ( string $menuName, string $iconCssClass )
$menuName string The translation key of a main menu category, eg 'Dashboard_Dashboard'
$iconCssClass string The css class name of an icon, eg 'icon-user'

remove() публичный Метод

Removes an existing entry from the menu.
public remove ( string $menuName, boolean | string $subMenuName = false )
$menuName string The menu's category name. Can be a translation token.
$subMenuName boolean | string The menu item's name. Can be a translation token.

rename() публичный Метод

Renames a single menu entry.
public rename ( $mainMenuOriginal, $subMenuOriginal, $mainMenuRenamed, $subMenuRenamed )
$mainMenuOriginal
$subMenuOriginal
$mainMenuRenamed
$subMenuRenamed

Описание свойств

$edits защищенное свойство

protected $edits

$menu защищенное свойство

protected $menu

$menuEntries защищенное свойство

protected $menuEntries

$menuEntriesToRemove защищенное свойство

protected $menuEntriesToRemove

$menuIcons защищенное свойство

protected $menuIcons

$menus защищенное статическое свойство

protected static $menus

$orderingApplied защищенное свойство

protected $orderingApplied

$renames защищенное свойство

protected $renames