1 | <?php |
||
22 | class MenuArea extends MenuItem |
||
23 | { |
||
24 | /** @var callable $function function to call when area is selected. */ |
||
25 | protected $function; |
||
26 | |||
27 | /** @var string $icon File name of an icon to use on the menu, if using the sprite class, set as transparent.png */ |
||
28 | protected $icon = ''; |
||
29 | |||
30 | /** @var string $controller URL to use for this menu item. */ |
||
31 | protected $controller = ''; |
||
32 | |||
33 | /** @var string $select References another area to be highlighted while this one is active */ |
||
34 | public $select = ''; |
||
35 | |||
36 | /** @var string $class Class name to apply to the icon img, used to apply a sprite icon */ |
||
37 | protected $class = ''; |
||
38 | |||
39 | /** @var bool $enabled Should this area even be accessible? */ |
||
40 | protected $enabled = true; |
||
41 | |||
42 | /** @var bool $hidden Should this area be visible? */ |
||
43 | protected $hidden = false; |
||
44 | |||
45 | /** @var array $subsections Array of subsections from this area. */ |
||
46 | private $subsections = []; |
||
47 | |||
48 | /** |
||
49 | * @param array $arr |
||
50 | * |
||
51 | * @return MenuArea |
||
52 | */ |
||
53 | 41 | protected function buildMoreFromArray(array $arr): MenuArea |
|
69 | |||
70 | /** |
||
71 | * @param string $id |
||
72 | * @param MenuSubsection $subsection |
||
73 | * |
||
74 | * @return $this |
||
75 | */ |
||
76 | 41 | public function addSubsection(string $id, MenuSubsection $subsection): MenuArea |
|
82 | |||
83 | /** |
||
84 | * @return callable |
||
85 | */ |
||
86 | 1 | public function getFunction() |
|
90 | |||
91 | /** |
||
92 | * @param callable $function |
||
93 | * |
||
94 | * @return MenuArea |
||
95 | */ |
||
96 | 41 | public function setFunction($function): MenuArea |
|
102 | |||
103 | /** |
||
104 | * @return string |
||
105 | */ |
||
106 | 38 | public function getIcon(): string |
|
110 | |||
111 | /** |
||
112 | * @param string $icon |
||
113 | * |
||
114 | * @return MenuArea |
||
115 | */ |
||
116 | 41 | public function setIcon(string $icon): MenuArea |
|
122 | |||
123 | /** |
||
124 | * @return string |
||
125 | */ |
||
126 | 1 | public function getController(): string |
|
130 | |||
131 | /** |
||
132 | * @param string $controller |
||
133 | * |
||
134 | * @return MenuArea |
||
135 | */ |
||
136 | 41 | public function setController(string $controller): MenuArea |
|
142 | |||
143 | /** |
||
144 | * @return string |
||
145 | */ |
||
146 | 38 | public function getSelect(): string |
|
150 | |||
151 | /** |
||
152 | * @param string $select |
||
153 | * |
||
154 | * @return MenuArea |
||
155 | */ |
||
156 | 41 | public function setSelect(string $select): MenuArea |
|
162 | |||
163 | /** |
||
164 | * @return string |
||
165 | */ |
||
166 | 1 | public function getClass(): string |
|
170 | |||
171 | /** |
||
172 | * @param string $class |
||
173 | * |
||
174 | * @return MenuArea |
||
175 | */ |
||
176 | 41 | public function setClass(string $class): MenuArea |
|
182 | |||
183 | /** |
||
184 | * @return boolean |
||
185 | */ |
||
186 | 38 | public function isHidden(): bool |
|
190 | |||
191 | /** |
||
192 | * @param boolean $hidden |
||
193 | * |
||
194 | * @return MenuArea |
||
195 | */ |
||
196 | 41 | public function setHidden(bool $hidden): MenuArea |
|
202 | |||
203 | /** |
||
204 | * @return array |
||
205 | */ |
||
206 | 38 | public function toArray(): array |
|
210 | |||
211 | /** |
||
212 | * @return array |
||
213 | */ |
||
214 | 39 | public function getSubsections(): array |
|
218 | } |
||
219 |