1 | <?php |
||
25 | class MenuOptions |
||
26 | { |
||
27 | /** @var string $action => overrides the default action */ |
||
28 | private $action=''; |
||
|
|||
29 | |||
30 | /** @var string $current_area => overrides the current area */ |
||
31 | private $current_area=''; |
||
32 | |||
33 | /** @var array $extra_url_parameters => an array or pairs or parameters to be added to the url */ |
||
34 | private $extra_url_parameters=[]; |
||
35 | |||
36 | /** @var boolean $disable_url_session_check => (boolean) if true the session var/id are omitted from the url */ |
||
37 | private $disable_url_session_check=false; |
||
38 | |||
39 | /** @var string $base_url => an alternative base url */ |
||
40 | private $base_url=''; |
||
41 | |||
42 | /** @var string $menu_type => alternative menu types? */ |
||
43 | private $menu_type=''; |
||
44 | |||
45 | /** @var boolean $can_toggle_drop_down => (boolean) if the menu can "toggle" */ |
||
46 | private $can_toggle_drop_down=true; |
||
47 | |||
48 | /** @var string $template_name => an alternative template to load (instead of Generic) */ |
||
49 | private $template_name='GenericMenu'; |
||
50 | |||
51 | /** @var string $layer_name => alternative layer name for the menu */ |
||
52 | private $layer_name='generic_menu'; |
||
53 | |||
54 | /** @var array $hook => hook name to call integrate_ . 'hook name' . '_areas' */ |
||
55 | private $counters=[]; |
||
56 | |||
57 | /** |
||
58 | * @return string |
||
59 | */ |
||
60 | 41 | public function getAction(): string |
|
64 | |||
65 | /** |
||
66 | * @param string $action |
||
67 | */ |
||
68 | 41 | public function setAction(string $action) |
|
72 | |||
73 | /** |
||
74 | * @return string |
||
75 | */ |
||
76 | 39 | public function getCurrentArea(): string |
|
80 | |||
81 | /** |
||
82 | * @param string $current_area |
||
83 | */ |
||
84 | 41 | public function setCurrentArea(string $current_area) |
|
88 | |||
89 | /** |
||
90 | * @return array |
||
91 | */ |
||
92 | 39 | public function getExtraUrlParameters(): array |
|
96 | |||
97 | /** |
||
98 | * @param array $extra_url_parameters |
||
99 | */ |
||
100 | 41 | public function setExtraUrlParameters(array $extra_url_parameters) |
|
104 | |||
105 | /** |
||
106 | * @return bool |
||
107 | */ |
||
108 | public function isUrlSessionCheckDisabled(): bool |
||
112 | |||
113 | /** |
||
114 | * @param bool $disable_url_session_check |
||
115 | */ |
||
116 | 41 | public function setDisableUrlSessionCheck(bool $disable_url_session_check) |
|
120 | |||
121 | /** |
||
122 | * @return string |
||
123 | */ |
||
124 | 41 | public function getBaseUrl(): string |
|
128 | |||
129 | /** |
||
130 | * @param string $base_url |
||
131 | */ |
||
132 | 41 | public function setBaseUrl(string $base_url) |
|
136 | |||
137 | /** |
||
138 | * @return string |
||
139 | */ |
||
140 | 41 | public function getMenuType(): string |
|
144 | |||
145 | /** |
||
146 | * @param string $menu_type |
||
147 | */ |
||
148 | 41 | public function setMenuType(string $menu_type) |
|
152 | |||
153 | /** |
||
154 | * @return bool |
||
155 | */ |
||
156 | 41 | public function isDropDownToggleable(): bool |
|
160 | |||
161 | /** |
||
162 | * @param bool $can_toggle_drop_down |
||
163 | */ |
||
164 | 41 | public function setCanToggleDropDown(bool $can_toggle_drop_down) |
|
168 | |||
169 | /** |
||
170 | * @return string |
||
171 | */ |
||
172 | 38 | public function getTemplateName(): string |
|
176 | |||
177 | /** |
||
178 | * @param string $template_name |
||
179 | */ |
||
180 | 41 | public function setTemplateName(string $template_name) |
|
184 | |||
185 | /** |
||
186 | * @return string |
||
187 | */ |
||
188 | 41 | public function getLayerName(): string |
|
192 | |||
193 | /** |
||
194 | * @param string $layer_name |
||
195 | */ |
||
196 | 41 | public function setLayerName(string $layer_name) |
|
200 | |||
201 | /** |
||
202 | * @return array |
||
203 | */ |
||
204 | 38 | public function getCounters(): array |
|
208 | |||
209 | /** |
||
210 | * @param array $counters |
||
211 | */ |
||
212 | 41 | public function setCounters(array $counters) |
|
216 | |||
217 | /** |
||
218 | * @param array $arr |
||
219 | * |
||
220 | * @return MenuOptions |
||
221 | */ |
||
222 | 41 | public static function buildFromArray(array $arr): MenuOptions |
|
236 | |||
237 | /** |
||
238 | * The theme needs some love, too. |
||
239 | */ |
||
240 | 41 | private function buildTemplateVars(): void |
|
252 | |||
253 | /** |
||
254 | * Process the array of MenuOptions passed to the class |
||
255 | */ |
||
256 | 41 | protected function buildBaseUrl(): void |
|
268 | |||
269 | /** |
||
270 | * Build the additional parameters for use in the url |
||
271 | */ |
||
272 | 39 | public function buildAdditionalParams(): string |
|
296 | } |
||
297 |
This check looks for improperly formatted assignments.
Every assignment must have exactly one space before and one space after the equals operator.
To illustrate:
will have no issues, while
will report issues in lines 1 and 2.