1 | <?php |
||
14 | abstract class AbstractMenu { |
||
15 | |||
16 | /** @var string[] list of Item classes to load */ |
||
17 | protected $types = array(); |
||
18 | |||
19 | /** @var int the context this menu is used in */ |
||
20 | protected $context = AbstractItem::CTX_DESKTOP; |
||
21 | |||
22 | /** @var string view identifier to be set in the event */ |
||
23 | protected $view = ''; |
||
24 | |||
25 | /** |
||
26 | * AbstractMenu constructor. |
||
27 | * |
||
28 | * @param int $context the context this menu is used in |
||
29 | */ |
||
30 | public function __construct($context = AbstractItem::CTX_DESKTOP) { |
||
33 | |||
34 | /** |
||
35 | * Get the list of action items in this menu |
||
36 | * |
||
37 | * @return AbstractItem[] |
||
38 | * @triggers MENU_ITEMS_ASSEMBLY |
||
39 | */ |
||
40 | public function getItems() { |
||
48 | |||
49 | /** |
||
50 | * Default action for the MENU_ITEMS_ASSEMBLY event |
||
51 | * |
||
52 | * @see getItems() |
||
53 | * @param array $data The plugin data |
||
54 | */ |
||
55 | public function loadItems(&$data) { |
||
68 | |||
69 | /** |
||
70 | * Generate HTML list items for this menu |
||
71 | * |
||
72 | * This is a convenience method for template authors. If you need more fine control over the |
||
73 | * output, use getItems() and build the HTML yourself |
||
74 | * |
||
75 | * @param string|false $classprefix create a class from type with this prefix, false for no class |
||
76 | * @param bool $svg add the SVG link |
||
77 | * @return string |
||
78 | */ |
||
79 | public function getListItems($classprefix = '', $svg = true) { |
||
94 | |||
95 | } |
||
96 |