‪TYPO3CMS  ‪main
ConstantEditorController.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
19 
20 use Psr\Http\Message\ResponseInterface;
21 use Psr\Http\Message\ServerRequestInterface;
25 use TYPO3\CMS\Backend\Utility\BackendUtility;
28 use TYPO3\CMS\Core\Imaging\IconSize;
41 
47 #[AsController]
49 {
50  public function ‪__construct(
51  protected readonly ‪ModuleTemplateFactory $moduleTemplateFactory,
52  private readonly ‪SysTemplateRepository $sysTemplateRepository,
53  private readonly ‪SysTemplateTreeBuilder $treeBuilder,
54  private readonly ‪IncludeTreeTraverser $treeTraverser,
55  private readonly ‪AstTraverser $astTraverser,
56  private readonly ‪AstBuilderInterface $astBuilder,
57  private readonly ‪LosslessTokenizer $losslessTokenizer,
58  ) {}
59 
60  public function ‪handleRequest(ServerRequestInterface $request): ResponseInterface
61  {
62  $queryParams = $request->getQueryParams();
63  $parsedBody = $request->getParsedBody();
64 
65  $pageUid = (int)($queryParams['id'] ?? 0);
66  if ($pageUid === 0) {
67  // Redirect to template record overview if on page 0.
68  return new ‪RedirectResponse($this->uriBuilder->buildUriFromRoute('web_typoscript_recordsoverview'));
69  }
70 
71  if (($parsedBody['action'] ?? '') === 'createExtensionTemplate') {
72  return $this->‪createExtensionTemplateAction($request, 'web_typoscript_constanteditor');
73  }
74  if (($parsedBody['action'] ?? '') === 'createNewWebsiteTemplate') {
75  return $this->‪createNewWebsiteTemplateAction($request, 'web_typoscript_constanteditor');
76  }
77  if (($parsedBody['_savedok'] ?? false) === '1') {
78  return $this->‪saveAction($request);
79  }
80 
81  $pageUid = (int)($queryParams['id'] ?? 0);
82  $allTemplatesOnPage = $this->‪getAllTemplateRecordsOnPage($pageUid);
83  if (empty($allTemplatesOnPage)) {
84  return $this->‪noTemplateAction($request);
85  }
86 
87  return $this->‪showAction($request);
88  }
89 
90  private function ‪showAction(ServerRequestInterface $request): ResponseInterface
91  {
92  $queryParams = $request->getQueryParams();
93  $parsedBody = $request->getParsedBody();
94 
95  $languageService = $this->‪getLanguageService();
96  $backendUser = $this->‪getBackendUser();
97 
98  $pageUid = (int)($queryParams['id'] ?? 0);
99 
100  $currentModule = $request->getAttribute('module');
101  $currentModuleIdentifier = $currentModule->getIdentifier();
102  $moduleData = $request->getAttribute('moduleData');
103  if ($moduleData->cleanUp([])) {
104  $backendUser->pushModuleData($currentModuleIdentifier, $moduleData->toArray());
105  }
106 
107  $pageRecord = BackendUtility::readPageAccess($pageUid, '1=1') ?: [];
108  if (empty($pageRecord)) {
109  // Redirect to records overview if page could not be determined.
110  // Edge case if page has been removed meanwhile.
111  BackendUtility::setUpdateSignal('updatePageTree');
112  return new ‪RedirectResponse($this->uriBuilder->buildUriFromRoute('web_typoscript_recordsoverview'));
113  }
114 
115  // Template selection handling for this page
116  $allTemplatesOnPage = $this->‪getAllTemplateRecordsOnPage($pageUid);
117  $selectedTemplateFromModuleData = (array)$moduleData->get('selectedTemplatePerPage');
118  $selectedTemplateUid = (int)($parsedBody['selectedTemplate'] ?? $selectedTemplateFromModuleData[$pageUid] ?? 0);
119  if (!in_array($selectedTemplateUid, array_column($allTemplatesOnPage, 'uid'))) {
120  $selectedTemplateUid = (int)($allTemplatesOnPage[0]['uid'] ?? 0);
121  }
122  if (($moduleData->get('selectedTemplatePerPage')[$pageUid] ?? 0) !== $selectedTemplateUid) {
123  $selectedTemplateFromModuleData[$pageUid] = $selectedTemplateUid;
124  $moduleData->set('selectedTemplatePerPage', $selectedTemplateFromModuleData);
125  $backendUser->pushModuleData($currentModuleIdentifier, $moduleData->toArray());
126  }
127  $templateTitle = '';
128  $currentTemplateConstants = '';
129  foreach ($allTemplatesOnPage as $templateRow) {
130  if ((int)$templateRow['uid'] === $selectedTemplateUid) {
131  $templateTitle = $templateRow['title'];
132  $currentTemplateConstants = $templateRow['constants'] ?? '';
133  }
134  }
135 
136  // Build the constant include tree
137  $rootLine = GeneralUtility::makeInstance(RootlineUtility::class, $pageUid)->get();
138  $sysTemplateRows = $this->sysTemplateRepository->getSysTemplateRowsByRootlineWithUidOverride($rootLine, $request, $selectedTemplateUid);
139  $site = $request->getAttribute('site');
140  $constantIncludeTree = $this->treeBuilder->getTreeBySysTemplateRowsAndSite('constants', $sysTemplateRows, $this->losslessTokenizer, $site);
141  $constantAstBuilderVisitor = GeneralUtility::makeInstance(IncludeTreeCommentAwareAstBuilderVisitor::class);
142  $this->treeTraverser->traverse($constantIncludeTree, [$constantAstBuilderVisitor]);
143  $constantAst = $constantAstBuilderVisitor->getAst();
144  $astConstantCommentVisitor = GeneralUtility::makeInstance(AstConstantCommentVisitor::class);
145  $currentTemplateFlatConstants = $this->astBuilder->build($this->losslessTokenizer->tokenize($currentTemplateConstants), new ‪RootNode())->flatten();
146  $astConstantCommentVisitor->setCurrentTemplateFlatConstants($currentTemplateFlatConstants);
147  $this->astTraverser->traverse($constantAst, [$astConstantCommentVisitor]);
148 
149  $constants = $astConstantCommentVisitor->getConstants();
150  $categories = $astConstantCommentVisitor->getCategories();
151 
152  $relevantCategories = [];
153  foreach ($categories as $categoryKey => $aCategory) {
154  if ($aCategory['usageCount'] > 0) {
155  $relevantCategories[$categoryKey] = $aCategory;
156  }
157  }
158  $selectedCategory = array_key_first($relevantCategories) ?? '';
159  $selectedCategoryFromModuleData = (string)$moduleData->get('selectedCategory');
160  if (array_key_exists($selectedCategoryFromModuleData, $relevantCategories)) {
161  $selectedCategory = $selectedCategoryFromModuleData;
162  }
163  if (($parsedBody['selectedCategory'] ?? '') && array_key_exists($parsedBody['selectedCategory'], $relevantCategories)) {
164  $selectedCategory = (string)$parsedBody['selectedCategory'];
165  }
166  if ($selectedCategory && $selectedCategory !== $selectedCategoryFromModuleData) {
167  $moduleData->set('selectedCategory', $selectedCategory);
168  $backendUser->pushModuleData($currentModuleIdentifier, $moduleData->toArray());
169  }
170 
171  $displayConstants = [];
172  foreach ($constants as $constant) {
173  if ($constant['cat'] === $selectedCategory) {
174  $displayConstants[$constant['subcat_sorting_first']]['label'] = $constant['subcat_label'];
175  $displayConstants[$constant['subcat_sorting_first']]['items'][$constant['subcat_sorting_second']][] = $constant;
176  }
177  }
178  ksort($displayConstants);
179  foreach ($displayConstants as &$constant) {
180  ksort($constant['items']);
181  }
182 
183  $view = $this->moduleTemplateFactory->create($request);
184  $view->setTitle($languageService->sL($currentModule->getTitle()), $pageRecord['title']);
185  $view->getDocHeaderComponent()->setMetaInformation($pageRecord);
186  $this->‪addPreviewButtonToDocHeader($view, $pageUid, (int)$pageRecord['doktype']);
187  $this->‪addShortcutButtonToDocHeader($view, $currentModuleIdentifier, $pageRecord, $pageUid);
188  if (!empty($relevantCategories)) {
189  $this->‪addSaveButtonToDocHeader($view);
190  }
191  $view->makeDocHeaderModuleMenu(['id' => $pageUid]);
192  $view->assignMultiple([
193  'templateTitle' => $templateTitle,
194  'pageUid' => $pageUid,
195  'allTemplatesOnPage' => $allTemplatesOnPage,
196  'selectedTemplateUid' => $selectedTemplateUid,
197  'relevantCategories' => $relevantCategories,
198  'selectedCategory' => $selectedCategory,
199  'displayConstants' => $displayConstants,
200  ]);
201  return $view->renderResponse('ConstantEditorMain');
202  }
203 
204  private function ‪saveAction(ServerRequestInterface $request): ResponseInterface
205  {
206  $queryParams = $request->getQueryParams();
207  $moduleData = $request->getAttribute('moduleData');
208 
209  $pageUid = (int)($queryParams['id'] ?? 0);
210  if ($pageUid === 0) {
211  throw new \RuntimeException('No proper page uid given', 1661333862);
212  }
213 
214  $allTemplatesOnPage = $this->‪getAllTemplateRecordsOnPage($pageUid);
215  $selectedTemplateFromModuleData = (array)$moduleData->get('selectedTemplatePerPage');
216  $selectedTemplateUid = (int)($selectedTemplateFromModuleData[$pageUid] ?? 0);
217  $templateRow = null;
218  foreach ($allTemplatesOnPage as $template) {
219  if ($selectedTemplateUid === (int)$template['uid']) {
220  $templateRow = $template;
221  }
222  }
223  if (!in_array($selectedTemplateUid, array_column($allTemplatesOnPage, 'uid'))) {
224  $templateRow = $allTemplatesOnPage[0] ?? [];
225  $selectedTemplateUid = (int)($templateRow['uid'] ?? 0);
226  }
227  if ($selectedTemplateUid < 1) {
228  throw new \RuntimeException('No template found on page', 1661350211);
229  }
230 
231  $rootLine = GeneralUtility::makeInstance(RootlineUtility::class, $pageUid)->get();
232  $site = $request->getAttribute('site');
233  $sysTemplateRows = $this->sysTemplateRepository->getSysTemplateRowsByRootlineWithUidOverride($rootLine, $request, $selectedTemplateUid);
234  $constantIncludeTree = $this->treeBuilder->getTreeBySysTemplateRowsAndSite('constants', $sysTemplateRows, $this->losslessTokenizer, $site);
235  $constantAstBuilderVisitor = GeneralUtility::makeInstance(IncludeTreeCommentAwareAstBuilderVisitor::class);
236  $this->treeTraverser->traverse($constantIncludeTree, [$constantAstBuilderVisitor]);
237  $constantAst = $constantAstBuilderVisitor->getAst();
238  $astConstantCommentVisitor = GeneralUtility::makeInstance(AstConstantCommentVisitor::class);
239  $this->astTraverser->traverse($constantAst, [$astConstantCommentVisitor]);
240 
241  $constants = $astConstantCommentVisitor->getConstants();
242  $updatedTemplateConstantsArray = $this->‪updateTemplateConstants($request, $constants, $templateRow['constants'] ?? '');
243  if ($updatedTemplateConstantsArray) {
244  $templateUid = empty($templateRow['_ORIG_uid']) ? $templateRow['uid'] : $templateRow['_ORIG_uid'];
245  $recordData = [];
246  $recordData['sys_template'][$templateUid]['constants'] = implode(LF, $updatedTemplateConstantsArray);
247  ‪$dataHandler = GeneralUtility::makeInstance(DataHandler::class);
248  ‪$dataHandler->‪start($recordData, []);
250  }
251 
252  return new ‪RedirectResponse($this->uriBuilder->buildUriFromRoute('web_typoscript_constanteditor', ['id' => $pageUid]));
253  }
254 
255  private function ‪noTemplateAction(ServerRequestInterface $request): ResponseInterface
256  {
257  $languageService = $this->‪getLanguageService();
258  $currentModule = $request->getAttribute('module');
259  $currentModuleIdentifier = $currentModule->getIdentifier();
260  $pageUid = (int)($request->getQueryParams()['id'] ?? 0);
261  if ($pageUid === 0) {
262  throw new \RuntimeException('No proper page uid given', 1661365944);
263  }
264  $pageRecord = BackendUtility::readPageAccess($pageUid, '1=1') ?: [];
265  if (empty($pageRecord)) {
266  // Redirect to records overview if page could not be determined.
267  // Edge case if page has been removed meanwhile.
268  BackendUtility::setUpdateSignal('updatePageTree');
269  return new ‪RedirectResponse($this->uriBuilder->buildUriFromRoute('web_typoscript_recordsoverview'));
270  }
271 
272  $view = $this->moduleTemplateFactory->create($request);
273  $view->setTitle($languageService->sL($currentModule->getTitle()), $pageRecord['title']);
274  $view->getDocHeaderComponent()->setMetaInformation($pageRecord);
275  $this->‪addPreviewButtonToDocHeader($view, $pageUid, (int)$pageRecord['doktype']);
276  $view->makeDocHeaderModuleMenu(['id' => $pageUid]);
277  $view->assignMultiple([
278  'pageUid' => $pageUid,
279  'moduleIdentifier' => $currentModuleIdentifier,
280  'previousPage' => $this->‪getClosestAncestorPageWithTemplateRecord($pageUid),
281  ]);
282  return $view->renderResponse('ConstantEditorNoTemplate');
283  }
284 
285  private function ‪updateTemplateConstants(ServerRequestInterface $request, array $constantDefinitions, string $rawTemplateConstants): ?array
286  {
287  $rawTemplateConstantsArray = explode(LF, $rawTemplateConstants);
288  $constantPositions = $this->‪calculateConstantPositions($rawTemplateConstantsArray);
289 
290  $parsedBody = $request->getParsedBody();
291  $data = $parsedBody['data'] ?? null;
292  $check = $parsedBody['check'] ?? [];
293 
294  $valuesHaveChanged = false;
295  if (is_array($data)) {
296  foreach ($data as $key => $value) {
297  if (!isset($constantDefinitions[$key])) {
298  // Ignore if there is no constant definition for this constant key
299  continue;
300  }
301  if (!isset($check[$key]) || ($check[$key] !== 'checked' && isset($constantPositions[$key]))) {
302  // Remove value if the checkbox is not set, indicating "value to be dropped from template"
303  $rawTemplateConstantsArray = $this->‪removeValueFromConstantsArray($rawTemplateConstantsArray, $constantPositions, $key);
304  $valuesHaveChanged = true;
305  continue;
306  }
307  if ($check[$key] !== 'checked') {
308  // Don't process if this value is not set
309  continue;
310  }
311  $constantDefinition = $constantDefinitions[$key];
312  switch ($constantDefinition['type']) {
313  case 'int':
314  $min = $constantDefinition['typeIntMin'] ?? PHP_INT_MIN;
315  $max = $constantDefinition['typeIntMax'] ?? PHP_INT_MAX;
316  $value = (string)‪MathUtility::forceIntegerInRange((int)$value, (int)$min, (int)$max);
317  break;
318  case 'int+':
319  $min = $constantDefinition['typeIntMin'] ?? 0;
320  $max = $constantDefinition['typeIntMax'] ?? PHP_INT_MAX;
321  $value = (string)‪MathUtility::forceIntegerInRange((int)$value, (int)$min, (int)$max);
322  break;
323  case 'color':
324  $col = [];
325  if ($value) {
326  $value = preg_replace('/[^A-Fa-f0-9]*/', '', $value) ?? '';
327  $useFulHex = strlen($value) > 3;
328  $col[] = (int)hexdec($value[0]);
329  $col[] = (int)hexdec($value[1]);
330  $col[] = (int)hexdec($value[2]);
331  if ($useFulHex) {
332  $col[] = (int)hexdec($value[3]);
333  $col[] = (int)hexdec($value[4]);
334  $col[] = (int)hexdec($value[5]);
335  }
336  $value = substr('0' . dechex($col[0]), -1) . substr('0' . dechex($col[1]), -1) . substr('0' . dechex($col[2]), -1);
337  if ($useFulHex) {
338  $value .= substr('0' . dechex($col[3]), -1) . substr('0' . dechex($col[4]), -1) . substr('0' . dechex($col[5]), -1);
339  }
340  $value = '#' . strtoupper($value);
341  }
342  break;
343  case 'comment':
344  if ($value) {
345  $value = '';
346  } else {
347  $value = '#';
348  }
349  break;
350  case 'wrap':
351  if (($data[$key]['left'] ?? false) || $data[$key]['right']) {
352  $value = $data[$key]['left'] . '|' . $data[$key]['right'];
353  } else {
354  $value = '';
355  }
356  break;
357  case 'offset':
358  $value = rtrim(implode(',', $value), ',');
359  if (trim($value, ',') === '') {
360  $value = '';
361  }
362  break;
363  case 'boolean':
364  if ($value) {
365  $value = ($constantDefinition['trueValue'] ?? false) ?: '1';
366  }
367  break;
368  }
369  if ((string)($constantDefinition['value'] ?? '') !== (string)$value) {
370  // Put value in, if changed.
371  $rawTemplateConstantsArray = $this->‪addOrUpdateValueInConstantsArray($rawTemplateConstantsArray, $constantPositions, $key, $value);
372  $valuesHaveChanged = true;
373  }
374  }
375  }
376  if ($valuesHaveChanged) {
377  return $rawTemplateConstantsArray;
378  }
379  return null;
380  }
381 
383  array $rawTemplateConstantsArray,
384  array &$constantPositions = [],
385  string $prefix = '',
386  int $braceLevel = 0,
387  int &$lineCounter = 0
388  ): array {
389  while (isset($rawTemplateConstantsArray[$lineCounter])) {
390  $line = ltrim($rawTemplateConstantsArray[$lineCounter]);
391  $lineCounter++;
392  if (!$line || $line[0] === '[') {
393  // Ignore empty lines and conditions
394  continue;
395  }
396  if (strcspn($line, '}#/') !== 0) {
397  $operatorPosition = strcspn($line, ' {=<');
398  $key = substr($line, 0, $operatorPosition);
399  $line = ltrim(substr($line, $operatorPosition));
400  if ($line[0] === '=') {
401  $constantPositions[$prefix . $key] = $lineCounter - 1;
402  } elseif ($line[0] === '{') {
403  $braceLevel++;
404  $this->‪calculateConstantPositions($rawTemplateConstantsArray, $constantPositions, $prefix . $key . '.', $braceLevel, $lineCounter);
405  }
406  } elseif ($line[0] === '}') {
407  $braceLevel--;
408  if ($braceLevel < 0) {
409  $braceLevel = 0;
410  } else {
411  // Leaving this brace level: Force return to caller recursion
412  break;
413  }
414  }
415  }
416  return $constantPositions;
417  }
418 
423  private function ‪addOrUpdateValueInConstantsArray(array $templateConstantsArray, array $constantPositions, string $constantKey, string $value): array
424  {
425  $theValue = ' ' . trim($value);
426  if (isset($constantPositions[$constantKey])) {
427  $lineNum = $constantPositions[$constantKey];
428  $parts = explode('=', $templateConstantsArray[$lineNum], 2);
429  if (count($parts) === 2) {
430  $parts[1] = $theValue;
431  }
432  $templateConstantsArray[$lineNum] = implode('=', $parts);
433  } else {
434  $templateConstantsArray[] = $constantKey . ' =' . $theValue;
435  }
436  return $templateConstantsArray;
437  }
438 
442  private function ‪removeValueFromConstantsArray(array $templateConstantsArray, array $constantPositions, string $constantKey): array
443  {
444  if (isset($constantPositions[$constantKey])) {
445  $lineNum = $constantPositions[$constantKey];
446  unset($templateConstantsArray[$lineNum]);
447  }
448  return $templateConstantsArray;
449  }
450 
451  private function ‪addSaveButtonToDocHeader(‪ModuleTemplate $view): void
452  {
453  $languageService = $this->‪getLanguageService();
454  $buttonBar = $view->‪getDocHeaderComponent()->getButtonBar();
455  $saveButton = $buttonBar->makeInputButton()
456  ->setName('_savedok')
457  ->setValue('1')
458  ->setForm('TypoScriptConstantEditorController')
459  ->setTitle($languageService->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:rm.saveDoc'))
460  ->setIcon($this->iconFactory->getIcon('actions-document-save', IconSize::SMALL))
461  ->setShowLabelText(true);
462  $buttonBar->addButton($saveButton);
463  }
464 
465  private function ‪addShortcutButtonToDocHeader(‪ModuleTemplate $view, string $moduleIdentifier, array $pageInfo, int $pageUid): void
466  {
467  $languageService = $this->‪getLanguageService();
468  $buttonBar = $view->‪getDocHeaderComponent()->getButtonBar();
469  $shortcutTitle = sprintf(
470  '%s: %s [%d]',
471  $languageService->sL('LLL:EXT:tstemplate/Resources/Private/Language/locallang_ceditor.xlf:submodule.title'),
472  BackendUtility::getRecordTitle('pages', $pageInfo),
473  $pageUid
474  );
475  $shortcutButton = $buttonBar->makeShortcutButton()
476  ->setRouteIdentifier($moduleIdentifier)
477  ->setDisplayName($shortcutTitle)
478  ->setArguments(['id' => $pageUid]);
479  $buttonBar->addButton($shortcutButton);
480  }
481 }
‪TYPO3\CMS\Core\DataHandling\DataHandler
Definition: DataHandler.php:94
‪TYPO3\CMS\Core\TypoScript\IncludeTree\SysTemplateRepository
Definition: SysTemplateRepository.php:38
‪TYPO3\CMS\Tstemplate\Controller\AbstractTemplateModuleController\$dataHandler
‪DataHandler $dataHandler
Definition: AbstractTemplateModuleController.php:50
‪TYPO3\CMS\Tstemplate\Controller\ConstantEditorController\saveAction
‪saveAction(ServerRequestInterface $request)
Definition: ConstantEditorController.php:204
‪TYPO3\CMS\Tstemplate\Controller\AbstractTemplateModuleController\createExtensionTemplateAction
‪createExtensionTemplateAction(ServerRequestInterface $request, string $redirectTarget)
Definition: AbstractTemplateModuleController.php:75
‪TYPO3\CMS\Core\TypoScript\Tokenizer\LosslessTokenizer
Definition: LosslessTokenizer.php:61
‪TYPO3\CMS\Tstemplate\Controller\ConstantEditorController\addShortcutButtonToDocHeader
‪addShortcutButtonToDocHeader(ModuleTemplate $view, string $moduleIdentifier, array $pageInfo, int $pageUid)
Definition: ConstantEditorController.php:465
‪TYPO3\CMS\Tstemplate\Controller\ConstantEditorController\removeValueFromConstantsArray
‪removeValueFromConstantsArray(array $templateConstantsArray, array $constantPositions, string $constantKey)
Definition: ConstantEditorController.php:442
‪TYPO3\CMS\Core\TypoScript\IncludeTree\Visitor\IncludeTreeCommentAwareAstBuilderVisitor
Definition: IncludeTreeCommentAwareAstBuilderVisitor.php:41
‪TYPO3\CMS\Tstemplate\Controller\ConstantEditorController\handleRequest
‪handleRequest(ServerRequestInterface $request)
Definition: ConstantEditorController.php:60
‪TYPO3\CMS\Backend\Template\ModuleTemplateFactory
Definition: ModuleTemplateFactory.php:33
‪TYPO3\CMS\Tstemplate\Controller\ConstantEditorController\calculateConstantPositions
‪calculateConstantPositions(array $rawTemplateConstantsArray, array &$constantPositions=[], string $prefix='', int $braceLevel=0, int &$lineCounter=0)
Definition: ConstantEditorController.php:382
‪TYPO3\CMS\Tstemplate\Controller\AbstractTemplateModuleController\getClosestAncestorPageWithTemplateRecord
‪getClosestAncestorPageWithTemplateRecord(int $pageId)
Definition: AbstractTemplateModuleController.php:154
‪TYPO3\CMS\Core\TypoScript\IncludeTree\Traverser\IncludeTreeTraverser
Definition: IncludeTreeTraverser.php:30
‪TYPO3\CMS\Core\Utility\RootlineUtility
Definition: RootlineUtility.php:40
‪TYPO3\CMS\Tstemplate\Controller
Definition: AbstractTemplateModuleController.php:18
‪TYPO3\CMS\Tstemplate\Controller\ConstantEditorController\noTemplateAction
‪noTemplateAction(ServerRequestInterface $request)
Definition: ConstantEditorController.php:255
‪TYPO3\CMS\Tstemplate\Controller\ConstantEditorController\addOrUpdateValueInConstantsArray
‪addOrUpdateValueInConstantsArray(array $templateConstantsArray, array $constantPositions, string $constantKey, string $value)
Definition: ConstantEditorController.php:423
‪TYPO3\CMS\Tstemplate\Controller\AbstractTemplateModuleController\getAllTemplateRecordsOnPage
‪getAllTemplateRecordsOnPage(int $pageId)
Definition: AbstractTemplateModuleController.php:168
‪TYPO3\CMS\Backend\Template\ModuleTemplate
Definition: ModuleTemplate.php:46
‪TYPO3\CMS\Tstemplate\Controller\ConstantEditorController\updateTemplateConstants
‪updateTemplateConstants(ServerRequestInterface $request, array $constantDefinitions, string $rawTemplateConstants)
Definition: ConstantEditorController.php:285
‪TYPO3\CMS\Tstemplate\Controller\AbstractTemplateModuleController
Definition: AbstractTemplateModuleController.php:46
‪TYPO3\CMS\Tstemplate\Controller\ConstantEditorController\__construct
‪__construct(protected readonly ModuleTemplateFactory $moduleTemplateFactory, private readonly SysTemplateRepository $sysTemplateRepository, private readonly SysTemplateTreeBuilder $treeBuilder, private readonly IncludeTreeTraverser $treeTraverser, private readonly AstTraverser $astTraverser, private readonly AstBuilderInterface $astBuilder, private readonly LosslessTokenizer $losslessTokenizer,)
Definition: ConstantEditorController.php:50
‪TYPO3\CMS\Tstemplate\Controller\AbstractTemplateModuleController\getBackendUser
‪getBackendUser()
Definition: AbstractTemplateModuleController.php:226
‪TYPO3\CMS\Core\DataHandling\DataHandler\start
‪start(array $dataMap, array $commandMap, ?BackendUserAuthentication $backendUser=null)
Definition: DataHandler.php:517
‪TYPO3\CMS\Tstemplate\Controller\ConstantEditorController\addSaveButtonToDocHeader
‪addSaveButtonToDocHeader(ModuleTemplate $view)
Definition: ConstantEditorController.php:451
‪TYPO3\CMS\Core\TypoScript\AST\AstBuilderInterface
Definition: AstBuilderInterface.php:34
‪TYPO3\CMS\Core\Http\RedirectResponse
Definition: RedirectResponse.php:30
‪TYPO3\CMS\Tstemplate\Controller\ConstantEditorController\showAction
‪showAction(ServerRequestInterface $request)
Definition: ConstantEditorController.php:90
‪TYPO3\CMS\Tstemplate\Controller\AbstractTemplateModuleController\getLanguageService
‪getLanguageService()
Definition: AbstractTemplateModuleController.php:221
‪TYPO3\CMS\Backend\Template\ModuleTemplate\getDocHeaderComponent
‪getDocHeaderComponent()
Definition: ModuleTemplate.php:181
‪TYPO3\CMS\Core\TypoScript\AST\Node\RootNode
Definition: RootNode.php:26
‪TYPO3\CMS\Tstemplate\Controller\AbstractTemplateModuleController\createNewWebsiteTemplateAction
‪createNewWebsiteTemplateAction(ServerRequestInterface $request, string $redirectTarget)
Definition: AbstractTemplateModuleController.php:93
‪TYPO3\CMS\Core\Utility\MathUtility
Definition: MathUtility.php:24
‪TYPO3\CMS\Backend\Attribute\AsController
Definition: AsController.php:25
‪TYPO3\CMS\Core\Utility\MathUtility\forceIntegerInRange
‪static int forceIntegerInRange(mixed $theInt, int $min, int $max=2000000000, int $defaultValue=0)
Definition: MathUtility.php:34
‪TYPO3\CMS\Tstemplate\Controller\AbstractTemplateModuleController\addPreviewButtonToDocHeader
‪addPreviewButtonToDocHeader(ModuleTemplate $view, int $pageId, int $dokType)
Definition: AbstractTemplateModuleController.php:117
‪TYPO3\CMS\Core\TypoScript\AST\Traverser\AstTraverser
Definition: AstTraverser.php:31
‪TYPO3\CMS\Core\DataHandling\DataHandler\process_datamap
‪bool void process_datamap()
Definition: DataHandler.php:708
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:52
‪TYPO3\CMS\Core\TypoScript\IncludeTree\SysTemplateTreeBuilder
Definition: SysTemplateTreeBuilder.php:72
‪TYPO3\CMS\Tstemplate\Controller\ConstantEditorController
Definition: ConstantEditorController.php:49
‪TYPO3\CMS\Core\TypoScript\AST\Visitor\AstConstantCommentVisitor
Definition: AstConstantCommentVisitor.php:35