[TASK] Fix CGL errors
[Packages/TYPO3.CMS.git] / typo3 / sysext / backend / Classes / Form / FormDataProvider / TcaFlexProcess.php
1 <?php
2 namespace TYPO3\CMS\Backend\Form\FormDataProvider;
3
4 /*
5 * This file is part of the TYPO3 CMS project.
6 *
7 * It is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU General Public License, either version 2
9 * of the License, or any later version.
10 *
11 * For the full copyright and license information, please read the
12 * LICENSE.txt file that was distributed with this source code.
13 *
14 * The TYPO3 project - inspiring people to share!
15 */
16
17 use TYPO3\CMS\Backend\Form\FormDataCompiler;
18 use TYPO3\CMS\Backend\Form\FormDataGroup\FlexFormSegment;
19 use TYPO3\CMS\Backend\Form\FormDataProviderInterface;
20 use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
21 use TYPO3\CMS\Core\Utility\GeneralUtility;
22
23 /**
24 * Process data structures and data values, calculate defaults.
25 *
26 * This is typically the last provider, executed after TcaFlexPrepare
27 */
28 class TcaFlexProcess implements FormDataProviderInterface
29 {
30 /**
31 * Determine possible pageTsConfig overrides and apply them to ds.
32 * Determine available languages and sanitize dv for further processing. Then kick
33 * and validate further details like excluded fields. Finally for each possible
34 * value and ds call FormDataCompiler with set FlexFormSegment group to resolve
35 * single field stuff like item processor functions.
36 *
37 * @param array $result
38 * @return array
39 */
40 public function addData(array $result)
41 {
42 foreach ($result['processedTca']['columns'] as $fieldName => $fieldConfig) {
43 if (empty($fieldConfig['config']['type']) || $fieldConfig['config']['type'] !== 'flex') {
44 continue;
45 }
46
47 $flexIdentifier = $this->getFlexIdentifier($result, $fieldName);
48 $pageTsConfigOfFlex = $this->getPageTsOfFlex($result, $fieldName, $flexIdentifier);
49 $result = $this->modifyOuterDataStructure($result, $fieldName, $pageTsConfigOfFlex);
50 $result = $this->removeExcludeFieldsFromDataStructure($result, $fieldName, $flexIdentifier);
51 $result = $this->removeDisabledFieldsFromDataStructure($result, $fieldName, $pageTsConfigOfFlex);
52 $result = $this->modifyDataStructureAndDataValuesByFlexFormSegmentGroup($result, $fieldName, $pageTsConfigOfFlex);
53 }
54
55 return $result;
56 }
57
58 /**
59 * Take care of ds_pointerField and friends to determine the correct sub array within
60 * TCA config ds.
61 *
62 * Gets extension identifier. Use second pointer field if it's value is not empty, "list" or "*",
63 * else it must be a plugin and first one will be used.
64 * This code basically determines the sub key of ds field:
65 * config = array(
66 * ds => array(
67 * 'aFlexConfig' => '<flexXml ...
68 * ^^^^^^^^^^^
69 * $flexformIdentifier contains "aFlexConfig" after this operation.
70 *
71 * @todo: This method is only implemented half. It basically should do all the
72 * @todo: pointer handling that is done within BackendUtility::getFlexFormDS() to $srcPointer.
73 *
74 * @param array $result Result array
75 * @param string $fieldName Current handle field name
76 * @return string Pointer
77 */
78 protected function getFlexIdentifier(array $result, $fieldName)
79 {
80 // @todo: Current implementation with the "list_type, CType" fallback is rather limited and customized for
81 // @todo: tt_content, also it forces a ds_pointerField to be defined and a casual "default" sub array does not work
82 $pointerFields = !empty($result['processedTca']['columns'][$fieldName]['config']['ds_pointerField'])
83 ? $result['processedTca']['columns'][$fieldName]['config']['ds_pointerField']
84 : 'list_type,CType';
85 $pointerFields = GeneralUtility::trimExplode(',', $pointerFields);
86 $flexformIdentifier = !empty($result['databaseRow'][$pointerFields[0]]) ? $result['databaseRow'][$pointerFields[0]] : '';
87 if (!empty($result['databaseRow'][$pointerFields[1]])
88 && $result['databaseRow'][$pointerFields[1]] !== 'list'
89 && $result['databaseRow'][$pointerFields[1]] !== '*'
90 ) {
91 $flexformIdentifier = $result['databaseRow'][$pointerFields[1]];
92 }
93 if (empty($flexformIdentifier)) {
94 $flexformIdentifier = 'default';
95 }
96
97 return $flexformIdentifier;
98 }
99
100 /**
101 * Determine TCEFORM.aTable.aField.matchingIdentifier
102 *
103 * @param array $result Result array
104 * @param string $fieldName Handled field name
105 * @param string $flexIdentifier Determined identifier
106 * @return array PageTsConfig for this flex
107 */
108 protected function getPageTsOfFlex(array $result, $fieldName, $flexIdentifier)
109 {
110 $table = $result['tableName'];
111 $pageTs = [];
112 if (!empty($result['pageTsConfig']['TCEFORM.'][$table . '.'][$fieldName . '.'][$flexIdentifier . '.'])
113 && is_array($result['pageTsConfig']['TCEFORM.'][$table . '.'][$fieldName . '.'][$flexIdentifier . '.'])) {
114 $pageTs = $result['pageTsConfig']['TCEFORM.'][$table . '.'][$fieldName . '.'][$flexIdentifier . '.'];
115 }
116 return $pageTs;
117 }
118
119 /**
120 * Handle "outer" flex data structure changes like language and sheet
121 * description. Does not change "TCA" or values of single elements
122 *
123 * @param array $result Result array
124 * @param string $fieldName Current handle field name
125 * @param array $pageTsConfig Given pageTsConfig of this flex form
126 * @return array Modified item array
127 */
128 protected function modifyOuterDataStructure(array $result, $fieldName, $pageTsConfig)
129 {
130 $modifiedDataStructure = $result['processedTca']['columns'][$fieldName]['config']['ds'];
131
132 if (isset($modifiedDataStructure['sheets']) && is_array($modifiedDataStructure['sheets'])) {
133 // Handling multiple sheets
134 foreach ($modifiedDataStructure['sheets'] as $sheetName => $sheetStructure) {
135 if (isset($pageTsConfig[$sheetName . '.']) && is_array($pageTsConfig[$sheetName . '.'])) {
136 $pageTsOfSheet = $pageTsConfig[$sheetName . '.'];
137
138 // Remove whole sheet if disabled
139 if (!empty($pageTsOfSheet['disabled'])) {
140 unset($modifiedDataStructure['sheets'][$sheetName]);
141 continue;
142 }
143
144 // sheetTitle, sheetDescription, sheetShortDescr
145 $modifiedDataStructure['sheets'][$sheetName] = $this->modifySingleSheetInformation($sheetStructure, $pageTsOfSheet);
146 }
147 }
148 }
149
150 $result['processedTca']['columns'][$fieldName]['config']['ds'] = $modifiedDataStructure;
151
152 return $result;
153 }
154
155 /**
156 * Removes fields from data structure the user has no access to
157 *
158 * @param array $result Result array
159 * @param string $fieldName Current handle field name
160 * @param string $flexIdentifier Determined identifier
161 * @return array Modified result
162 */
163 protected function removeExcludeFieldsFromDataStructure(array $result, $fieldName, $flexIdentifier)
164 {
165 $dataStructure = $result['processedTca']['columns'][$fieldName]['config']['ds'];
166 $backendUser = $this->getBackendUser();
167 if ($backendUser->isAdmin() || !isset($dataStructure['sheets']) || !is_array($dataStructure['sheets'])) {
168 return $result;
169 }
170
171 $userNonExcludeFields = GeneralUtility::trimExplode(',', $backendUser->groupData['non_exclude_fields']);
172 $excludeFieldsPrefix = $result['tableName'] . ':' . $fieldName . ';' . $flexIdentifier . ';';
173 $nonExcludeFields = [];
174 foreach ($userNonExcludeFields as $userNonExcludeField) {
175 if (strpos($userNonExcludeField, $excludeFieldsPrefix) !== false) {
176 $exploded = explode(';', $userNonExcludeField);
177 $sheetName = $exploded[2];
178 $allowedFlexFieldName = $exploded[3];
179 $nonExcludeFields[$sheetName][$allowedFlexFieldName] = true;
180 }
181 }
182 foreach ($dataStructure['sheets'] as $sheetName => $sheetDefinition) {
183 if (!isset($sheetDefinition['ROOT']['el']) || !is_array($sheetDefinition['ROOT']['el'])) {
184 continue;
185 }
186 foreach ($sheetDefinition['ROOT']['el'] as $flexFieldName => $fieldDefinition) {
187 if (!empty($fieldDefinition['exclude']) && !isset($nonExcludeFields[$sheetName][$flexFieldName])) {
188 unset($result['processedTca']['columns'][$fieldName]['config']['ds']['sheets'][$sheetName]['ROOT']['el'][$flexFieldName]);
189 }
190 }
191 }
192
193 return $result;
194 }
195
196 /**
197 * Remove fields from data structure that are disabled in pageTsConfig.
198 *
199 * @param array $result Result array
200 * @param string $fieldName Current handle field name
201 * @param array $pageTsConfig Given pageTsConfig of this flex form
202 * @return array Modified item array
203 */
204 protected function removeDisabledFieldsFromDataStructure(array $result, $fieldName, $pageTsConfig)
205 {
206 $dataStructure = $result['processedTca']['columns'][$fieldName]['config']['ds'];
207 if (!isset($dataStructure['sheets']) || !is_array($dataStructure['sheets'])) {
208 return $result;
209 }
210 foreach ($dataStructure['sheets'] as $sheetName => $sheetDefinition) {
211 if (!isset($sheetDefinition['ROOT']['el']) || !is_array($sheetDefinition['ROOT']['el'])
212 || !isset($pageTsConfig[$sheetName . '.'])) {
213 continue;
214 }
215 foreach ($sheetDefinition['ROOT']['el'] as $flexFieldName => $fieldDefinition) {
216 if (!empty($pageTsConfig[$sheetName . '.'][$flexFieldName . '.']['disabled'])) {
217 unset($result['processedTca']['columns'][$fieldName]['config']['ds']['sheets'][$sheetName]['ROOT']['el'][$flexFieldName]);
218 }
219 }
220 }
221 return $result;
222 }
223
224 /**
225 * Feed single flex field and data to FlexFormSegment FormData compiler and merge result.
226 * This one is nasty. Goal is to have processed TCA stuff in DS and also have validated / processed data values.
227 *
228 * Three main parts in this method:
229 * * Process values of existing section container for default values
230 * * Process values and TCA of possible section container and create a default value row for each
231 * * Process TCA of "normal" fields and have default values in data ['templateRows']['containerName'] parallel to section ['el']
232 *
233 * @param array $result Result array
234 * @param string $fieldName Current handle field name
235 * @param array $pageTsConfig Given pageTsConfig of this flex form
236 * @return array Modified item array
237 */
238 protected function modifyDataStructureAndDataValuesByFlexFormSegmentGroup(array $result, $fieldName, $pageTsConfig)
239 {
240 $dataStructure = $result['processedTca']['columns'][$fieldName]['config']['ds'];
241 $dataValues = $result['databaseRow'][$fieldName];
242 $tableName = $result['tableName'];
243
244 if (!isset($dataStructure['sheets']) || !is_array($dataStructure['sheets'])) {
245 return $result;
246 }
247
248 /** @var FlexFormSegment $formDataGroup */
249 $formDataGroup = GeneralUtility::makeInstance(FlexFormSegment::class);
250 /** @var FormDataCompiler $formDataCompiler */
251 $formDataCompiler = GeneralUtility::makeInstance(FormDataCompiler::class, $formDataGroup);
252
253 foreach ($dataStructure['sheets'] as $dataStructureSheetName => $dataStructureSheetDefinition) {
254 if (!isset($dataStructureSheetDefinition['ROOT']['el']) || !is_array($dataStructureSheetDefinition['ROOT']['el'])) {
255 continue;
256 }
257 $dataStructureSheetElements = $dataStructureSheetDefinition['ROOT']['el'];
258
259 // Prepare pageTsConfig of this sheet
260 $pageTsConfig['TCEFORM.'][$tableName . '.'] = [];
261 if (isset($pageTsConfig[$dataStructureSheetName . '.']) && is_array($pageTsConfig[$dataStructureSheetName . '.'])) {
262 $pageTsConfig['TCEFORM.'][$tableName . '.'] = $pageTsConfig[$dataStructureSheetName . '.'];
263 }
264
265 $tcaNewColumns = [];
266 $tcaEditColumns = [];
267 $tcaValueArray = [
268 'uid' => $result['databaseRow']['uid'],
269 ];
270 foreach ($dataStructureSheetElements as $dataStructureSheetElementName => $dataStructureSheetElementDefinition) {
271 if (isset($dataStructureSheetElementDefinition['type']) && $dataStructureSheetElementDefinition['type'] === 'array'
272 && isset($dataStructureSheetElementDefinition['section']) && (string)$dataStructureSheetElementDefinition['section'] === '1'
273 ) {
274 // A section
275
276 // Existing section container elements
277 if (isset($dataValues['data'][$dataStructureSheetName]['lDEF'][$dataStructureSheetElementName]['el'])
278 && is_array($dataValues['data'][$dataStructureSheetName]['lDEF'][$dataStructureSheetElementName]['el'])
279 ) {
280 $containerArray = $dataValues['data'][$dataStructureSheetName]['lDEF'][$dataStructureSheetElementName]['el'];
281 foreach ($containerArray as $aContainerNumber => $aContainerArray) {
282 if (is_array($aContainerArray)) {
283 foreach ($aContainerArray as $aContainerName => $aContainerElementArray) {
284 if ($aContainerName === '_TOGGLE') {
285 // Don't handle internal toggle state field
286 continue;
287 }
288 if (!isset($dataStructureSheetElements[$dataStructureSheetElementName]['el'][$aContainerName])) {
289 // Container not defined in ds
290 continue;
291 }
292
293 $newColumns = [];
294 $editColumns = [];
295 $valueArray = [
296 'uid' => $result['databaseRow']['uid'],
297 ];
298 foreach ($dataStructureSheetElements[$dataStructureSheetElementName]['el'][$aContainerName]['el'] as $singleFieldName => $singleFieldConfiguration) {
299 // $singleFieldValueArray = ['data']['sSections']['lDEF']['section_1']['el']['1']['container_1']['el']['element_1']
300 $singleFieldValueArray = [];
301 if (isset($aContainerElementArray['el'][$singleFieldName])
302 && is_array($aContainerElementArray['el'][$singleFieldName])
303 ) {
304 $singleFieldValueArray = $aContainerElementArray['el'][$singleFieldName];
305 }
306
307 if (array_key_exists('vDEF', $singleFieldValueArray)) {
308 $editColumns[$singleFieldName] = $singleFieldConfiguration;
309 $valueArray[$singleFieldName] = $singleFieldValueArray['vDEF'];
310 } else {
311 $newColumns[$singleFieldName] = $singleFieldConfiguration;
312 }
313 }
314
315 $inputToFlexFormSegment = [
316 'tableName' => $result['tableName'],
317 'command' => '',
318 // It is currently not possible to have pageTsConfig for section container
319 'pageTsConfig' => [],
320 'databaseRow' => $valueArray,
321 'processedTca' => [
322 'ctrl' => [],
323 'columns' => [],
324 ],
325 'flexParentDatabaseRow' => $result['databaseRow'],
326 ];
327
328 if (!empty($newColumns)) {
329 $inputToFlexFormSegment['command'] = 'new';
330 $inputToFlexFormSegment['processedTca']['columns'] = $newColumns;
331 $flexSegmentResult = $formDataCompiler->compile($inputToFlexFormSegment);
332
333 foreach ($newColumns as $singleFieldName => $_) {
334 // Set data value result
335 if (array_key_exists($singleFieldName, $flexSegmentResult['databaseRow'])) {
336 $result['databaseRow'][$fieldName]
337 ['data'][$dataStructureSheetName]['lDEF'][$dataStructureSheetElementName]
338 ['el'][$aContainerNumber][$aContainerName]['el'][$singleFieldName]['vDEF'] =
339 $flexSegmentResult['databaseRow'][$singleFieldName];
340 }
341 // Set TCA structure result, actually, this call *might* be obsolete since the "dummy"
342 // handling below will set it again.
343 $result['processedTca']['columns'][$fieldName]['config']['ds']
344 ['sheets'][$dataStructureSheetName]['ROOT']['el']
345 [$dataStructureSheetElementName]['el'][$aContainerName]['el'][$singleFieldName] =
346 $flexSegmentResult['processedTca']['columns'][$singleFieldName];
347 }
348 }
349
350 if (!empty($editColumns)) {
351 $inputToFlexFormSegment['command'] = 'edit';
352 $inputToFlexFormSegment['processedTca']['columns'] = $editColumns;
353 $flexSegmentResult = $formDataCompiler->compile($inputToFlexFormSegment);
354
355 foreach ($editColumns as $singleFieldName => $_) {
356 // Set data value result
357 if (array_key_exists($singleFieldName, $flexSegmentResult['databaseRow'])) {
358 $result['databaseRow'][$fieldName]
359 ['data'][$dataStructureSheetName]['lDEF'][$dataStructureSheetElementName]
360 ['el'][$aContainerNumber][$aContainerName]['el'][$singleFieldName]['vDEF'] =
361 $flexSegmentResult['databaseRow'][$singleFieldName];
362 }
363 // Set TCA structure result, actually, this call *might* be obsolete since the "dummy"
364 // handling below will set it again.
365 $result['processedTca']['columns'][$fieldName]['config']['ds']
366 ['sheets'][$dataStructureSheetName]['ROOT']['el']
367 [$dataStructureSheetElementName]['el'][$aContainerName]['el'][$singleFieldName] =
368 $flexSegmentResult['processedTca']['columns'][$singleFieldName];
369 }
370 }
371 }
372 }
373 }
374 // End of existing data value handling
375 } else {
376 // Force the section to be an empty array if there are no existing containers
377 $result['databaseRow'][$fieldName]
378 ['data'][$dataStructureSheetName]['lDEF'][$dataStructureSheetElementName]['el'] = [];
379 }
380
381 // Prepare "fresh" row for every possible container
382 if (isset($dataStructureSheetElements[$dataStructureSheetElementName]['el']) && is_array($dataStructureSheetElements[$dataStructureSheetElementName]['el'])) {
383 foreach ($dataStructureSheetElements[$dataStructureSheetElementName]['el'] as $possibleContainerName => $possibleContainerConfiguration) {
384 if (isset($possibleContainerConfiguration['el']) && is_array($possibleContainerConfiguration['el'])) {
385 // Initialize result data array templateRows
386 $result['databaseRow'][$fieldName]
387 ['data'][$dataStructureSheetName]['lDEF'][$dataStructureSheetElementName]['templateRows']
388 [$possibleContainerName]['el']
389 = [];
390 foreach ($possibleContainerConfiguration['el'] as $singleFieldName => $singleFieldConfiguration) {
391 $inputToFlexFormSegment = [
392 'tableName' => $result['tableName'],
393 'command' => 'new',
394 'pageTsConfig' => [],
395 'databaseRow' => [
396 'uid' => $result['databaseRow']['uid'],
397 ],
398 'processedTca' => [
399 'ctrl' => [],
400 'columns' => [
401 $singleFieldName => $singleFieldConfiguration,
402 ],
403 ],
404 'flexParentDatabaseRow' => $result['databaseRow'],
405 ];
406 $flexSegmentResult = $formDataCompiler->compile($inputToFlexFormSegment);
407 if (array_key_exists($singleFieldName, $flexSegmentResult['databaseRow'])) {
408 $result['databaseRow'][$fieldName]
409 ['data'][$dataStructureSheetName]['lDEF'][$dataStructureSheetElementName]['templateRows']
410 [$possibleContainerName]['el'][$singleFieldName]['vDEF']
411 = $flexSegmentResult['databaseRow'][$singleFieldName];
412 }
413 $result['processedTca']['columns'][$fieldName]['config']['ds']
414 ['sheets'][$dataStructureSheetName]['ROOT']['el'][$dataStructureSheetElementName]['el']
415 [$possibleContainerName]['el'][$singleFieldName]
416 = $flexSegmentResult['processedTca']['columns'][$singleFieldName];
417 }
418 }
419 }
420 } // End of preparation for each possible container
421
422 // type without section is not ok
423 } elseif (isset($dataStructureSheetElementDefinition['type']) || isset($dataStructureSheetElementDefinition['section'])) {
424 throw new \UnexpectedValueException(
425 'Broken data structure on field name ' . $fieldName . '. section without type or vice versa is not allowed',
426 1440685208
427 );
428
429 // A "normal" TCA element
430 } else {
431 if (isset($dataValues['data'][$dataStructureSheetName]['lDEF'][$dataStructureSheetElementName])
432 && array_key_exists('vDEF', $dataValues['data'][$dataStructureSheetName]['lDEF'][$dataStructureSheetElementName])
433 ) {
434 $tcaEditColumns[$dataStructureSheetElementName] = $dataStructureSheetElementDefinition;
435 $tcaValueArray[$dataStructureSheetElementName] = $dataValues['data'][$dataStructureSheetName]['lDEF'][$dataStructureSheetElementName]['vDEF'];
436 } else {
437 $tcaNewColumns[$dataStructureSheetElementName] = $dataStructureSheetElementDefinition;
438 }
439 } // End of single element handling
440 }
441
442 // process the tca columns for the current sheet
443 $inputToFlexFormSegment = [
444 // tablename of "parent" is given down for inline elements to resolve correctly
445 'tableName' => $result['tableName'],
446 'command' => '',
447 'pageTsConfig' => $pageTsConfig,
448 'databaseRow' => $tcaValueArray,
449 'processedTca' => [
450 'ctrl' => [],
451 'columns' => [],
452 ],
453 'flexParentDatabaseRow' => $result['databaseRow'],
454 ];
455
456 if (!empty($tcaNewColumns)) {
457 $inputToFlexFormSegment['command'] = 'new';
458 $inputToFlexFormSegment['processedTca']['columns'] = $tcaNewColumns;
459 $flexSegmentResult = $formDataCompiler->compile($inputToFlexFormSegment);
460
461 foreach ($tcaNewColumns as $dataStructureSheetElementName => $_) {
462 // Set data value result
463 if (array_key_exists($dataStructureSheetElementName, $flexSegmentResult['databaseRow'])) {
464 $result['databaseRow'][$fieldName]
465 ['data'][$dataStructureSheetName]['lDEF'][$dataStructureSheetElementName]['vDEF']
466 = $flexSegmentResult['databaseRow'][$dataStructureSheetElementName];
467 }
468 // Set TCA structure result
469 $result['processedTca']['columns'][$fieldName]['config']['ds']
470 ['sheets'][$dataStructureSheetName]['ROOT']['el'][$dataStructureSheetElementName]
471 = $flexSegmentResult['processedTca']['columns'][$dataStructureSheetElementName];
472 }
473 }
474
475 if (!empty($tcaEditColumns)) {
476 $inputToFlexFormSegment['command'] = 'edit';
477 $inputToFlexFormSegment['processedTca']['columns'] = $tcaEditColumns;
478 $flexSegmentResult = $formDataCompiler->compile($inputToFlexFormSegment);
479
480 foreach ($tcaEditColumns as $dataStructureSheetElementName => $_) {
481 // Set data value result
482 if (array_key_exists($dataStructureSheetElementName, $flexSegmentResult['databaseRow'])) {
483 $result['databaseRow'][$fieldName]
484 ['data'][$dataStructureSheetName]['lDEF'][$dataStructureSheetElementName]['vDEF']
485 = $flexSegmentResult['databaseRow'][$dataStructureSheetElementName];
486 }
487 // Set TCA structure result
488 $result['processedTca']['columns'][$fieldName]['config']['ds']
489 ['sheets'][$dataStructureSheetName]['ROOT']['el'][$dataStructureSheetElementName]
490 = $flexSegmentResult['processedTca']['columns'][$dataStructureSheetElementName];
491 }
492 }
493 }
494
495 return $result;
496 }
497
498 /**
499 * Modify data structure of a single "sheet"
500 * Sets "secondary" data like sheet names and so on, but does NOT modify single elements
501 *
502 * @param array $dataStructure Given data structure
503 * @param array $pageTsOfSheet Page Ts config of given field
504 * @return array Modified data structure
505 */
506 protected function modifySingleSheetInformation(array $dataStructure, array $pageTsOfSheet)
507 {
508 // Return if no elements defined
509 if (!isset($dataStructure['ROOT']['el']) || !is_array($dataStructure['ROOT']['el'])) {
510 return $dataStructure;
511 }
512
513 // Rename sheet (tab)
514 if (!empty($pageTsOfSheet['sheetTitle'])) {
515 $dataStructure['ROOT']['sheetTitle'] = $pageTsOfSheet['sheetTitle'];
516 }
517 // Set sheet description (tab)
518 if (!empty($pageTsOfSheet['sheetDescription'])) {
519 $dataStructure['ROOT']['sheetDescription'] = $pageTsOfSheet['sheetDescription'];
520 }
521 // Set sheet short description (tab)
522 if (!empty($pageTsOfSheet['sheetShortDescr'])) {
523 $dataStructure['ROOT']['sheetShortDescr'] = $pageTsOfSheet['sheetShortDescr'];
524 }
525
526 return $dataStructure;
527 }
528
529 /**
530 * @return BackendUserAuthentication
531 */
532 protected function getBackendUser()
533 {
534 return $GLOBALS['BE_USER'];
535 }
536 }