diff --git a/typo3/sysext/core/Classes/TypoScript/AST/Visitor/AstConstantCommentVisitor.php b/typo3/sysext/core/Classes/TypoScript/AST/Visitor/AstConstantCommentVisitor.php index 23f84d438010916fdc0d274dbb7e92505c33e29a..0f0c9b3597eb54aae0f7981f26112d232765867a 100644 --- a/typo3/sysext/core/Classes/TypoScript/AST/Visitor/AstConstantCommentVisitor.php +++ b/typo3/sysext/core/Classes/TypoScript/AST/Visitor/AstConstantCommentVisitor.php @@ -455,7 +455,7 @@ final class AstConstantCommentVisitor implements AstVisitorInterface ) { return; } - $categoryKey = $customCategoryArray[1]; + $categoryKey = strtolower($customCategoryArray[1]); $categoryLabel = $customCategoryArray[2]; if (!isset($this->categories[$categoryKey])) { $this->categories[$categoryKey] = [ @@ -474,7 +474,7 @@ final class AstConstantCommentVisitor implements AstVisitorInterface ) { return; } - $subCategoryKey = $customSubCategoryArray[1]; + $subCategoryKey = strtolower($customSubCategoryArray[1]); $subCategoryLabel = $customSubCategoryArray[2]; if (!isset($this->subCategories[$subCategoryKey])) { $this->subCategories[$subCategoryKey] = [ diff --git a/typo3/sysext/tstemplate/Classes/Controller/ConstantEditorController.php b/typo3/sysext/tstemplate/Classes/Controller/ConstantEditorController.php index 7344bfaa3e4bd90d88ce54f107c4b1313291a88b..b19ec1faaa09bc589e6ad1f641db0b574b504c83 100644 --- a/typo3/sysext/tstemplate/Classes/Controller/ConstantEditorController.php +++ b/typo3/sysext/tstemplate/Classes/Controller/ConstantEditorController.php @@ -172,7 +172,7 @@ class ConstantEditorController extends AbstractTemplateModuleController foreach ($constants as $constant) { if ($constant['cat'] === $selectedCategory) { $displayConstants[$constant['subcat_sorting_first']]['label'] = $constant['subcat_label']; - $displayConstants[$constant['subcat_sorting_first']]['items'][$constant['subcat_sorting_second']] = $constant; + $displayConstants[$constant['subcat_sorting_first']]['items'][$constant['subcat_sorting_second']][] = $constant; } } ksort($displayConstants); diff --git a/typo3/sysext/tstemplate/Resources/Private/Partials/ConstantEditorFields.html b/typo3/sysext/tstemplate/Resources/Private/Partials/ConstantEditorFields.html index f7857337b757d25b3974245b077befbd93a7af49..77d4e4c28b2bb5558797d32c13b91703fd7d299b 100644 --- a/typo3/sysext/tstemplate/Resources/Private/Partials/ConstantEditorFields.html +++ b/typo3/sysext/tstemplate/Resources/Private/Partials/ConstantEditorFields.html @@ -7,172 +7,174 @@ <form action="{f:be.uri(route: 'web_typoscript_constanteditor', parameters: '{id: pageUid}')}" method="post" id="TypoScriptConstantEditorController"> <f:for each="{displayConstants}" as="mainCategory" key="mainCategoryKey"> <h2>{mainCategory.label}</h2> - <f:for each="{mainCategory.items}" as="constantItem"> - <fieldset class="form-section"> - <div class="form-group"> - <label class="form-label t3js-formengine-label"> - <span>{constantItem.label}</span> - <code>[{constantItem.name}]</code> - </label> - <f:if condition="{constantItem.description}"><p>{constantItem.description}</p></f:if> - <f:if condition="{constantItem.typeHint}"><span class="text-body-secondary">{constantItem.typeHint}</span></f:if> - <input - type="hidden" - name="check[{constantItem.name}]" - id="check-{constantItem.idName}" - value="checked" - checked - {f:if(condition: '!{constantItem.isInCurrentTemplate}', then: 'disabled')} - > - <div class="input-group userTS" id="userTS-{constantItem.idName}" style="{f:if(condition: constantItem.isInCurrentTemplate, else: 'display:none;')}"> - <button - type="button" - class="btn btn-default t3js-toggle" - data-bs-toggle="undo" - rel="{constantItem.idName}" - title="{f:translate(key:'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.deleteTitle')}"> - <core:icon identifier="actions-edit-undo" /> - </button> - <f:switch expression="{constantItem.type}"> - <f:case value="int+"> - <input - class="form-control" - id="{constantItem.idName}" - type="number" - name="data[{constantItem.name}]" - value="{constantItem.value}" - {f:if(condition: '{constantItem.typeIntPlusMin} || {constantItem.typeIntPlusMin == 0}', then: 'min="{constantItem.typeIntPlusMin}"')} - {f:if(condition: constantItem.typeIntPlusMax, then: 'max="{constantItem.typeIntPlusMax}"')} - > - </f:case> - <f:case value="int"> - <input - class="form-control" - id="{constantItem.idName}" - type="number" - name="data[{constantItem.name}]" - value="{constantItem.value}" - {f:if(condition: '{constantItem.typeIntMin} || {constantItem.typeIntMin == 0}', then: 'min="{constantItem.typeIntMin}"')} - {f:if(condition: '{constantItem.typeIntMax} || {constantItem.typeIntMax == 0}', then: 'max="{constantItem.typeIntMax}"')} - > - </f:case> - <f:case value="string"> - <input - class="form-control" - id="{constantItem.idName}" - type="text" - name="data[{constantItem.name}]" - value="{constantItem.value}" - /> - </f:case> - <f:case value="color"> - <input - class="form-control t3js-color-input" - type="text" - id="{constantItem.idName}" - rel="{constantItem.idName}" - name="data[{constantItem.name}]" - value="{constantItem.value}" - /> - </f:case> - <f:case value="wrap"> - <input - class="form-control form-control-adapt" - type="text" - id="{constantItem.idName}" - name="data[{constantItem.name}][left]" - value="{constantItem.wrapStart}" - /> - <span class="input-group-addon input-group-icon">|</span> - <input - class="form-control form-control-adapt" - type="text" - name="data[{constantItem.name}][right]" - value="{constantItem.wrapEnd}" - /> - </f:case> - <f:case value="offset"> - <f:for each="{constantItem.labelValueArray}" as="labelAndValue" iteration="iterator"> - <span class="input-group-addon input-group-icon">{labelAndValue.label}</span> + <f:for each="{mainCategory.items}" as="constantItems"> + <f:for each="{constantItems}" as="constantItem"> + <fieldset class="form-section"> + <div class="form-group"> + <label class="form-label t3js-formengine-label"> + <span>{constantItem.label}</span> + <code>[{constantItem.name}]</code> + </label> + <f:if condition="{constantItem.description}"><p>{constantItem.description}</p></f:if> + <f:if condition="{constantItem.typeHint}"><span class="text-body-secondary">{constantItem.typeHint}</span></f:if> + <input + type="hidden" + name="check[{constantItem.name}]" + id="check-{constantItem.idName}" + value="checked" + checked + {f:if(condition: '!{constantItem.isInCurrentTemplate}', then: 'disabled')} + > + <div class="input-group userTS" id="userTS-{constantItem.idName}" style="{f:if(condition: constantItem.isInCurrentTemplate, else: 'display:none;')}"> + <button + type="button" + class="btn btn-default t3js-toggle" + data-bs-toggle="undo" + rel="{constantItem.idName}" + title="{f:translate(key:'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.deleteTitle')}"> + <core:icon identifier="actions-edit-undo" /> + </button> + <f:switch expression="{constantItem.type}"> + <f:case value="int+"> <input + class="form-control" + id="{constantItem.idName}" + type="number" + name="data[{constantItem.name}]" + value="{constantItem.value}" + {f:if(condition: '{constantItem.typeIntPlusMin} || {constantItem.typeIntPlusMin == 0}', then: 'min="{constantItem.typeIntPlusMin}"')} + {f:if(condition: constantItem.typeIntPlusMax, then: 'max="{constantItem.typeIntPlusMax}"')} + > + </f:case> + <f:case value="int"> + <input + class="form-control" + id="{constantItem.idName}" + type="number" + name="data[{constantItem.name}]" + value="{constantItem.value}" + {f:if(condition: '{constantItem.typeIntMin} || {constantItem.typeIntMin == 0}', then: 'min="{constantItem.typeIntMin}"')} + {f:if(condition: '{constantItem.typeIntMax} || {constantItem.typeIntMax == 0}', then: 'max="{constantItem.typeIntMax}"')} + > + </f:case> + <f:case value="string"> + <input + class="form-control" + id="{constantItem.idName}" + type="text" + name="data[{constantItem.name}]" + value="{constantItem.value}" + /> + </f:case> + <f:case value="color"> + <input + class="form-control t3js-color-input" type="text" + id="{constantItem.idName}" + rel="{constantItem.idName}" + name="data[{constantItem.name}]" + value="{constantItem.value}" + /> + </f:case> + <f:case value="wrap"> + <input class="form-control form-control-adapt" - name="data[{constantItem.name}][{iterator.index}]" - value="{labelAndValue.value}" + type="text" + id="{constantItem.idName}" + name="data[{constantItem.name}][left]" + value="{constantItem.wrapStart}" /> - </f:for> - </f:case> - <f:case value="options"> - <select - class="form-select" - id="{constantItem.idName}" - name="data[{constantItem.name}]" - > - <f:for each="{constantItem.labelValueArray}" as="labelAndValue"> - <option value="{labelAndValue.value}" {f:if(condition: labelAndValue.selected, then: 'selected')}> - {labelAndValue.label} - </option> - </f:for> - </select> - </f:case> - <f:case value="boolean"> - <input - type="hidden" - name="data[{constantItem.name}]" - value="0" - /> - <div class="input-group-text"> - <div class="form-check form-check-type-toggle"> + <span class="input-group-addon input-group-icon">|</span> + <input + class="form-control form-control-adapt" + type="text" + name="data[{constantItem.name}][right]" + value="{constantItem.wrapEnd}" + /> + </f:case> + <f:case value="offset"> + <f:for each="{constantItem.labelValueArray}" as="labelAndValue" iteration="iterator"> + <span class="input-group-addon input-group-icon">{labelAndValue.label}</span> <input - type="checkbox" - name="data[{constantItem.name}]" - id="{constantItem.idName}" - class="form-check-input" - value="{constantItem.trueValue}" - {f:if(condition: '{constantItem.value} == {constantItem.trueValue}', then: 'checked')} + type="text" + class="form-control form-control-adapt" + name="data[{constantItem.name}][{iterator.index}]" + value="{labelAndValue.value}" /> + </f:for> + </f:case> + <f:case value="options"> + <select + class="form-select" + id="{constantItem.idName}" + name="data[{constantItem.name}]" + > + <f:for each="{constantItem.labelValueArray}" as="labelAndValue"> + <option value="{labelAndValue.value}" {f:if(condition: labelAndValue.selected, then: 'selected')}> + {labelAndValue.label} + </option> + </f:for> + </select> + </f:case> + <f:case value="boolean"> + <input + type="hidden" + name="data[{constantItem.name}]" + value="0" + /> + <div class="input-group-text"> + <div class="form-check form-check-type-toggle"> + <input + type="checkbox" + name="data[{constantItem.name}]" + id="{constantItem.idName}" + class="form-check-input" + value="{constantItem.trueValue}" + {f:if(condition: '{constantItem.value} == {constantItem.trueValue}', then: 'checked')} + /> + </div> </div> - </div> - </f:case> - <f:case value="comment"> - <input - type="hidden" - name="data[{constantItem.name}]" - value="0" - /> - <div class="input-group-text"> - <div class="form-check form-check-type-toggle"> - <input - type="checkbox" - name="data[{constantItem.name}]" - id="{constantItem.idName}" - class="form-check-input mt-0" - value="1" - {f:if(condition: '!{constantItem.value}', then: 'checked')} - /> + </f:case> + <f:case value="comment"> + <input + type="hidden" + name="data[{constantItem.name}]" + value="0" + /> + <div class="input-group-text"> + <div class="form-check form-check-type-toggle"> + <input + type="checkbox" + name="data[{constantItem.name}]" + id="{constantItem.idName}" + class="form-check-input mt-0" + value="1" + {f:if(condition: '!{constantItem.value}', then: 'checked')} + /> + </div> </div> - </div> - </f:case> - <f:case value="user"> - <input - type="hidden" - name="data[{constantItem.name}]" - value="0" - /> - {constantItem.html -> f:format.raw()} - </f:case> - </f:switch> - </div> - <div class="input-group defaultTS" id="defaultTS-{constantItem.idName}" style="{f:if(condition: constantItem.isInCurrentTemplate, then: 'display:none;')}"> - <button type="button" class="btn btn-default t3js-toggle" data-bs-toggle="edit" rel="{constantItem.idName}"> - <span title="{f:translate(key:'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.editTitle')}"> - <core:icon identifier="actions-open" /> - </span> - </button> - <input class="form-control" type="number" placeholder="{constantItem.default_value}" disabled readonly> + </f:case> + <f:case value="user"> + <input + type="hidden" + name="data[{constantItem.name}]" + value="0" + /> + {constantItem.html -> f:format.raw()} + </f:case> + </f:switch> + </div> + <div class="input-group defaultTS" id="defaultTS-{constantItem.idName}" style="{f:if(condition: constantItem.isInCurrentTemplate, then: 'display:none;')}"> + <button type="button" class="btn btn-default t3js-toggle" data-bs-toggle="edit" rel="{constantItem.idName}"> + <span title="{f:translate(key:'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.editTitle')}"> + <core:icon identifier="actions-open" /> + </span> + </button> + <input class="form-control" type="number" placeholder="{constantItem.default_value}" disabled readonly> + </div> </div> - </div> - </fieldset> + </fieldset> + </f:for> </f:for> </f:for> </form>