|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/* |
|
4
|
|
|
* This file is part of the TYPO3 CMS project. |
|
5
|
|
|
* |
|
6
|
|
|
* It is free software; you can redistribute it and/or modify it under |
|
7
|
|
|
* the terms of the GNU General Public License, either version 2 |
|
8
|
|
|
* of the License, or any later version. |
|
9
|
|
|
* |
|
10
|
|
|
* For the full copyright and license information, please read the |
|
11
|
|
|
* LICENSE.txt file that was distributed with this source code. |
|
12
|
|
|
* |
|
13
|
|
|
* The TYPO3 project - inspiring people to share! |
|
14
|
|
|
*/ |
|
15
|
|
|
|
|
16
|
|
|
namespace TYPO3\CMS\Backend\Domain\Model\Module; |
|
17
|
|
|
|
|
18
|
|
|
/** |
|
19
|
|
|
* Model for menu entries |
|
20
|
|
|
*/ |
|
21
|
|
|
class BackendModule |
|
22
|
|
|
{ |
|
23
|
|
|
/** |
|
24
|
|
|
* @var string |
|
25
|
|
|
*/ |
|
26
|
|
|
protected $title = ''; |
|
27
|
|
|
|
|
28
|
|
|
/** |
|
29
|
|
|
* @var string |
|
30
|
|
|
*/ |
|
31
|
|
|
protected $name = ''; |
|
32
|
|
|
|
|
33
|
|
|
/** |
|
34
|
|
|
* @var string |
|
35
|
|
|
*/ |
|
36
|
|
|
protected $icon = ''; |
|
37
|
|
|
|
|
38
|
|
|
/** |
|
39
|
|
|
* @var string |
|
40
|
|
|
*/ |
|
41
|
|
|
protected $link = ''; |
|
42
|
|
|
|
|
43
|
|
|
/** |
|
44
|
|
|
* @var string |
|
45
|
|
|
*/ |
|
46
|
|
|
protected $component = ''; |
|
47
|
|
|
|
|
48
|
|
|
/** |
|
49
|
|
|
* @var string |
|
50
|
|
|
*/ |
|
51
|
|
|
protected $onClick = ''; |
|
52
|
|
|
|
|
53
|
|
|
/** |
|
54
|
|
|
* @var string |
|
55
|
|
|
*/ |
|
56
|
|
|
protected $description = ''; |
|
57
|
|
|
|
|
58
|
|
|
/** |
|
59
|
|
|
* @var string |
|
60
|
|
|
*/ |
|
61
|
|
|
protected $navigationComponentId = ''; |
|
62
|
|
|
|
|
63
|
|
|
/** |
|
64
|
|
|
* @var string |
|
65
|
|
|
*/ |
|
66
|
|
|
protected $navigationFrameScript = ''; |
|
67
|
|
|
|
|
68
|
|
|
/** |
|
69
|
|
|
* @var string |
|
70
|
|
|
*/ |
|
71
|
|
|
protected $navigationFrameScriptParameters = ''; |
|
72
|
|
|
|
|
73
|
|
|
/** |
|
74
|
|
|
* @var \SplObjectStorage |
|
75
|
|
|
*/ |
|
76
|
|
|
protected $children; |
|
77
|
|
|
|
|
78
|
|
|
/** |
|
79
|
|
|
* @var bool |
|
80
|
|
|
*/ |
|
81
|
|
|
protected $collapsed = false; |
|
82
|
|
|
|
|
83
|
|
|
/** |
|
84
|
|
|
* Standalone modules are top-level modules without a group |
|
85
|
|
|
* |
|
86
|
|
|
* @var bool |
|
87
|
|
|
*/ |
|
88
|
|
|
protected $standalone = false; |
|
89
|
|
|
|
|
90
|
|
|
/** |
|
91
|
|
|
* construct |
|
92
|
|
|
*/ |
|
93
|
|
|
public function __construct() |
|
94
|
|
|
{ |
|
95
|
|
|
$this->children = new \SplObjectStorage(); |
|
96
|
|
|
} |
|
97
|
|
|
|
|
98
|
|
|
/** |
|
99
|
|
|
* Set children |
|
100
|
|
|
* |
|
101
|
|
|
* @param \SplObjectStorage $children |
|
102
|
|
|
*/ |
|
103
|
|
|
public function setChildren($children) |
|
104
|
|
|
{ |
|
105
|
|
|
$this->children = $children; |
|
106
|
|
|
} |
|
107
|
|
|
|
|
108
|
|
|
/** |
|
109
|
|
|
* Get children |
|
110
|
|
|
* |
|
111
|
|
|
* @return \SplObjectStorage |
|
112
|
|
|
*/ |
|
113
|
|
|
public function getChildren() |
|
114
|
|
|
{ |
|
115
|
|
|
return $this->children; |
|
116
|
|
|
} |
|
117
|
|
|
|
|
118
|
|
|
/** |
|
119
|
|
|
* Add Child |
|
120
|
|
|
* |
|
121
|
|
|
* @param \TYPO3\CMS\Backend\Domain\Model\Module\BackendModule $child |
|
122
|
|
|
*/ |
|
123
|
|
|
public function addChild(\TYPO3\CMS\Backend\Domain\Model\Module\BackendModule $child) |
|
124
|
|
|
{ |
|
125
|
|
|
$this->children->attach($child); |
|
126
|
|
|
} |
|
127
|
|
|
|
|
128
|
|
|
/** |
|
129
|
|
|
* Set icon |
|
130
|
|
|
* |
|
131
|
|
|
* @param string $icon |
|
132
|
|
|
*/ |
|
133
|
|
|
public function setIcon($icon) |
|
134
|
|
|
{ |
|
135
|
|
|
$this->icon = $icon; |
|
136
|
|
|
} |
|
137
|
|
|
|
|
138
|
|
|
/** |
|
139
|
|
|
* Get icon |
|
140
|
|
|
* |
|
141
|
|
|
* @return string |
|
142
|
|
|
*/ |
|
143
|
|
|
public function getIcon() |
|
144
|
|
|
{ |
|
145
|
|
|
return $this->icon; |
|
146
|
|
|
} |
|
147
|
|
|
|
|
148
|
|
|
/** |
|
149
|
|
|
* Set name |
|
150
|
|
|
* |
|
151
|
|
|
* @param string $name |
|
152
|
|
|
*/ |
|
153
|
|
|
public function setName($name) |
|
154
|
|
|
{ |
|
155
|
|
|
$this->name = $name; |
|
156
|
|
|
} |
|
157
|
|
|
|
|
158
|
|
|
/** |
|
159
|
|
|
* Get name |
|
160
|
|
|
* |
|
161
|
|
|
* @return string |
|
162
|
|
|
*/ |
|
163
|
|
|
public function getName() |
|
164
|
|
|
{ |
|
165
|
|
|
return $this->name; |
|
166
|
|
|
} |
|
167
|
|
|
|
|
168
|
|
|
/** |
|
169
|
|
|
* Set title |
|
170
|
|
|
* |
|
171
|
|
|
* @param string $title |
|
172
|
|
|
*/ |
|
173
|
|
|
public function setTitle($title) |
|
174
|
|
|
{ |
|
175
|
|
|
$this->title = $title; |
|
176
|
|
|
} |
|
177
|
|
|
|
|
178
|
|
|
/** |
|
179
|
|
|
* Get Title |
|
180
|
|
|
* |
|
181
|
|
|
* @return string |
|
182
|
|
|
*/ |
|
183
|
|
|
public function getTitle() |
|
184
|
|
|
{ |
|
185
|
|
|
return $this->title; |
|
186
|
|
|
} |
|
187
|
|
|
|
|
188
|
|
|
/** |
|
189
|
|
|
* Set Link |
|
190
|
|
|
* |
|
191
|
|
|
* @param string $link |
|
192
|
|
|
*/ |
|
193
|
|
|
public function setLink($link) |
|
194
|
|
|
{ |
|
195
|
|
|
$this->link = $link; |
|
196
|
|
|
} |
|
197
|
|
|
|
|
198
|
|
|
/** |
|
199
|
|
|
* Get Link |
|
200
|
|
|
* |
|
201
|
|
|
* @return string |
|
202
|
|
|
*/ |
|
203
|
|
|
public function getLink() |
|
204
|
|
|
{ |
|
205
|
|
|
return $this->link; |
|
206
|
|
|
} |
|
207
|
|
|
|
|
208
|
|
|
/** |
|
209
|
|
|
* Set Component |
|
210
|
|
|
* |
|
211
|
|
|
* @param string $component |
|
212
|
|
|
*/ |
|
213
|
|
|
public function setComponent($component) |
|
214
|
|
|
{ |
|
215
|
|
|
$this->component = $component; |
|
216
|
|
|
} |
|
217
|
|
|
|
|
218
|
|
|
/** |
|
219
|
|
|
* Get Component |
|
220
|
|
|
* |
|
221
|
|
|
* @return string |
|
222
|
|
|
*/ |
|
223
|
|
|
public function getComponent() |
|
224
|
|
|
{ |
|
225
|
|
|
return $this->component; |
|
226
|
|
|
} |
|
227
|
|
|
|
|
228
|
|
|
/** |
|
229
|
|
|
* Set Description |
|
230
|
|
|
* |
|
231
|
|
|
* @param string $description |
|
232
|
|
|
*/ |
|
233
|
|
|
public function setDescription($description) |
|
234
|
|
|
{ |
|
235
|
|
|
$this->description = $description; |
|
236
|
|
|
} |
|
237
|
|
|
|
|
238
|
|
|
/** |
|
239
|
|
|
* Get Description |
|
240
|
|
|
* |
|
241
|
|
|
* @return string |
|
242
|
|
|
*/ |
|
243
|
|
|
public function getDescription() |
|
244
|
|
|
{ |
|
245
|
|
|
return $this->description; |
|
246
|
|
|
} |
|
247
|
|
|
|
|
248
|
|
|
/** |
|
249
|
|
|
* Set Navigation Component Id |
|
250
|
|
|
* |
|
251
|
|
|
* @param string $navigationComponentId |
|
252
|
|
|
*/ |
|
253
|
|
|
public function setNavigationComponentId($navigationComponentId) |
|
254
|
|
|
{ |
|
255
|
|
|
$this->navigationComponentId = $navigationComponentId; |
|
256
|
|
|
} |
|
257
|
|
|
|
|
258
|
|
|
/** |
|
259
|
|
|
* Get Navigation Component Id |
|
260
|
|
|
* |
|
261
|
|
|
* @return string |
|
262
|
|
|
*/ |
|
263
|
|
|
public function getNavigationComponentId() |
|
264
|
|
|
{ |
|
265
|
|
|
return $this->navigationComponentId; |
|
266
|
|
|
} |
|
267
|
|
|
|
|
268
|
|
|
/** |
|
269
|
|
|
* @param string $navigationFrameScript |
|
270
|
|
|
*/ |
|
271
|
|
|
public function setNavigationFrameScript($navigationFrameScript) |
|
272
|
|
|
{ |
|
273
|
|
|
$this->navigationFrameScript = $navigationFrameScript; |
|
274
|
|
|
} |
|
275
|
|
|
|
|
276
|
|
|
/** |
|
277
|
|
|
* @return string |
|
278
|
|
|
*/ |
|
279
|
|
|
public function getNavigationFrameScript() |
|
280
|
|
|
{ |
|
281
|
|
|
return $this->navigationFrameScript; |
|
282
|
|
|
} |
|
283
|
|
|
|
|
284
|
|
|
/** |
|
285
|
|
|
* @param string $navigationFrameScriptParameters |
|
286
|
|
|
*/ |
|
287
|
|
|
public function setNavigationFrameScriptParameters($navigationFrameScriptParameters) |
|
288
|
|
|
{ |
|
289
|
|
|
$this->navigationFrameScriptParameters = $navigationFrameScriptParameters; |
|
290
|
|
|
} |
|
291
|
|
|
|
|
292
|
|
|
/** |
|
293
|
|
|
* @return string |
|
294
|
|
|
*/ |
|
295
|
|
|
public function getNavigationFrameScriptParameters() |
|
296
|
|
|
{ |
|
297
|
|
|
return $this->navigationFrameScriptParameters; |
|
298
|
|
|
} |
|
299
|
|
|
|
|
300
|
|
|
/** |
|
301
|
|
|
* Set onClick |
|
302
|
|
|
* |
|
303
|
|
|
* @param string $onClick |
|
304
|
|
|
*/ |
|
305
|
|
|
public function setOnClick($onClick) |
|
306
|
|
|
{ |
|
307
|
|
|
$this->onClick = $onClick; |
|
308
|
|
|
} |
|
309
|
|
|
|
|
310
|
|
|
/** |
|
311
|
|
|
* Get onClick |
|
312
|
|
|
* |
|
313
|
|
|
* @return string |
|
314
|
|
|
*/ |
|
315
|
|
|
public function getOnClick() |
|
316
|
|
|
{ |
|
317
|
|
|
return $this->onClick; |
|
318
|
|
|
} |
|
319
|
|
|
|
|
320
|
|
|
public function setCollapsed(bool $collapsed): void |
|
321
|
|
|
{ |
|
322
|
|
|
$this->collapsed = $collapsed; |
|
323
|
|
|
} |
|
324
|
|
|
|
|
325
|
|
|
public function getCollapsed(): bool |
|
326
|
|
|
{ |
|
327
|
|
|
return $this->collapsed; |
|
328
|
|
|
} |
|
329
|
|
|
|
|
330
|
|
|
/** |
|
331
|
|
|
* @return bool |
|
332
|
|
|
*/ |
|
333
|
|
|
public function isStandalone(): bool |
|
334
|
|
|
{ |
|
335
|
|
|
return $this->standalone; |
|
336
|
|
|
} |
|
337
|
|
|
|
|
338
|
|
|
/** |
|
339
|
|
|
* @param bool $standalone |
|
340
|
|
|
*/ |
|
341
|
|
|
public function setStandalone(bool $standalone): void |
|
342
|
|
|
{ |
|
343
|
|
|
$this->standalone = $standalone; |
|
344
|
|
|
} |
|
345
|
|
|
} |
|
346
|
|
|
|