Insert form fields in a `FormContainer`
authorCyperghost <olaf_schmitz_1@t-online.de>
Thu, 14 Nov 2024 10:14:47 +0000 (11:14 +0100)
committerCyperghost <olaf_schmitz_1@t-online.de>
Thu, 14 Nov 2024 10:14:47 +0000 (11:14 +0100)
wcfsetup/install/files/lib/acp/form/TemplateGroupAddForm.class.php

index 183c5d731bf93ec9850d5d75c63353053753e18e..7d1c6de6b71251eea4dbe7d03767c641af18f177 100644 (file)
@@ -5,6 +5,7 @@ namespace wcf\acp\form;
 use wcf\data\template\group\TemplateGroup;
 use wcf\data\template\group\TemplateGroupAction;
 use wcf\form\AbstractFormBuilderForm;
+use wcf\system\form\builder\container\FormContainer;
 use wcf\system\form\builder\field\SelectFormField;
 use wcf\system\form\builder\field\TextFormField;
 use wcf\system\form\builder\field\validation\FormFieldValidationError;
@@ -51,19 +52,22 @@ class TemplateGroupAddForm extends AbstractFormBuilderForm
         $availableTemplateGroups = TemplateGroup::getSelectList([-1], 1);
 
         $this->form->appendChildren([
-            SelectFormField::create('parentTemplateGroupID')
-                ->label('wcf.acp.template.group.parentTemplateGroup')
-                ->options($availableTemplateGroups)
-                ->available(\count($availableTemplateGroups) > 0),
-            TextFormField::create('templateGroupName')
-                ->label('wcf.global.name')
-                ->required()
-                ->addValidator(TemplateGroupAddForm::getTemplateNameValidator($this->formObject)),
-            TextFormField::create('templateGroupFolderName')
-                ->label('wcf.acp.template.group.folderName')
-                ->required()
-                ->addValidator(TemplateGroupAddForm::getFolderNameValidator())
-                ->addValidator(TemplateGroupAddForm::getUniqueFolderNameValidator($this->formObject)),
+            FormContainer::create('general')
+                ->appendChildren([
+                    SelectFormField::create('parentTemplateGroupID')
+                        ->label('wcf.acp.template.group.parentTemplateGroup')
+                        ->options($availableTemplateGroups)
+                        ->available(\count($availableTemplateGroups) > 0),
+                    TextFormField::create('templateGroupName')
+                        ->label('wcf.global.name')
+                        ->required()
+                        ->addValidator(TemplateGroupAddForm::getTemplateNameValidator($this->formObject)),
+                    TextFormField::create('templateGroupFolderName')
+                        ->label('wcf.acp.template.group.folderName')
+                        ->required()
+                        ->addValidator(TemplateGroupAddForm::getFolderNameValidator())
+                        ->addValidator(TemplateGroupAddForm::getUniqueFolderNameValidator($this->formObject)),
+                ])
         ]);
     }