1 | <?php |
||
7 | abstract class AbstractMenu { |
||
8 | |||
9 | /** @var string[] list of Item classes to load */ |
||
10 | protected $types = array(); |
||
11 | |||
12 | /** @var int the context this menu is used in */ |
||
13 | protected $context = AbstractItem::CTX_DESKTOP; |
||
14 | |||
15 | /** @var string view identifier to be set in the event */ |
||
16 | protected $view = ''; |
||
17 | |||
18 | /** |
||
19 | * AbstractMenu constructor. |
||
20 | * |
||
21 | * @param int $context the context this menu is used in |
||
22 | */ |
||
23 | public function __construct($context = AbstractItem::CTX_DESKTOP) { |
||
26 | |||
27 | /** |
||
28 | * Get the list of action items in this menu |
||
29 | * |
||
30 | * @return AbstractItem[] |
||
31 | * @triggers MENU_ITEMS_ASSEMBLY |
||
32 | */ |
||
33 | public function getItems() { |
||
41 | |||
42 | /** |
||
43 | * Default action for the MENU_ITEMS_ASSEMBLY event |
||
44 | * |
||
45 | * @see getItems() |
||
46 | * @param array $data The plugin data |
||
47 | */ |
||
48 | public function loadItems(&$data) { |
||
61 | |||
62 | /** |
||
63 | * Generate HTML list items for this menu |
||
64 | * |
||
65 | * This is a convenience method for template authors. If you need more fine control over the |
||
66 | * output, use getItems() and build the HTML yourself |
||
67 | * |
||
68 | * @param string|false $classprefix create a class from type with this prefix, false for no class |
||
69 | * @return string |
||
70 | */ |
||
71 | public function getListItems($classprefix = '') { |
||
86 | |||
87 | } |
||
88 |