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