Add AbstractFormField::$templateApplication
authorPeter Frühwirt <peter.fruehwirt@viecode.com>
Sun, 1 Dec 2019 09:40:41 +0000 (10:40 +0100)
committerMatthias Schmidt <gravatronics@live.com>
Sun, 1 Dec 2019 09:40:41 +0000 (10:40 +0100)
Currently all field templates have to be placed in the wcf folder. If an application wants to create their own custom field, the template has to placed in the wcf folder as well. This change enables custom components to use their own template folder.

wcfsetup/install/files/lib/system/form/builder/field/AbstractFormField.class.php

index 4ebcadc4422ca480303caa277eb843ce71662835..b086ce22560bbdab179d9c767f63ccae3c0cb471 100644 (file)
@@ -45,6 +45,12 @@ abstract class AbstractFormField implements IFormField {
         */
        protected $templateName;
        
+       /**
+        * name of the template's application used to output this field
+        * @var string
+        */
+       protected $templateApplication = 'wcf';
+       
        /**
         * validation errors of this field
         * @var IFormFieldValidationError[]
@@ -99,7 +105,7 @@ abstract class AbstractFormField implements IFormField {
                
                return WCF::getTPL()->fetch(
                        $this->templateName,
-                       'wcf',
+                       $this->templateApplication,
                        array_merge($this->getHtmlVariables(), [
                                'field' => $this
                        ]),