Add default label for `ClassNameFormField`
authorMatthias Schmidt <gravatronics@live.com>
Tue, 8 May 2018 05:42:15 +0000 (07:42 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Tue, 8 May 2018 05:42:15 +0000 (07:42 +0200)
See #2509

wcfsetup/install/files/lib/system/form/builder/field/ClassNameFormField.class.php
wcfsetup/install/lang/de.xml
wcfsetup/install/lang/en.xml

index 3878f4a88957dd7daf6e7828823a20670918c932..4372cf608c77d23b68cc4d35812ec1bd0c4c8432 100644 (file)
@@ -7,6 +7,9 @@ use wcf\system\SingletonFactory;
 /**
  * Implementation of a form field to enter the name of a PHP class.
  * 
+ * This field uses the `wcf.form.field.className` language item as the default
+ * form field label and uses `className` as the default node id.
+ * 
  * @author     Matthias Schmidt
  * @copyright  2001-2018 WoltLab GmbH
  * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
@@ -38,6 +41,13 @@ class ClassNameFormField extends TextFormField {
         */
        protected $__parentClass = '';
        
+       /**
+        * Creates a new instance of `ClassNameFormField`.
+        */
+       public function __construct() {
+               $this->label('wcf.form.field.className');
+       }
+       
        /**
         * Sets whether entered class must exist and returns this field.
         * 
index bd13d17a82f6266fd48e2d96016e6bd13f22734e..de68659dc0aa2f6f1e4c16a74dc94c0d669ff5f7 100644 (file)
@@ -3017,6 +3017,7 @@ E-Mail-Adresse: {@$emailAddress} {* this line ends with a space *}
        </category>
        
        <category name="wcf.form">
+               <item name="wcf.form.field.className"><![CDATA[Klasse]]></item>
                <item name="wcf.form.field.className.error.interface"><![CDATA[Die angegebene Klasse{if $language|isset} ({$language}){/if} implementiert nicht das Interface <code>{$interface}</code>.]]></item>
                <item name="wcf.form.field.className.error.isInstantiable"><![CDATA[Die angegebene Klasse{if $language|isset} ({$language}){/if} ist nicht instanziierbar.]]></item>
                <item name="wcf.form.field.className.error.leadingBackslash"><![CDATA[Die angegebene Klasse{if $language|isset} ({$language}){/if} darf keinen führenden Backslash besitzen.]]></item>
index a071774eccbec65003eb800eff8adb615f379d55..0da26790d6144fe137d74b10f29e90ffe10c85b0 100644 (file)
@@ -2963,6 +2963,7 @@ Email: {@$emailAddress} {* this line ends with a space *}
        </category>
        
        <category name="wcf.form">
+               <item name="wcf.form.field.className"><![CDATA[Class]]></item>
                <item name="wcf.form.field.className.error.interface"><![CDATA[The entered class{if $language|isset} ({$language}){/if} does not implement the interface <code>{$interface}</code>.]]></item>
                <item name="wcf.form.field.className.error.isInstantiable"><![CDATA[The entered class{if $language|isset} ({$language}){/if} is not instantiable.]]></item>
                <item name="wcf.form.field.className.error.leadingBackslash"><![CDATA[The entered class name{if $language|isset} ({$language}){/if} must not have a leading backslash.]]></item>