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