Move form field immutability to separate interface
authorMatthias Schmidt <gravatronics@live.com>
Sun, 13 Jan 2019 09:54:16 +0000 (10:54 +0100)
committerMatthias Schmidt <gravatronics@live.com>
Sun, 13 Jan 2019 09:54:16 +0000 (10:54 +0100)
And add immutability support for some additional fields.

See #2509

21 files changed:
com.woltlab.wcf/templates/__iconFormField.tpl
com.woltlab.wcf/templates/__multipleSelectionFormField.tpl
com.woltlab.wcf/templates/__singleSelectionFormField.tpl
wcfsetup/install/files/acp/templates/__iconFormField.tpl
wcfsetup/install/files/acp/templates/__multipleSelectionFormField.tpl
wcfsetup/install/files/acp/templates/__singleSelectionFormField.tpl
wcfsetup/install/files/lib/system/form/builder/field/AbstractFormField.class.php
wcfsetup/install/files/lib/system/form/builder/field/AbstractNumericFormField.class.php
wcfsetup/install/files/lib/system/form/builder/field/BooleanFormField.class.php
wcfsetup/install/files/lib/system/form/builder/field/DateFormField.class.php
wcfsetup/install/files/lib/system/form/builder/field/IFormField.class.php
wcfsetup/install/files/lib/system/form/builder/field/IImmutableFormField.class.php [new file with mode: 0644]
wcfsetup/install/files/lib/system/form/builder/field/IconFormField.class.php
wcfsetup/install/files/lib/system/form/builder/field/ItemListFormField.class.php
wcfsetup/install/files/lib/system/form/builder/field/MultipleSelectionFormField.class.php
wcfsetup/install/files/lib/system/form/builder/field/RadioButtonFormField.class.php
wcfsetup/install/files/lib/system/form/builder/field/SingleSelectionFormField.class.php
wcfsetup/install/files/lib/system/form/builder/field/TImmutableFormField.class.php [new file with mode: 0644]
wcfsetup/install/files/lib/system/form/builder/field/TextFormField.class.php
wcfsetup/install/files/lib/system/form/builder/field/user/UserFormField.class.php
wcfsetup/install/files/lib/system/form/builder/field/user/UsernameFormField.class.php

index 033ea6b609699abd4e94134bd22b53bb0a549d53..fe3cecf0a4f531b2b1ba20eeaa5b9a8f97b85492 100644 (file)
@@ -1,28 +1,32 @@
 {include file='__formFieldHeader'}
 
 <span{if $field->getValue()} class="icon icon64 fa-{$field->getValue()}"{/if} id="{@$field->getPrefixedId()}_icon"></span>
-<a href="#" class="button small" id="{@$field->getPrefixedId()}_openIconDialog">{lang}wcf.global.button.edit{/lang}</a>
-<input type="hidden" id="{@$field->getPrefixedId()}" name="{@$field->getPrefixedId()}" value="{$field->getValue()}">
-
-{if $__iconFormFieldIncludeJavaScript}
-       {include file='fontAwesomeJavaScript'}
+{if !$field->isImmutable()}
+       <a href="#" class="button small" id="{@$field->getPrefixedId()}_openIconDialog">{lang}wcf.global.button.edit{/lang}</a>
 {/if}
+<input type="hidden" id="{@$field->getPrefixedId()}" name="{@$field->getPrefixedId()}" value="{$field->getValue()}">
 
