2 namespace TYPO3\CMS\Tstemplate\Controller;
59 $templateService->tt_track =
false;
61 $templateService->init();
66 $GLOBALS[
'tplRow'] = $templateService->ext_getFirstTemplate($pageId, $template_uid);
71 $rootLine = $sys_page->getRootLine($pageId);
73 $templateService->runThroughTemplates($rootLine, $template_uid);
75 $GLOBALS[
'theConstants'] = $templateService->generateConfig_constants();
77 $templateService->ext_categorizeEditableConstants(
$GLOBALS[
'theConstants']);
79 $templateService->ext_regObjectPositions(
$GLOBALS[
'tplRow'][
'constants']);
94 if ($templateService->helpConfig[
'imagetag'] || $templateService->helpConfig[
'description'] || $templateService->helpConfig[
'header']) {
95 $theOutput .=
'<div style="padding-top: 30px;"></div>';
96 $theOutput .=
'<div>' . htmlspecialchars($templateService->helpConfig[
'header'])
97 .
'<div align="center">' . $templateService->helpConfig[
'imagetag'] .
'</div><br>'
98 . ($templateService->helpConfig[
'description'] ? implode(explode(
'//', $templateService->helpConfig[
'description']),
'<br>') .
'<br>' :
'')
99 . ($templateService->helpConfig[
'bulletlist'] ?
'<ul><li>' . implode(explode(
'//', $templateService->helpConfig[
'bulletlist']),
'<li>') .
'</ul>' :
'<br>')
114 $lang->includeLLFile(
'EXT:tstemplate/Resources/Private/Language/locallang_ceditor.xlf');
117 $this->pObj->createTemplate($this->pObj->id);
119 $manyTemplatesMenu = $this->pObj->templateMenu();
121 if ($manyTemplatesMenu) {
122 $template_uid = $this->pObj->MOD_SETTINGS[
'templatesOnPage'];
127 if ($existTemplate) {
132 $this->
getPageRenderer()->loadRequireJsModule(
'TYPO3/CMS/Tstemplate/ConstantEditor');
133 $saveId = $tplRow[
'_ORIG_uid'] ? $tplRow[
'_ORIG_uid'] : $tplRow[
'uid'];
136 $templateService->changed = 0;
138 if ($templateService->changed) {
141 $recData[
'sys_template'][$saveId][
'constants'] = implode($templateService->raw, LF);
144 $tce->stripslashes_values =
false;
145 $tce->start($recData, array());
146 $tce->process_datamap();
148 $tce->clear_cacheCmd(
'all');
158 $this->pObj->MOD_MENU[
'constant_editor_cat'] = $templateService->ext_getCategoryLabelArray();
162 $content = $iconFactory->getIconForRecord(
'sys_template', $tplRow,
Icon::SIZE_SMALL)->render() .
'<strong>' . $this->pObj->linkWrapTemplateTitle($tplRow[
'title'],
'constants') .
'</strong>' . (trim($tplRow[
'sitetitle']) ? htmlspecialchars(
' (' . $tplRow[
'sitetitle'] .
')') :
'');
163 $theOutput .=
'<h2>' .
$lang->getLL(
'editConstants',
true) .
'</h2><div>' . $content .
'</div>';
164 if ($manyTemplatesMenu) {
165 $theOutput .=
'<div>' . $manyTemplatesMenu .
'</div>';
167 $theOutput .=
'<div style="padding-top: 10px;"></div>';
168 if (!empty($this->pObj->MOD_MENU[
'constant_editor_cat'])) {
169 $menu =
'<div class="form-inline form-inline-spaced">';
170 $menu .=
BackendUtility::getDropdownMenu($this->pObj->id,
'SET[constant_editor_cat]', $this->pObj->MOD_SETTINGS[
'constant_editor_cat'], $this->pObj->MOD_MENU[
'constant_editor_cat']);
172 $theOutput .=
'<h3>' .
$lang->getLL(
'category',
true) .
'</h3><div><span class="text-nowrap">' . $menu .
'</span></div>';
174 $theOutput .=
'<h3>' . $iconFactory->getIcon(
'status-dialog-notification',
Icon::SIZE_SMALL)->render() .
$lang->getLL(
'noConstants',
true) .
'</h3><div>' .
$lang->getLL(
'noConstantsDescription',
true) .
'</div>';
176 $theOutput .=
'<div style="padding-top: 15px;"></div>';
178 $category = $this->pObj->MOD_SETTINGS[
'constant_editor_cat'];
179 $templateService->ext_getTSCE_config($category);
181 $printFields = trim($templateService->ext_printFields($theConstants, $category));
183 $theOutput .=
'<div>' . $printFields .
'</div>';
186 if ($BE_USER_modOptions[
'properties'][
'constantEditor.'][
'example'] !=
'top') {
190 $theOutput .= $this->pObj->noTemplate(1);