[TASK] Remove usage of deprecated CSS class bgColor6
[Packages/TYPO3.CMS.git] / typo3 / sysext / tstemplate / Classes / Controller / TypoScriptTemplateModuleController.php
1 <?php
2 namespace TYPO3\CMS\Tstemplate\Controller;
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 Psr\Http\Message\ResponseInterface;
18 use Psr\Http\Message\ServerRequestInterface;
19 use TYPO3\CMS\Backend\Module\BaseScriptClass;
20 use TYPO3\CMS\Backend\Template\Components\ButtonBar;
21 use TYPO3\CMS\Backend\Template\ModuleTemplate;
22 use TYPO3\CMS\Backend\Utility\BackendUtility;
23 use TYPO3\CMS\Core\DataHandling\DataHandler;
24 use TYPO3\CMS\Core\Imaging\Icon;
25 use TYPO3\CMS\Core\TypoScript\ExtendedTemplateService;
26 use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
27 use TYPO3\CMS\Core\Utility\GeneralUtility;
28 use TYPO3\CMS\Core\Utility\MathUtility;
29 use TYPO3\CMS\Fluid\View\StandaloneView;
30 use TYPO3\CMS\Fluid\ViewHelpers\Be\InfoboxViewHelper;
31
32 /**
33 * Module: TypoScript Tools
34 */
35 class TypoScriptTemplateModuleController extends BaseScriptClass
36 {
37 /**
38 * @var string
39 */
40 public $perms_clause;
41
42 /**
43 * @var string
44 */
45 public $e;
46
47 /**
48 * @var string
49 */
50 public $sObj;
51
52 /**
53 * @var string
54 */
55 public $edit;
56
57 /**
58 * @var string
59 */
60 public $textExtensions = 'html,htm,txt,css,tmpl,inc,js';
61
62 /**
63 * @var string
64 */
65 public $modMenu_type = '';
66
67 /**
68 * @var string
69 */
70 public $modMenu_dontValidateList = '';
71
72 /**
73 * @var string
74 */
75 public $modMenu_setDefaultList = '';
76
77 /**
78 * @var array
79 */
80 public $pageinfo = array();
81
82 /**
83 * @var bool
84 */
85 public $access = false;
86
87 /**
88 * The name of the module
89 *
90 * @var string
91 */
92 protected $moduleName = 'web_ts';
93
94 /**
95 * ModuleTemplate Container
96 *
97 * @var ModuleTemplate
98 */
99 protected $moduleTemplate;
100
101 /**
102 * Constructor
103 */
104 public function __construct()
105 {
106 $this->moduleTemplate = GeneralUtility::makeInstance(ModuleTemplate::class);
107 $this->getLanguageService()->includeLLFile('EXT:tstemplate/Resources/Private/Language/locallang.xlf');
108
109 $this->MCONF = array(
110 'name' => $this->moduleName
111 );
112 $this->moduleTemplate->addJavaScriptCode(
113 'jumpToUrl',
114 '
115 function jumpToUrl(URL) {
116 window.location.href = URL;
117 return false;
118 }
119 '
120 );
121 }
122
123 /**
124 * Init
125 *
126 * @return void
127 */
128 public function init()
129 {
130 parent::init();
131 $this->id = (int)GeneralUtility::_GP('id');
132 $this->e = GeneralUtility::_GP('e');
133 $this->sObj = GeneralUtility::_GP('sObj');
134 $this->edit = GeneralUtility::_GP('edit');
135 $this->perms_clause = $this->getBackendUser()->getPagePermsClause(1);
136 }
137
138 /**
139 * Clear cache
140 *
141 * @return void
142 */
143 public function clearCache()
144 {
145 if (GeneralUtility::_GP('clear_all_cache')) {
146 /** @var DataHandler $tce */
147 $tce = GeneralUtility::makeInstance(DataHandler::class);
148 $tce->start(array(), array());
149 $tce->clear_cacheCmd('all');
150 }
151 }
152
153 /**
154 * Main
155 *
156 * @return void
157 */
158 public function main()
159 {
160 // Template markers
161 $markers = array(
162 'CSH' => '',
163 'FUNC_MENU' => '',
164 'CONTENT' => ''
165 );
166
167 // Access check...
168 // The page will show only if there is a valid page and if this page may be viewed by the user
169 $this->pageinfo = BackendUtility::readPageAccess($this->id, $this->perms_clause);
170 $this->access = is_array($this->pageinfo);
171
172 $this->moduleTemplate->getPageRenderer()->addCssFile(ExtensionManagementUtility::extRelPath('tstemplate') . 'Resources/Public/Css/styles.css');
173
174 $lang = $this->getLanguageService();
175
176 if ($this->id && $this->access) {
177 $urlParameters = array(
178 'id' => $this->id,
179 'template' => 'all'
180 );
181 $aHref = BackendUtility::getModuleUrl('web_ts', $urlParameters);
182
183 // JavaScript
184 $this->moduleTemplate->addJavaScriptCode(
185 'TSTemplateInlineJS', '
186 function uFormUrl(aname) {
187 document.forms[0].action = ' . GeneralUtility::quoteJSvalue(($aHref . '#')) . '+aname;
188 }
189 function brPoint(lnumber,t) {
190 window.location.href = ' . GeneralUtility::quoteJSvalue(($aHref . '&SET[function]=TYPO3\\CMS\\Tstemplate\\Controller\\TypoScriptTemplateObjectBrowserModuleFunctionController&SET[ts_browser_type]=')) . '+(t?"setup":"const")+"&breakPointLN="+lnumber;
191 return false;
192 }
193 if (top.fsMod) top.fsMod.recentIds["web"] = ' . $this->id . ';
194 ');
195 $this->moduleTemplate->getPageRenderer()->addCssInlineBlock(
196 'TSTemplateInlineStyle', '
197 TABLE#typo3-objectBrowser { width: 100%; margin-bottom: 24px; }
198 TABLE#typo3-objectBrowser A { text-decoration: none; }
199 TABLE#typo3-objectBrowser .comment { color: maroon; font-weight: bold; }
200 .ts-typoscript { width: 100%; }
201 .tsob-search-submit {margin-left: 3px; margin-right: 3px;}
202 .tst-analyzer-options { margin:5px 0; }
203 ');
204 // Setting up the context sensitive menu:
205 $this->moduleTemplate->getPageRenderer()->loadRequireJsModule('TYPO3/CMS/Backend/ClickMenu');
206 // Build the module content
207 $this->content = '<form action="' . htmlspecialchars($aHref) . '" method="post" enctype="multipart/form-data" id="TypoScriptTemplateModuleController" name="editForm" class="form">';
208 $this->content .= $this->moduleTemplate->header($lang->getLL('moduleTitle'));
209 $this->extObjContent();
210 // Setting up the buttons and markers for docheader
211 $this->getButtons();
212 $this->generateMenu();
213 $this->content .= '</form>';
214 } else {
215 // Template pages:
216 $records = $this->getDatabaseConnection()->exec_SELECTgetRows(
217 'pages.uid, count(*) AS count, max(sys_template.root) AS root_max_val, min(sys_template.root) AS root_min_val',
218 'pages,sys_template',
219 'pages.uid=sys_template.pid'
220 . BackendUtility::deleteClause('pages')
221 . BackendUtility::versioningPlaceholderClause('pages')
222 . BackendUtility::deleteClause('sys_template')
223 . BackendUtility::versioningPlaceholderClause('sys_template'),
224 'pages.uid',
225 'pages.pid, pages.sorting'
226 );
227 $pArray = array();
228 foreach ($records as $record) {
229 $this->setInPageArray($pArray, BackendUtility::BEgetRootLine($record['uid'], 'AND 1=1'), $record);
230 }
231
232 $table = '<div class="table-fit"><table class="table table-striped table-hover" id="ts-overview">' .
233 '<thead>' .
234 '<tr>' .
235 '<th>' . $lang->getLL('pageName') . '</th>' .
236 '<th>' . $lang->getLL('templates') . '</th>' .
237 '<th>' . $lang->getLL('isRoot') . '</th>' .
238 '<th>' . $lang->getLL('isExt') . '</th>' .
239 '</tr>' .
240 '</thead>' .
241 '<tbody>' . implode('', $this->renderList($pArray)) . '</tbody>' .
242 '</table></div>';
243
244 $this->content = $this->moduleTemplate->header($lang->getLL('moduleTitle'));
245 $this->content .= '<p class="lead">' . $lang->getLL('overview') . '</p>' . $table;
246
247 // RENDER LIST of pages with templates, END
248 // Setting up the buttons and markers for docheader
249 $this->getButtons();
250 }
251 }
252
253 /**
254 * Generates the menu based on $this->MOD_MENU
255 *
256 * @return void
257 * @throws \InvalidArgumentException
258 */
259 protected function generateMenu()
260 {
261 $menu = $this->moduleTemplate->getDocHeaderComponent()->getMenuRegistry()->makeMenu();
262 $menu->setIdentifier('WebFuncJumpMenu');
263 foreach ($this->MOD_MENU['function'] as $controller => $title) {
264 $item = $menu
265 ->makeMenuItem()
266 ->setHref(
267 BackendUtility::getModuleUrl(
268 $this->moduleName,
269 [
270 'id' => $this->id,
271 'SET' => [
272 'function' => $controller
273 ]
274 ]
275 )
276 )
277 ->setTitle($title);
278 if ($controller === $this->MOD_SETTINGS['function']) {
279 $item->setActive(true);
280 }
281 $menu->addMenuItem($item);
282 }
283 $this->moduleTemplate->getDocHeaderComponent()->getMenuRegistry()->addMenu($menu);
284 }
285
286 /**
287 * Injects the request object for the current request or subrequest
288 * Then checks for module functions that have hooked in, and renders menu etc.
289 *
290 * @param ServerRequestInterface $request the current request
291 * @param ResponseInterface $response
292 * @return ResponseInterface the response with the content
293 */
294 public function mainAction(ServerRequestInterface $request, ResponseInterface $response)
295 {
296 $GLOBALS['SOBE'] = $this;
297 $this->init();
298
299 // Checking for first level external objects
300 $this->checkExtObj();
301
302 $this->clearCache();
303 $this->main();
304
305 $this->moduleTemplate->setContent($this->content);
306 $response->getBody()->write($this->moduleTemplate->renderContent());
307 return $response;
308 }
309
310 /**
311 * Create the panel of buttons for submitting the form or otherwise perform operations.
312 *
313 * @return array All available buttons as an assoc. array
314 */
315 protected function getButtons()
316 {
317 $buttonBar = $this->moduleTemplate->getDocHeaderComponent()->getButtonBar();
318 $lang = $this->getLanguageService();
319
320 if ($this->id && $this->access) {
321 // View page
322 $viewButton = $buttonBar->makeLinkButton()
323 ->setHref('#')
324 ->setOnClick(BackendUtility::viewOnClick($this->pageinfo['uid'], '', BackendUtility::BEgetRootLine($this->pageinfo['uid'])))
325 ->setTitle($lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.showPage'))
326 ->setIcon($this->moduleTemplate->getIconFactory()->getIcon('actions-document-view', Icon::SIZE_SMALL));
327 $buttonBar->addButton($viewButton, ButtonBar::BUTTON_POSITION_LEFT, 99);
328 if ($this->extClassConf['name'] === TypoScriptTemplateInformationModuleFunctionController::class) {
329 // NEW button
330 $urlParameters = array(
331 'id' => $this->id,
332 'template' => 'all',
333 'createExtension' => 'new'
334 );
335
336 if (!empty($this->e) && !GeneralUtility::_POST('_saveandclosedok')) {
337 $saveButton = $buttonBar->makeInputButton()
338 ->setName('_savedok')
339 ->setValue('1')
340 ->setForm('TypoScriptTemplateModuleController')
341 ->setIcon($this->moduleTemplate->getIconFactory()->getIcon('actions-document-save', Icon::SIZE_SMALL))
342 ->setTitle($lang->sL('LLL:EXT:lang/locallang_core.xlf:rm.saveDoc'));
343
344 $saveAndCloseButton = $buttonBar->makeInputButton()
345 ->setName('_saveandclosedok')
346 ->setValue('1')
347 ->setForm('TypoScriptTemplateModuleController')
348 ->setTitle($lang->sL('LLL:EXT:lang/locallang_core.xlf:rm.saveCloseDoc'))
349 ->setIcon($this->moduleTemplate->getIconFactory()->getIcon('actions-document-save-close', Icon::SIZE_SMALL));
350
351 $splitButtonElement = $buttonBar->makeSplitButton()
352 ->addItem($saveButton)
353 ->addItem($saveAndCloseButton);
354
355 $buttonBar->addButton($splitButtonElement, ButtonBar::BUTTON_POSITION_LEFT, 3);
356
357 // CLOSE button
358 $closeButton = $buttonBar->makeLinkButton()
359 ->setHref(BackendUtility::getModuleUrl('web_ts', array('id' => $this->id)))
360 ->setTitle($lang->sL('LLL:EXT:lang/locallang_core.xlf:rm.closeDoc'))
361 ->setIcon($this->moduleTemplate->getIconFactory()->getIcon('actions-document-close', Icon::SIZE_SMALL));
362 $buttonBar->addButton($closeButton);
363 } else {
364 $newButton = $buttonBar->makeLinkButton()
365 ->setHref(BackendUtility::getModuleUrl('web_ts', $urlParameters))
366 ->setTitle($lang->sL('LLL:EXT:lang/locallang_core.xlf:db_new.php.pagetitle'))
367 ->setIcon($this->moduleTemplate->getIconFactory()->getIcon('actions-document-new', Icon::SIZE_SMALL));
368 $buttonBar->addButton($newButton);
369 }
370 } elseif ($this->extClassConf['name'] === TypoScriptTemplateConstantEditorModuleFunctionController::class && !empty($this->MOD_MENU['constant_editor_cat'])) {
371 // SAVE button
372 $saveButton = $buttonBar->makeInputButton()
373 ->setName('_savedok')
374 ->setValue('1')
375 ->setForm('TypoScriptTemplateModuleController')
376 ->setTitle($lang->sL('LLL:EXT:lang/locallang_core.xlf:rm.saveDoc'))
377 ->setIcon($this->moduleTemplate->getIconFactory()->getIcon('actions-document-save', Icon::SIZE_SMALL))
378 ->setShowLabelText(true);
379 $buttonBar->addButton($saveButton);
380 } elseif ($this->extClassConf['name'] === TypoScriptTemplateObjectBrowserModuleFunctionController::class) {
381 if (!empty($this->sObj)) {
382 // BACK
383 $urlParameters = array(
384 'id' => $this->id
385 );
386 $backButton = $buttonBar->makeLinkButton()
387 ->setHref(BackendUtility::getModuleUrl('web_ts', $urlParameters))
388 ->setClasses('typo3-goBack')
389 ->setTitle($lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.goBack'))
390 ->setIcon($this->moduleTemplate->getIconFactory()->getIcon('actions-view-go-back', Icon::SIZE_SMALL));
391 $buttonBar->addButton($backButton);
392 }
393 }
394 }
395 // Shortcut
396 $shortcutButton = $buttonBar->makeShortcutButton()
397 ->setModuleName($this->MCONF['name'])
398 ->setGetVariables(['id', 'M']);
399 $buttonBar->addButton($shortcutButton);
400 }
401
402 // OTHER FUNCTIONS:
403 /**
404 * Wrap title for link in template
405 *
406 * @param string $title
407 * @param string $onlyKey
408 * @return string
409 */
410 public function linkWrapTemplateTitle($title, $onlyKey = '')
411 {
412 $urlParameters = array(
413 'id' => $this->id
414 );
415 $aHref = BackendUtility::getModuleUrl('web_ts', $urlParameters);
416 if ($onlyKey) {
417 $title = '<a href="' . htmlspecialchars(($aHref . '&e[' . $onlyKey . ']=1&SET[function]=TYPO3\\CMS\\Tstemplate\\Controller\\TypoScriptTemplateInformationModuleFunctionController')) . '">' . htmlspecialchars($title) . '</a>';
418 } else {
419 $title = '<a href="' . htmlspecialchars(($aHref . '&e[constants]=1&e[config]=1&SET[function]=TYPO3\\CMS\\Tstemplate\\Controller\\TypoScriptTemplateInformationModuleFunctionController')) . '">' . htmlspecialchars($title) . '</a>';
420 }
421 return $title;
422 }
423
424 /**
425 * No template
426 *
427 * @param int $newStandardTemplate
428 * @return string
429 */
430 public function noTemplate($newStandardTemplate = 0)
431 {
432 // Defined global here!
433 /** @var ExtendedTemplateService $tmpl */
434 $tmpl = GeneralUtility::makeInstance(ExtendedTemplateService::class);
435 $GLOBALS['tmpl'] = $tmpl;
436
437 // Do not log time-performance information
438 $tmpl->tt_track = false;
439 $tmpl->init();
440
441 $lang = $this->getLanguageService();
442
443 $title = $lang->getLL('noTemplate');
444 $message = '<p>' . $lang->getLL('noTemplateDescription') . '<br />' . $lang->getLL('createTemplateToEditConfiguration') . '</p>';
445
446 $view = GeneralUtility::makeInstance(StandaloneView::class);
447 $view->setTemplatePathAndFilename(GeneralUtility::getFileAbsFileName('EXT:tstemplate/Resources/Private/Templates/InfoBox.html'));
448 $view->assignMultiple(array(
449 'title' => $title,
450 'message' => $message,
451 'state' => InfoboxViewHelper::STATE_INFO
452 ));
453 $theOutput = $view->render();
454
455 // New standard?
456 if ($newStandardTemplate) {
457 // Hook to change output, implemented for statictemplates
458 if (isset(
459 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][TypoScriptTemplateModuleController::class]['newStandardTemplateView']
460 )) {
461 $selector = '';
462 $staticsText = '';
463 $reference = array(
464 'selectorHtml' => &$selector,
465 'staticsText' => &$staticsText
466 );
467 GeneralUtility::callUserFunction(
468 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][TypoScriptTemplateModuleController::class]['newStandardTemplateView'],
469 $reference,
470 $this
471 );
472 $selector = $reference['selectorHtml'];
473 $staticsText = $reference['staticsText'];
474 } else {
475 $selector = '<input type="hidden" name="createStandard" value="" />';
476 $staticsText = '';
477 }
478 // Extension?
479 $theOutput .= '<h2>' . $lang->getLL('newWebsite', true) . $staticsText . '</h2>';
480 $theOutput .= '<div><p>' . $lang->getLL('newWebsiteDescription') . '</p>' . $selector
481 . '<input class="btn btn-primary" type="submit" form="TypoScriptTemplateModuleController" name="newWebsite" value="'
482 . $lang->getLL('newWebsiteAction') . '" /></div>';
483 }
484 // Extension?
485 $theOutput .= '<h2>' . $lang->getLL('extTemplate') . '</h2>';
486 $theOutput .= '<div><p>' . $lang->getLL('extTemplateDescription') . '</p>' . '<input class="btn btn-default" type="submit" form="TypoScriptTemplateModuleController" name="createExtension" value="' . $lang->getLL('extTemplateAction') . '" /></div>';
487
488 // Go to first appearing...
489 $first = $tmpl->ext_prevPageWithTemplate($this->id, $this->perms_clause);
490 if ($first) {
491 $urlParameters = array(
492 'id' => $first['uid']
493 );
494 $aHref = BackendUtility::getModuleUrl('web_ts', $urlParameters);
495 $theOutput .= '<h3>' . $lang->getLL('goToClosest') . '</h3>';
496 $theOutput .= '<div>' . sprintf('<p>' . $lang->getLL('goToClosestDescription') . '</p>%s' . $lang->getLL('goToClosestAction') . '%s', htmlspecialchars($first['title']), $first['uid'], '<a class="btn btn-default" href="' . htmlspecialchars($aHref) . '">', '</a>') . '</div>';
497 }
498 return $theOutput;
499 }
500
501 /**
502 * Render template menu
503 *
504 * @return string
505 */
506 public function templateMenu()
507 {
508 /** @var ExtendedTemplateService $tmpl */
509 $tmpl = GeneralUtility::makeInstance(ExtendedTemplateService::class);
510 $GLOBALS['tmpl'] = $tmpl;
511
512 // Do not log time-performance information
513 $tmpl->tt_track = false;
514 $tmpl->init();
515
516 $all = $tmpl->ext_getAllTemplates($this->id, $this->perms_clause);
517 if (count($all) > 1) {
518 $this->MOD_MENU['templatesOnPage'] = array();
519 foreach ($all as $d) {
520 $this->MOD_MENU['templatesOnPage'][$d['uid']] = $d['title'];
521 }
522 }
523 $this->MOD_SETTINGS = BackendUtility::getModuleData($this->MOD_MENU, GeneralUtility::_GP('SET'), $this->MCONF['name'], $this->modMenu_type, $this->modMenu_dontValidateList, $this->modMenu_setDefaultList);
524 return BackendUtility::getFuncMenu($this->id, 'SET[templatesOnPage]', $this->MOD_SETTINGS['templatesOnPage'], $this->MOD_MENU['templatesOnPage']);
525 }
526
527 /**
528 * Create template
529 *
530 * @param int $id
531 * @param int $actTemplateId
532 * @return string
533 */
534 public function createTemplate($id, $actTemplateId = 0)
535 {
536 $recData = array();
537 /** @var DataHandler $tce */
538 $tce = GeneralUtility::makeInstance(DataHandler::class);
539
540 if (GeneralUtility::_GP('createExtension')) {
541 $recData['sys_template']['NEW'] = array(
542 'pid' => $actTemplateId ? -1 * $actTemplateId : $id,
543 'title' => '+ext'
544 );
545 $tce->start($recData, array());
546 $tce->process_datamap();
547 } elseif (GeneralUtility::_GP('newWebsite')) {
548 // Hook to handle row data, implemented for statictemplates
549 if (isset(
550 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][TypoScriptTemplateModuleController::class]['newStandardTemplateHandler']
551 )) {
552 $reference = array(
553 'recData' => &$recData,
554 'id' => $id,
555 );
556 GeneralUtility::callUserFunction(
557 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][TypoScriptTemplateModuleController::class]['newStandardTemplateHandler'],
558 $reference,
559 $this
560 );
561 $recData = $reference['recData'];
562 } else {
563 $recData['sys_template']['NEW'] = array(
564 'pid' => $id,
565 'title' => $this->getLanguageService()->getLL('titleNewSite'),
566 'sorting' => 0,
567 'root' => 1,
568 'clear' => 3,
569 'config' => '
570 # Default PAGE object:
571 page = PAGE
572 page.10 = TEXT
573 page.10.value = HELLO WORLD!
574 '
575 );
576 }
577 $tce->start($recData, array());
578 $tce->process_datamap();
579 $tce->clear_cacheCmd('all');
580 }
581 return $tce->substNEWwithIDs['NEW'];
582 }
583
584 // RENDER LIST of pages with templates, BEGIN
585 /**
586 * Set page in array
587 *
588 * @param array $pArray
589 * @param array $rlArr
590 * @param array $row
591 * @return void
592 */
593 public function setInPageArray(&$pArray, $rlArr, $row)
594 {
595 ksort($rlArr);
596 reset($rlArr);
597 if (!$rlArr[0]['uid']) {
598 array_shift($rlArr);
599 }
600 $cEl = current($rlArr);
601 $pArray[$cEl['uid']] = htmlspecialchars($cEl['title']);
602 array_shift($rlArr);
603 if (!empty($rlArr)) {
604 if (!isset($pArray[$cEl['uid'] . '.'])) {
605 $pArray[$cEl['uid'] . '.'] = array();
606 }
607 $this->setInPageArray($pArray[$cEl['uid'] . '.'], $rlArr, $row);
608 } else {
609 $pArray[$cEl['uid'] . '_'] = $row;
610 }
611 }
612
613 /**
614 * Render the list
615 *
616 * @param array $pArray
617 * @param array $lines
618 * @param int $c
619 * @return array
620 */
621 public function renderList($pArray, $lines = array(), $c = 0)
622 {
623 if (!is_array($pArray)) {
624 return $lines;
625 }
626
627 $statusCheckedIcon = $this->moduleTemplate->getIconFactory()->getIcon('status-status-checked', Icon::SIZE_SMALL)->render();
628 foreach ($pArray as $k => $v) {
629 if (MathUtility::canBeInterpretedAsInteger($k)) {
630 if (isset($pArray[$k . '_'])) {
631 $lines[] = '<tr>
632 <td nowrap><span style="width: 1px; height: 1px; display:inline-block; margin-left: ' . $c * 20 . 'px"></span>' . '<a href="' . htmlspecialchars(GeneralUtility::linkThisScript(array('id' => $k))) . '" title="' . htmlspecialchars('ID: ' . $k) . '">' . $this->moduleTemplate->getIconFactory()->getIconForRecord('pages', BackendUtility::getRecordWSOL('pages', $k), Icon::SIZE_SMALL)->render() . ' ' . GeneralUtility::fixed_lgd_cs($pArray[$k], 30) . '</a></td>
633 <td>' . $pArray[$k . '_']['count'] . '</td>
634 <td>' . ($pArray[$k . '_']['root_max_val'] > 0 ? $statusCheckedIcon : '') . '</td>
635 <td>' . ($pArray[$k . '_']['root_min_val'] == 0 ? $statusCheckedIcon : '') . '</td>
636 </tr>';
637 } else {
638 $lines[] = '<tr>
639 <td nowrap><span style="width: 1px; height: 1px; display:inline-block; margin-left: ' . $c * 20 . 'px"></span>' . $this->moduleTemplate->getIconFactory()->getIconForRecord('pages', BackendUtility::getRecordWSOL('pages', $k), Icon::SIZE_SMALL)->render() . GeneralUtility::fixed_lgd_cs($pArray[$k], 30) . '</td>
640 <td></td>
641 <td></td>
642 <td></td>
643 </tr>';
644 }
645 $lines = $this->renderList($pArray[$k . '.'], $lines, $c + 1);
646 }
647 }
648 return $lines;
649 }
650 }