-<script data-relocate="true">
-       require(['WoltLabSuite/Core/Ui/Style/FontAwesome'], function(UiStyleFontAwesome) {
-               var button = elById('{@$field->getPrefixedId()}_openIconDialog');
-               var icon = elById('{@$field->getPrefixedId()}_icon');
-               var input = elById('{@$field->getPrefixedId()}');
-               
-               var callback = function(iconName) {
-                       icon.className = 'icon icon64 fa-' + iconName;
-                       input.value = iconName;
-               };
-               
-               button.addEventListener('click', function() {
-                       UiStyleFontAwesome.open(callback);
+{if !$field->isImmutable()}
+       {if $__iconFormFieldIncludeJavaScript}
+               {include file='fontAwesomeJavaScript'}
+       {/if}
+       
+       <script data-relocate="true">
+               require(['WoltLabSuite/Core/Ui/Style/FontAwesome'], function(UiStyleFontAwesome) {
+                       var button = elById('{@$field->getPrefixedId()}_openIconDialog');
+                       var icon = elById('{@$field->getPrefixedId()}_icon');
+                       var input = elById('{@$field->getPrefixedId()}');
+                       
+                       var callback = function(iconName) {
+                               icon.className = 'icon icon64 fa-' + iconName;
+                               input.value = iconName;
+                       };
+                       
+                       button.addEventListener('click', function() {
+                               UiStyleFontAwesome.open(callback);
+                       });
                });
-       });
-</script>
+       </script>
+{/if}
 
 {include file='__formFieldFooter'}
index 5f531d694004b1b86d28b2230362006502bf326b..8920cbb2e37e80635fb20f5c41915948d2f2f1e4 100644 (file)
        <ul class="scrollableCheckboxList" id="{@$field->getPrefixedId()}_list">
                {foreach from=$field->getNestedOptions() item=__fieldNestedOption}
                        <li{if $__fieldNestedOption[depth] > 0} style="padding-left: {$__fieldNestedOption[depth]*20}px"{/if}>
-                               <label><input type="checkbox" name="{@$field->getPrefixedId()}[]" value="{$__fieldNestedOption[value]}"{if $field->getValue() !== null && $__fieldNestedOption[value]|in_array:$field->getValue()} checked{/if}> {@$__fieldNestedOption[label]}</label>
+                               <label><input {*
+                                               *}type="checkbox" {*
+                                               *}name="{@$field->getPrefixedId()}[]" {*
+                                               *}value="{$__fieldNestedOption[value]}"{*
+                                               *}{if $field->getValue() !== null && $__fieldNestedOption[value]|in_array:$field->getValue()} checked{/if}{*
+                                               *}{if $field->isImmutable()} disabled{/if}{*
+                                       *}> {@$__fieldNestedOption[label]}</label>
                        </li>
                {/foreach}
        </ul>
 {else}
-       {htmlCheckboxes options=$field->getOptions() name=$field->getPrefixedId() selected=$field->getValue() disableEncoding=true}
+       {htmlCheckboxes options=$field->getOptions() name=$field->getPrefixedId() selected=$field->getValue() disabled=$field->isImmutable() disableEncoding=true}
 {/if}
 
 {include file='__formFieldFooter'}
index e54da20a280962d9849bea514e24fe46e8f9ac1c..f772ab7b0309e5132b024b21e0499337fe9623c3 100644 (file)
        <ul class="scrollableCheckboxList" id="{@$field->getPrefixedId()}_list">
                {foreach from=$field->getNestedOptions() item=__fieldNestedOption}
                        <li{if $__fieldNestedOption[depth] > 0} style="padding-left: {$__fieldNestedOption[depth]*20}px"{/if}>
-                               <label><input type="radio" name="{@$field->getPrefixedId()}" value="{$__fieldNestedOption[value]}"{if $field->getValue() == $__fieldNestedOption[value]} checked{/if}> {@$__fieldNestedOption[label]}</label>
+                               <label><input {*
+                                               *}type="radio" {*
+                                               *}name="{@$field->getPrefixedId()}" {*
+                                               *}value="{$__fieldNestedOption[value]}"{*
+                                               *}{if $field->getValue() == $__fieldNestedOption[value]} checked{/if}{*
+                                               *}{if $field->isImmutable()} disabled{/if}{*
+                                       *}> {@$__fieldNestedOption[label]}</label>
                        </li>
                {/foreach}
        </ul>
 {else}
        <select id="{@$field->getPrefixedId()}" name="{@$field->getPrefixedId()}">
                {foreach from=$field->getNestedOptions() item=__fieldNestedOption}
-                       <option name="{@$field->getPrefixedId()}" value="{$__fieldNestedOption[value]}"{if $field->getValue() == $__fieldNestedOption[value]} selected{/if}>{@'&nbsp;'|str_repeat:$__fieldNestedOption[depth] * 4}{@$__fieldNestedOption[label]}</option>
+                       <option {*
+                               *}name="{@$field->getPrefixedId()}" {*
+                               *}value="{$__fieldNestedOption[value]}"{*
+                               *}{if $field->getValue() == $__fieldNestedOption[value]} selected{/if}{*
+                               *}{if $field->isImmutable()} disabled{/if}{*
+                       *}>{@'&nbsp;'|str_repeat:$__fieldNestedOption[depth] * 4}{@$__fieldNestedOption[label]}</option>
                {/foreach}
        </select>
 {/if}
index 033ea6b609699abd4e94134bd22b53bb0a549d53..fe3cecf0a4f531b2b1ba20eeaa5b9a8f97b85492 100644 (file)
@@ -1,28 +1,32 @@
 {include file='__formFieldHeader'}
 
 <span{if $field->getValue()} class="icon icon64 fa-{$field->getValue()}"{/if} id="{@$field->getPrefixedId()}_icon"></span>
-<a href="#" class="button small" id="{@$field->getPrefixedId()}_openIconDialog">{lang}wcf.global.button.edit{/lang}</a>
-<input type="hidden" id="{@$field->getPrefixedId()}" name="{@$field->getPrefixedId()}" value="{$field->getValue()}">
-
-{if $__iconFormFieldIncludeJavaScript}
-       {include file='fontAwesomeJavaScript'}
+{if !$field->isImmutable()}
+       <a href="#" class="button small" id="{@$field->getPrefixedId()}_openIconDialog">{lang}wcf.global.button.edit{/lang}</a>
 {/if}
+<input type="hidden" id="{@$field->getPrefixedId()}" name="{@$field->getPrefixedId()}" value="{$field->getValue()}">
 
-<script data-relocate="true">
-       require(['WoltLabSuite/Core/Ui/Style/FontAwesome'], function(UiStyleFontAwesome) {
-               var button = elById('{@$field->getPrefixedId()}_openIconDialog');
-               var icon = elById('{@$field->getPrefixedId()}_icon');
-               var input = elById('{@$field->getPrefixedId()}');
-               
-               var callback = function(iconName) {
-                       icon.className = 'icon icon64 fa-' + iconName;
-                       input.value = iconName;
-               };
-               
-               button.addEventListener('click', function() {
-                       UiStyleFontAwesome.open(callback);
+{if !$field->isImmutable()}
+       {if $__iconFormFieldIncludeJavaScript}
+               {include file='fontAwesomeJavaScript'}
+       {/if}
+       
+       <script data-relocate="true">
+               require(['WoltLabSuite/Core/Ui/Style/FontAwesome'], function(UiStyleFontAwesome) {
+                       var button = elById('{@$field->getPrefixedId()}_openIconDialog');
+                       var icon = elById('{@$field->getPrefixedId()}_icon');
+                       var input = elById('{@$field->getPrefixedId()}');
+                       
+                       var callback = function(iconName) {
+                               icon.className = 'icon icon64 fa-' + iconName;
+                               input.value = iconName;
+                       };
+                       
+                       button.addEventListener('click', function() {
+                               UiStyleFontAwesome.open(callback);
+                       });
                });
-       });
-</script>
+       </script>
+{/if}
 
 {include file='__formFieldFooter'}
index 5f531d694004b1b86d28b2230362006502bf326b..8920cbb2e37e80635fb20f5c41915948d2f2f1e4 100644 (file)
        <ul class="scrollableCheckboxList" id="{@$field->getPrefixedId()}_list">
                {foreach from=$field->getNestedOptions() item=__fieldNestedOption}
                        <li{if $__fieldNestedOption[depth] > 0} style="padding-left: {$__fieldNestedOption[depth]*20}px"{/if}>
-                               <label><input type="checkbox" name="{@$field->getPrefixedId()}[]" value="{$__fieldNestedOption[value]}"{if $field->getValue() !== null && $__fieldNestedOption[value]|in_array:$field->getValue()} checked{/if}> {@$__fieldNestedOption[label]}</label>
+                               <label><input {*
+                                               *}type="checkbox" {*
+                                               *}name="{@$field->getPrefixedId()}[]" {*
+                                               *}value="{$__fieldNestedOption[value]}"{*
+                                               *}{if $field->getValue() !== null && $__fieldNestedOption[value]|in_array:$field->getValue()} checked{/if}{*
+                                               *}{if $field->isImmutable()} disabled{/if}{*
+                                       *}> {@$__fieldNestedOption[label]}</label>
                        </li>
                {/foreach}
        </ul>
 {else}
-       {htmlCheckboxes options=$field->getOptions() name=$field->getPrefixedId() selected=$field->getValue() disableEncoding=true}
+       {htmlCheckboxes options=$field->getOptions() name=$field->getPrefixedId() selected=$field->getValue() disabled=$field->isImmutable() disableEncoding=true}
 {/if}
 
 {include file='__formFieldFooter'}
index e54da20a280962d9849bea514e24fe46e8f9ac1c..f772ab7b0309e5132b024b21e0499337fe9623c3 100644 (file)
        <ul class="scrollableCheckboxList" id="{@$field->getPrefixedId()}_list">
                {foreach from=$field->getNestedOptions() item=__fieldNestedOption}
                        <li{if $__fieldNestedOption[depth] > 0} style="padding-left: {$__fieldNestedOption[depth]*20}px"{/if}>
-                               <label><input type="radio" name="{@$field->getPrefixedId()}" value="{$__fieldNestedOption[value]}"{if $field->getValue() == $__fieldNestedOption[value]} checked{/if}> {@$__fieldNestedOption[label]}</label>
+                               <label><input {*
+                                               *}type="radio" {*
+                                               *}name="{@$field->getPrefixedId()}" {*
+                                               *}value="{$__fieldNestedOption[value]}"{*
+                                               *}{if $field->getValue() == $__fieldNestedOption[value]} checked{/if}{*
+                                               *}{if $field->isImmutable()} disabled{/if}{*
+                                       *}> {@$__fieldNestedOption[label]}</label>
                        </li>
                {/foreach}
        </ul>
 {else}
        <select id="{@$field->getPrefixedId()}" name="{@$field->getPrefixedId()}">
                {foreach from=$field->getNestedOptions() item=__fieldNestedOption}
-                       <option name="{@$field->getPrefixedId()}" value="{$__fieldNestedOption[value]}"{if $field->getValue() == $__fieldNestedOption[value]} selected{/if}>{@'&nbsp;'|str_repeat:$__fieldNestedOption[depth] * 4}{@$__fieldNestedOption[label]}</option>
+                       <option {*
+                               *}name="{@$field->getPrefixedId()}" {*
+                               *}value="{$__fieldNestedOption[value]}"{*
+                               *}{if $field->getValue() == $__fieldNestedOption[value]} selected{/if}{*
+                               *}{if $field->isImmutable()} disabled{/if}{*
+                       *}>{@'&nbsp;'|str_repeat:$__fieldNestedOption[depth] * 4}{@$__fieldNestedOption[label]}</option>
                {/foreach}
        </select>
 {/if}
index 0bbae157e41e357bebbcd14cf6c2529396ac4e15..5583b02038afa7a1c7a957083a6d95403a2a173d 100644 (file)
@@ -27,12 +27,6 @@ abstract class AbstractFormField implements IFormField {
         */
        protected $__autoFocus = false;
        
-       /**
-        * `true` if the value of this field is immutable and `false` otherwise
-        * @var bool
-        */
-       protected $__immutable = false;
-       
        /**
         * name of the object property this field represents
         * @var null|string
@@ -179,15 +173,6 @@ abstract class AbstractFormField implements IFormField {
                return true;
        }
        
-       /**
-        * @inheritDoc
-        */
-       public function immutable($immutable = true) {
-               $this->__immutable = $immutable;
-               
-               return $this;
-       }
-       
        /**
         * @inheritDoc
         */
@@ -195,13 +180,6 @@ abstract class AbstractFormField implements IFormField {
                return $this->__autoFocus;
        }
        
-       /**
-        * @inheritDoc
-        */
-       public function isImmutable() {
-               return $this->__immutable;
-       }
-       
        /**
         * @inheritDoc
         */
index d0ac5b883f1c343c7ea7d453ac64636e9c3674ed..8e4837f44b439559c3175bca1d82dfe8f2eaba0f 100644 (file)
@@ -11,7 +11,8 @@ use wcf\system\form\builder\field\validation\FormFieldValidationError;
  * @package    WoltLabSuite\Core\System\Form\Builder\Field
  * @since      5.2
  */
-abstract class AbstractNumericFormField extends AbstractFormField implements IMaximumFormField, IMinimumFormField, INullableFormField, IPlaceholderFormField, ISuffixedFormField {
+abstract class AbstractNumericFormField extends AbstractFormField implements IImmutableFormField, IMaximumFormField, IMinimumFormField, INullableFormField, IPlaceholderFormField, ISuffixedFormField {
+       use TImmutableFormField;
        use TMaximumFormField;
        use TMinimumFormField;
        use TNullableFormField;
index df3095f55ca60e41d85f73d19a9dc330ee8a84cc..b277eea8fdbe180ab4cfb77bf6ef717dbadbe657 100644 (file)
@@ -11,7 +11,9 @@ use wcf\system\form\builder\field\validation\FormFieldValidationError;
  * @package    WoltLabSuite\Core\System\Form\Builder\Field
  * @since      5.2
  */
-class BooleanFormField extends AbstractFormField {
+class BooleanFormField extends AbstractFormField implements IImmutableFormField {
+       use TImmutableFormField;
+       
        /**
         * @inheritDoc
         */
index c8e599a11c467b9215c964afdf24e0d394d41c27..bee9fb5cf0f800fe0e856c4d12199ac131b6045d 100644 (file)
@@ -11,7 +11,9 @@ use wcf\system\form\builder\field\validation\FormFieldValidationError;
  * @package    WoltLabSuite\Core\System\Form\Builder\Field
  * @since      5.2
  */
-class DateFormField extends AbstractFormField {
+class DateFormField extends AbstractFormField implements IImmutableFormField {
+       use TImmutableFormField;
+       
        /**
         * date time format of the save value
         * @var string
index 0273d144d4ca076791b2299fd514cbda24e33a47..be0f98a30393a84e0a6d7a4471a39bc2ef61a9da 100644 (file)
@@ -107,14 +107,6 @@ interface IFormField extends IFormChildNode, IFormElement {
         */
        public function hasSaveValue();
        
-       /**
-        * Sets whether the value of this field is immutable and returns this field.
-        * 
-        * @param       bool            $immutable      determines if field value is immutable
-        * @return      static                          this field
-        */
-       public function immutable($immutable = true);
-       
        /**
         * Returns `true` if this field is auto-focused and returns `false` otherwise.
         * By default, fields are not auto-focused.
@@ -123,14 +115,6 @@ interface IFormField extends IFormChildNode, IFormElement {
         */
        public function isAutoFocused();
        
-       /**
-        * Returns `true` if the value of this field is immutable and returns `false`
-        * otherwise. By default, fields are mutable.
-        * 
-        * @return      bool
-        */
-       public function isImmutable();
-       
        /**
         * Returns `true` if this field has to be filled out and returns `false` otherwise.
         * By default, fields do not have to be filled out.
diff --git a/wcfsetup/install/files/lib/system/form/builder/field/IImmutableFormField.class.php b/wcfsetup/install/files/lib/system/form/builder/field/IImmutableFormField.class.php
new file mode 100644 (file)
index 0000000..211283c
--- /dev/null
@@ -0,0 +1,29 @@
+<?php
+namespace wcf\system\form\builder\field;
+
+/**
+ * Represents a form field that can be set as immutable.
+ * 
+ * @author     Matthias Schmidt
+ * @copyright  2001-2018 WoltLab GmbH
+ * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package    WoltLabSuite\Core\System\Form\Builder\Field
+ * @since      5.2
+ */
+interface IImmutableFormField {
+       /**
+        * Sets whether the value of this field is immutable and returns this field.
+        * 
+        * @param       bool            $immutable      determines if field value is immutable
+        * @return      static                          this field
+        */
+       public function immutable($immutable = true);
+       
+       /**
+        * Returns `true` if the value of this field is immutable and returns `false`
+        * otherwise. By default, fields are mutable.
+        * 
+        * @return      bool
+        */
+       public function isImmutable();
+}
index ceea8cbf99d3f356954295a4c7e82d93516f4f91..88d178885b9304f66503d2b514cc2ba99918fb44 100644 (file)
@@ -12,7 +12,9 @@ use wcf\system\style\StyleHandler;
  * @package    WoltLabSuite\Core\System\Form\Builder\Field
  * @since      5.2
  */
-class IconFormField extends AbstractFormField {
+class IconFormField extends AbstractFormField implements IImmutableFormField {
+       use TImmutableFormField;
+       
        /**
         * @inheritDoc
         */
index 87921861582990429e517fc88e49eff46be5f3d6..978e2aa8bb2e8e80c598f937b41a23387b3a46f7 100644 (file)
@@ -14,7 +14,9 @@ use wcf\util\ArrayUtil;
  * @package    WoltLabSuite\Core\System\Form\Builder\Field
  * @since      5.2
  */
-class ItemListFormField extends AbstractFormField {
+class ItemListFormField extends AbstractFormField implements IImmutableFormField {
+       use TImmutableFormField;
+       
        /**
         * type of the returned save value (see `SAVE_VALUE_TYPE_*` constants)
         * @var string
index abc58ae2fb253106feaee6b06c2ba2ba2ac3626f..06aa215e9d8c1997e2ba77fabc1971561ffed749 100644 (file)
@@ -11,8 +11,9 @@ use wcf\system\form\builder\field\validation\FormFieldValidationError;
  * @package    WoltLabSuite\Core\System\Form\Builder\Field
  * @since      5.2
  */
-class MultipleSelectionFormField extends AbstractFormField implements IFilterableSelectionFormField, INullableFormField {
+class MultipleSelectionFormField extends AbstractFormField implements IFilterableSelectionFormField, IImmutableFormField, INullableFormField {
        use TFilterableSelectionFormField;
+       use TImmutableFormField;
        use TNullableFormField;
        
        /**
index 2a982b4e6879b26222f2a9283272abc10f1e2548..ca211a5fdd32b8b5304521ee44dfbcc31390685b 100644 (file)
@@ -11,7 +11,8 @@ use wcf\system\form\builder\field\validation\FormFieldValidationError;
  * @package    WoltLabSuite\Core\System\Form\Builder\Field
  * @since      5.2
  */
-class RadioButtonFormField extends AbstractFormField implements ISelectionFormField {
+class RadioButtonFormField extends AbstractFormField implements IImmutableFormField, ISelectionFormField {
+       use TImmutableFormField;
        use TSelectionFormField;
        
        /**
index 5e5e5be7f107a97cccd07936a1dcad3d2609194d..82c73ac70d933b87b96dc7ff5ce21001e4e12f40 100644 (file)
@@ -11,7 +11,8 @@ use wcf\system\form\builder\field\validation\FormFieldValidationError;
  * @package    WoltLabSuite\Core\System\Form\Builder\Field
  * @since      5.2
  */
-class SingleSelectionFormField extends AbstractFormField implements IFilterableSelectionFormField, INullableFormField {
+class SingleSelectionFormField extends AbstractFormField implements IImmutableFormField, IFilterableSelectionFormField, INullableFormField {
+       use TImmutableFormField;
        use TFilterableSelectionFormField;
        use TNullableFormField;
        
diff --git a/wcfsetup/install/files/lib/system/form/builder/field/TImmutableFormField.class.php b/wcfsetup/install/files/lib/system/form/builder/field/TImmutableFormField.class.php
new file mode 100644 (file)
index 0000000..e93c5d2
--- /dev/null
@@ -0,0 +1,41 @@
+<?php
+namespace wcf\system\form\builder\field;
+
+/**
+ * Provides default implementations of `IImmutableFormField` methods.
+ * 
+ * @author     Matthias Schmidt
+ * @copyright  2001-2018 WoltLab GmbH
+ * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package    WoltLabSuite\Core\System\Form\Builder\Field
+ * @since      5.2
+ */
+trait TImmutableFormField {
+       /**
+        * `true` if the value of this field is immutable and `false` otherwise
+        * @var bool
+        */
+       protected $__immutable = false;
+
+       /**
+        * Sets whether the value of this field is immutable and returns this field.
+        * 
+        * @param       bool            $immutable      determines if field value is immutable
+        * @return      static                          this field
+        */
+       public function immutable($immutable = true) {
+               $this->__immutable = $immutable;
+               
+               return $this;
+       }
+       
+       /**
+        * Returns `true` if the value of this field is immutable and returns `false`
+        * otherwise. By default, fields are mutable.
+        * 
+        * @return      bool
+        */
+       public function isImmutable() {
+               return $this->__immutable;
+       }
+}
\ No newline at end of file
index db99e851107b037a2fe7b7aa8b84011200d36f00..ab303eb3cb72ec1f5504716fefd65de972c26de0 100644 (file)
@@ -13,7 +13,8 @@ use wcf\system\language\LanguageFactory;
  * @package    WoltLabSuite\Core\System\Form\Builder\Field
  * @since      5.2
  */
-class TextFormField extends AbstractFormField implements II18nFormField, IMaximumLengthFormField, IMinimumLengthFormField, IPlaceholderFormField {
+class TextFormField extends AbstractFormField implements II18nFormField, IImmutableFormField, IMaximumLengthFormField, IMinimumLengthFormField, IPlaceholderFormField {
+       use TImmutableFormField;
        use TI18nFormField {
                validate as protected i18nValidate;
        }
index 12b1b0d46ad9f91ee0ea0b8e9727622dd2d3a8f7..18f67e8f551406ad9d7061aa9a561e09875e2c4c 100644 (file)
@@ -2,8 +2,10 @@
 namespace wcf\system\form\builder\field\user;
 use wcf\data\user\UserProfile;
 use wcf\system\form\builder\field\AbstractFormField;
+use wcf\system\form\builder\field\IImmutableFormField;
 use wcf\system\form\builder\field\IMultipleFormField;
 use wcf\system\form\builder\field\INullableFormField;
+use wcf\system\form\builder\field\TImmutableFormField;
 use wcf\system\form\builder\field\TMultipleFormField;
 use wcf\system\form\builder\field\TNullableFormField;
 use wcf\system\form\builder\field\validation\FormFieldValidationError;
@@ -19,7 +21,8 @@ use wcf\util\StringUtil;
  * @package    WoltLabSuite\Core\System\Form\Builder\Field\User
  * @since      5.2
  */
-class UserFormField extends AbstractFormField implements IMultipleFormField, INullableFormField {
+class UserFormField extends AbstractFormField implements IImmutableFormField, IMultipleFormField, INullableFormField {
+       use TImmutableFormField;
        use TMultipleFormField;
        use TNullableFormField;
        
index 8a5562655559eb9d10e92e1f0f9610ed7b5a9b00..8e2b298a82e53bb10741280480b7b066a7ed5f06 100644 (file)
@@ -1,10 +1,12 @@
 <?php
 namespace wcf\system\form\builder\field\user;
 use wcf\system\form\builder\field\AbstractFormField;
+use wcf\system\form\builder\field\IImmutableFormField;
 use wcf\system\form\builder\field\IMaximumLengthFormField;
 use wcf\system\form\builder\field\IMinimumLengthFormField;
 use wcf\system\form\builder\field\INullableFormField;
 use wcf\system\form\builder\field\IPlaceholderFormField;
+use wcf\system\form\builder\field\TImmutableFormField;
 use wcf\system\form\builder\field\TMaximumLengthFormField;
 use wcf\system\form\builder\field\TMinimumLengthFormField;
 use wcf\system\form\builder\field\TNullableFormField;
@@ -23,7 +25,8 @@ use wcf\util\UserUtil;
  * @package    WoltLabSuite\Core\System\Form\Builder\Field\User
  * @since      5.2
  */
-class UsernameFormField extends AbstractFormField implements IMaximumLengthFormField, IMinimumLengthFormField, INullableFormField, IPlaceholderFormField {
+class UsernameFormField extends AbstractFormField implements IImmutableFormField, IMaximumLengthFormField, IMinimumLengthFormField, INullableFormField, IPlaceholderFormField {
+       use TImmutableFormField;
        use TMaximumLengthFormField;
        use TMinimumLengthFormField;
        use TNullableFormField;