From fd38b710751c6d2ec59c02474d0b39142b9731b7 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Fri, 15 Jan 2021 16:54:17 +0100 Subject: [PATCH] Mark since when new form builder features are available --- docs/php/api/form_builder/form_fields.md | 6 +++++- docs/php/api/form_builder/structure.md | 8 +++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/docs/php/api/form_builder/form_fields.md b/docs/php/api/form_builder/form_fields.md index 892bb28b..a54843de 100644 --- a/docs/php/api/form_builder/form_fields.md +++ b/docs/php/api/form_builder/form_fields.md @@ -32,7 +32,9 @@ Objects of this class require a label. The return value of `getSaveValue()` is the integer representation of the boolean value, i.e. `0` or `1`. -### 5.3.2+ `CheckboxFormField` +### `CheckboxFormField` + +!!! info "Only available since version 5.3.2." `CheckboxFormField` extends `BooleanFormField` and offers a simple HTML checkbox. @@ -283,6 +285,8 @@ The relevant `UserProfile` objects can be accessed via the `getUsers()` method. ### `UserPasswordField` +!!! info "Only available since version 5.4." + `UserPasswordField` is a form field for users' to enter their current password. The class implements `IAttributeFormField`, `IAutoCompleteFormField`, `IAutoFocusFormField`, and `IPlaceholderFormField` diff --git a/docs/php/api/form_builder/structure.md b/docs/php/api/form_builder/structure.md index 29be4d4a..a1d7e344 100644 --- a/docs/php/api/form_builder/structure.md +++ b/docs/php/api/form_builder/structure.md @@ -155,7 +155,7 @@ WoltLab Suite provides a default implementation with the `FormDocument` class. If the form contains a `IFileFormField`, `multipart/form-data` is returned, otherwise `null` is returned. - `loadValues(array $data, IStorableObject $object)` is used when editing an existing object to set the form field values by calling `IFormField::loadValue()` for all form fields. Additionally, the form mode is set to `IFormDocument::FORM_MODE_UPDATE`. -- `markRequiredFields(bool $markRequiredFields = true): self` and `marksRequiredFields(): bool` can be used to set and check whether fields that are required are marked (with an asterisk in the label) in the output. +- 5.4+ `markRequiredFields(bool $markRequiredFields = true): self` and `marksRequiredFields(): bool` can be used to set and check whether fields that are required are marked (with an asterisk in the label) in the output. - `method($method)` and `getMethod()` can be used to set and get the `method` attribute of the `
` HTML element. By default, the method is `post`. - `prefix($prefix)` and `getPrefix()` can be used to set and get a global form prefix that is prepended to form elements’ names and ids to avoid conflicts with other forms. @@ -247,6 +247,8 @@ WoltLab Suite Core provides a variety of interfaces and matching traits with def #### `IAutoCompleteFormField` +!!! info "Only available since version 5.4." + `IAutoCompleteFormField` has to be implemented by form fields that support the [`autocomplete` attribute](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofilling-form-controls:-the-autocomplete-attribute). The implementing class has to implement the methods `autoComplete(?string $autoComplete): self` and `getAutoComplete(): ?string`, which are used to set and get the autocomplete value, respectively. `TAutoCompleteFormField` provides a default implementation of these two methods and `TTextAutoCompleteFormField` specializes the trait for text form fields. @@ -299,6 +301,8 @@ By default, form field are mutable. #### `IInputModeFormField` +!!! info "Only available since version 5.4." + `IInputModeFormField` has to be implemented by form fields that support the [`inputmode` attribute](https://html.spec.whatwg.org/multipage/interaction.html#input-modalities:-the-inputmode-attribute). The implementing class has to implement the methods `inputMode(?string $inputMode): self` and `getInputMode(): ?string`, which are used to set and get the input mode, respectively. `TInputModeFormField` provides a default implementation of these two methods. @@ -380,6 +384,8 @@ The implementing class has to implement the methods `packageIDs(array $packageID #### `IPatternFormField` +!!! info "Only available since version 5.4." + `IPatternFormField` has to be implemented by form fields that support the [`pattern` attribute](https://html.spec.whatwg.org/multipage/input.html#the-pattern-attribute). The implementing class has to implement the methods `pattern(?string $pattern): self` and `getPattern(): ?string`, which are used to set and get the pattern, respectively. `TPatternFormField` provides a default implementation of these two methods. -- 2.20.1