Add field attribute support for `UsernameFormField`
authorMatthias Schmidt <gravatronics@live.com>
Wed, 23 Dec 2020 14:45:38 +0000 (15:45 +0100)
committerMatthias Schmidt <gravatronics@live.com>
Wed, 23 Dec 2020 14:45:38 +0000 (15:45 +0100)
com.woltlab.wcf/templates/__usernameFormField.tpl
wcfsetup/install/files/acp/templates/__usernameFormField.tpl
wcfsetup/install/files/lib/system/form/builder/field/user/UsernameFormField.class.php

index 63dc44d04835f4e58f8af445451fe8cc6c8d000b..feee39476007d4ab840e9eb9976332d7c5d9524f 100644 (file)
@@ -11,4 +11,6 @@
        *}{if $field->getMaximumLength() !== null} maxlength="{$field->getMaximumLength()}"{/if}{*
        *}{if $field->getPlaceholder() !== null} placeholder="{$field->getPlaceholder()}"{/if}{*
        *}{if $field->getDocument()->isAjax()} data-dialog-submit-on-enter="true"{/if}{*
+       *}{foreach from=$field->getFieldAttributes() key='attributeName' item='attributeValue'} {$attributeName}="{$attributeValue}"{/foreach}{*
+
 *}>
index 63dc44d04835f4e58f8af445451fe8cc6c8d000b..feee39476007d4ab840e9eb9976332d7c5d9524f 100644 (file)
@@ -11,4 +11,6 @@
        *}{if $field->getMaximumLength() !== null} maxlength="{$field->getMaximumLength()}"{/if}{*
        *}{if $field->getPlaceholder() !== null} placeholder="{$field->getPlaceholder()}"{/if}{*
        *}{if $field->getDocument()->isAjax()} data-dialog-submit-on-enter="true"{/if}{*
+       *}{foreach from=$field->getFieldAttributes() key='attributeName' item='attributeValue'} {$attributeName}="{$attributeValue}"{/foreach}{*
+
 *}>
index b13a86d8d455920f00b5a70e282223436797e759..50205349cde8315a7b09b3afcfd4581b5a66545d 100644 (file)
@@ -1,6 +1,7 @@
 <?php
 namespace wcf\system\form\builder\field\user;
 use wcf\system\form\builder\field\AbstractFormField;
+use wcf\system\form\builder\field\IAttributeFormField;
 use wcf\system\form\builder\field\IAutoCompleteFormField;
 use wcf\system\form\builder\field\IAutoFocusFormField;
 use wcf\system\form\builder\field\IImmutableFormField;
@@ -12,6 +13,7 @@ use wcf\system\form\builder\field\TAutoCompleteFormField;
 use wcf\system\form\builder\field\TAutoFocusFormField;
 use wcf\system\form\builder\field\TDefaultIdFormField;
 use wcf\system\form\builder\field\TImmutableFormField;
+use wcf\system\form\builder\field\TInputAttributeFormField;
 use wcf\system\form\builder\field\TMaximumLengthFormField;
 use wcf\system\form\builder\field\TMinimumLengthFormField;
 use wcf\system\form\builder\field\TNullableFormField;
@@ -32,7 +34,8 @@ use wcf\util\UserUtil;
  * @package    WoltLabSuite\Core\System\Form\Builder\Field\User
  * @since      5.2
  */
-class UsernameFormField extends AbstractFormField implements IAutoCompleteFormField, IAutoFocusFormField, IImmutableFormField, IMaximumLengthFormField, IMinimumLengthFormField, INullableFormField, IPlaceholderFormField {
+class UsernameFormField extends AbstractFormField implements IAttributeFormField, IAutoCompleteFormField, IAutoFocusFormField, IImmutableFormField, IMaximumLengthFormField, IMinimumLengthFormField, INullableFormField, IPlaceholderFormField {
+       use TInputAttributeFormField;
        use TAutoCompleteFormField;
        use TAutoFocusFormField;
        use TDefaultIdFormField;