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

index a0a4594f1b2b0254822f3df996111077b2d4217c..9eebaa0cc24ba879737b6dda84582e9b9daa96f5 100644 (file)
@@ -8,4 +8,5 @@
        *}{if $field->isRequired()} required{/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 a0a4594f1b2b0254822f3df996111077b2d4217c..9eebaa0cc24ba879737b6dda84582e9b9daa96f5 100644 (file)
@@ -8,4 +8,5 @@
        *}{if $field->isRequired()} required{/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 669b068b552f03b1cab41a16edc1060862e7bc37..1e9dd4625ce7331741499d5e387300b4f292e063 100644 (file)
@@ -1,12 +1,14 @@
 <?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\IPlaceholderFormField;
 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\TInputAttributeFormField;
 use wcf\system\form\builder\field\TPlaceholderFormField;
 use wcf\system\form\builder\field\validation\FormFieldValidationError;
 use wcf\system\WCF;
@@ -24,7 +26,8 @@ use wcf\system\WCF;
  * @package     WoltLabSuite\Core\System\Form\Builder\Field\User
  * @since       5.4
  */
-class UserPasswordField extends AbstractFormField implements IAutoCompleteFormField, IAutoFocusFormField, IPlaceholderFormField {
+class UserPasswordField extends AbstractFormField implements IAttributeFormField, IAutoCompleteFormField, IAutoFocusFormField, IPlaceholderFormField {
+       use TInputAttributeFormField;
        use TAutoCompleteFormField;
        use TAutoFocusFormField;
        use TDefaultIdFormField;