From: Matthias Schmidt Date: Tue, 8 May 2018 06:07:50 +0000 (+0200) Subject: Add default description for class name form fields with required interface X-Git-Tag: 5.2.0_Alpha_1~680^2~59 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=bf37a128ea8d1683278de75f122df05f03c3977e;p=GitHub%2FWoltLab%2FWCF.git Add default description for class name form fields with required interface See #2509 --- diff --git a/wcfsetup/install/files/lib/system/form/builder/field/ClassNameFormField.class.php b/wcfsetup/install/files/lib/system/form/builder/field/ClassNameFormField.class.php index 4372cf608c..25f06a8b0e 100644 --- a/wcfsetup/install/files/lib/system/form/builder/field/ClassNameFormField.class.php +++ b/wcfsetup/install/files/lib/system/form/builder/field/ClassNameFormField.class.php @@ -103,7 +103,11 @@ class ClassNameFormField extends TextFormField { } /** - * Returns the name of the interface the entered class must implement. + * Sets the name of the interface the entered class must implement and returns + * this field. + * + * If no description has been set yet, `wcf.form.field.className.description.interface` + * is automatically used for the description. * * @param string $interface name of the interface the entered class must implement * @return static this field @@ -117,6 +121,13 @@ class ClassNameFormField extends TextFormField { $this->__implementedInterface = $interface; + if ($this->getDescription() === null) { + $this->description( + 'wcf.form.field.className.description.interface', + ['interface' => $this->__implementedInterface] + ); + } + return $this; } diff --git a/wcfsetup/install/lang/de.xml b/wcfsetup/install/lang/de.xml index de68659dc0..d414f7aa9a 100644 --- a/wcfsetup/install/lang/de.xml +++ b/wcfsetup/install/lang/de.xml @@ -3018,6 +3018,7 @@ E-Mail-Adresse: {@$emailAddress} {* this line ends with a space *} + {$interface} implementieren.]]> {$interface}.]]> diff --git a/wcfsetup/install/lang/en.xml b/wcfsetup/install/lang/en.xml index 0da26790d6..841a656415 100644 --- a/wcfsetup/install/lang/en.xml +++ b/wcfsetup/install/lang/en.xml @@ -2964,6 +2964,7 @@ Email: {@$emailAddress} {* this line ends with a space *} + {$interface}.]]> {$interface}.]]>