Form
class Form extends FormBase
Class Form
Constants
| AJAX_FORM_CALLBACK_BEFORE |
|
| AJAX_FORM_CALLBACK_SUCCESS |
|
| AJAX_FORM_CALLBACK_FAILED |
|
| AJAX_FORM_CALLBACK_COMPLETE |
|
| private ALLOWED_AJAX_FORM_CALLBACKS |
|
| REQUEST_METHOD_GET |
|
| REQUEST_METHOD_POST |
|
Properties
| protected array | $config | from FormBase | |
| bool | $save_requires_edit_var | from FormBase | |
| Form | $form | from FormBase | |
| protected | $field_disable_save | Set to false if this field is not "saveable", e.g. static test |
from FormBase |
| FormComponent[] | $fields | ||
| array | $buttons | ||
| array | $field_default_options | ||
| array | $feedback | ||
| array | $error_fields | ||
| bool | $is_validated | ||
| array | $image_mimes | ||
| array | $mime_ext | ||
| array | $date_components | ||
| Model|null | $model | ||
| array | $tag_sources | ||
| int | $open_fieldsets | ||
| array | $relatedi18nFields |
Methods
No description
Adds a callback of a certain type to the form, which will then be triggered whenever the form is about to send a XMLHttpRequest to the form action.
Adds the given form component object to the form as field.
Add a additional filesource for form file elements
No description
Add a cancel button
Add a save/submit button
Add a save/submit button
No description
Add a captcha
Add a cat_selector field to your form
Add a cat_selector for one of the customer categories defined in the selector module
Add a checkbox field to your form
No description
Add a color picker to your form
Add a field to edit the given config variable
Add content attachment field which may contain several content references like trendvotes
Add a date field to your form
Add a datetime field to your form
Add a description field to your form
Add a document selector field to your form
Add a field to edit the given config variable
Add an Email field to your form
Add a Fieldset to your form
Add a Fieldset Close to your form
Add a file field to your form
No description
Add a group_selector field to your form
Add a hidden field to your form
Add a icon select field to your form
Add a media attachment field which may contain an image or video
Add a file field to your form
Add a multitext field to your form
Add an Number field to your form
Add a password field to your form
Add an Phone field to your form
Add a policy_selector field to your form
Add a radio field to your form
Add a recurring rule field (datetime variant) to your form
Add a Search field to your form
Add a section_break to your form
Add a select field to your form
Add a slider field to your form
Add a static_text field to your form
Add a static_value field to your form
Add a tag field to your form
Add a Textbox to your form
Add a Textbox to your form
Add a Textbox list to your form
Add a toggle switch field to your form
Add an URL field to your form
Add an user_selector field to your form
Add a group_selector field to your form
Add a loading indicator when the form is submitted
Add required (String) Field (params as separate string parameters)
Create a single field row containing multiple fields, e.g. a select box and a textfield in one row
Create a table with multiple rows containing multiple fields.
Add (String) Field (params as separate string parameters)
No description
No description
No description
No description
No description
Returns true if the form contains required fields
No description
Callbacks getter method.
Return DocumentIndex associated with form (if available)
Return DocumentModel associated with form (if available)
Get current FORM Action URL
No description
Returns a link array containing the base parameters for this form (xui_form_name, ...) to be identified as this form in the form->process() function
Return Model associated with form (if available)
Get the properties of all available and writable fields
Get all dms instances available for this portlet to use as file-source in form
Get Buttons Array
Returns the Form Closing HTML
No description
Returns a unique id for the current form processing.
No description
Return the last Feedback Message
No description
No description
Returns the ID for the form element, e.g. used in FormDocument.
No description
Get the property associated with a specific field
No description
No description
No description
No description
Inserts a form component in the field array of the form.
Checks if the field is hidden by a tag. It is important when validating
Form passed all validations?
Set an additional validation callback, which is triggered during process()
No description
No description
No description
No description
No description
No description
No description
Redirect Back (Uses previous page in form if available)
No description
Returns the rendered field as defined by the parameters
No description
No description
No description
Adds the JSON response into the header.
Set Form Action URL Default: none
Set Form Name Default: Autogenerated unique id
Submit and Process this form via AJAX Default: false Old Param: ajax_form
Set all labels to be hidden Default: false
If you know that your form is used in context of an AJAX modal dialog, set this option for automatically closing the modal dialog Default: false Old Param: ajax_close
Set complete form to be readonly Default: false
Apply security measures available to this form (CSFR Check),
Display Loading spinner and message when user submits form Default: none Old Param: loading_message
Redirect user after successful form submission to the specified URL Using back as special param, will automatically use the referer to send the user back to the previous url before opening the form Default: none Old Param: redirect
Set Form Name - Default is an autogenerated unique id Default: POST Old param: request_method
Sets an ui component as target. Uses the dom unique id of the component as data entry in the form payload to trigger the ui component on submit.
No description
No description
No description
If true, this form uses the DocumentLock to lock this form and show lock/view information.
mark field as Error and return custom Error-Message
Set Form Feedback
No description
Specify the field which should get the focus by default Use TRUE to set focus to first field
No description
No description
No description
No description
Removes a certain field from the request array
No description
Details
at line 260
__construct($args = array())
No description
at line 2931
void
addAjaxFormCallback(string $event, string $jsFunction, bool $wrapInAnonFunction = true)
Adds a callback of a certain type to the form, which will then be triggered whenever the form is about to send a XMLHttpRequest to the form action.
Example: $form->addAjaxFormCallback('success', 'alert("Request succeeded.");');
at line 678
FormComponent
addComponent(string $name, FormComponent $object, array $params = [], bool $force = false)
Adds the given form component object to the form as field.
at line 1659
add_additional_filesource(string $key, array $get_selector_link_cb, array $get_file_cb, string $title)
Add a additional filesource for form file elements
at line 1329
bool
add_button(string $name, mixed $params)
No description
at line 1272
bool
add_button_cancel(bool|string $label = false, null $href = null, array $params = array())
Add a cancel button
at line 1259
bool
add_button_reset(bool|string $label = false, array $params = array())
Add a save/submit button
at line 1247
bool
add_button_submit(bool|string $label = false, array $params = array())
Add a save/submit button
at line 376
T|FormComponent
add_field(string $name, array $params, bool $force = false, array $p1 = array())
No description
at line 1146
FormCaptcha&FormComponent
add_field_captcha(string $name, array $params = [], bool $force = false)
Add a captcha
at line 1159
FormCatSelector&FormComponent
add_field_cat_selector(string $name, array $params = [], bool $force = false)
Add a cat_selector field to your form
at line 1172
FormCategorySelector&FormComponent
add_field_category_selector(string $name, array $params = [], bool $force = false)
Add a cat_selector for one of the customer categories defined in the selector module
at line 936
FormCheckbox&FormComponent
add_field_checkbox(string $name, array $params = [], bool $force = false)
Add a checkbox field to your form
at line 1224
FormChoice
add_field_choice(string $name, array $params = [], bool $force = false)
No description
at line 923
FormColor&FormComponent
add_field_color(string $name, array $params = [], bool $force = false)
Add a color picker to your form
at line 1310
FormConfig&FormComponent
add_field_config(string $variable, string $context, array $params = [], bool $force = false)
Add a field to edit the given config variable
optional params: context (the context of the configuration value)
at line 1133
FormContentAttachment
add_field_content_attachment(string $name, array $params = [], bool $force = false)
Add content attachment field which may contain several content references like trendvotes
at line 1018
FormDate&FormComponent
add_field_date(string $name, array $params = [], bool $force = false)
Add a date field to your form
at line 962
FormDatetime&FormComponent
add_field_datetime(string $name, array $params = [], bool $force = false)
Add a datetime field to your form
at line 988
FormDescription&FormComponent
add_field_description(string $name = null, array $params = [], bool $force = false)
Add a description field to your form
at line 1109
FormDocument&FormComponent
add_field_document(string $name, array $params = [], bool $force = false)
Add a document selector field to your form
at line 1290
FormDynConfig&FormComponent
add_field_dyn_config(string $variable, string $context, bool $params = false, bool $force = false)
deprecated
deprecated
Add a field to edit the given config variable
optional params: order_set_name (use a specific order set); forced_group_id (use this group id instead of the global one if set)
at line 717
FormEmail&FormComponent
add_field_email(string $name, array $params = [], bool $force = false)
Add an Email field to your form
at line 809
FormFieldset&FormComponent
add_field_fieldset(string $name = null, array $params = [], bool $force = false)
Add a Fieldset to your form
at line 823
FormFieldsetClose&FormComponent
add_field_fieldset_close(string $name, array $params = [], bool $force = false)
Add a Fieldset Close to your form
at line 1199
FormFile&FormComponent
add_field_file(string $name, array $params = [], bool $force = false)
Add a file field to your form
at line 1235
FormGeoSelector
add_field_geo_selector(string $name, array $params = [], bool $force = false)
No description
at line 1083
FormGroupSelector&FormComponent
add_field_group_selector(string $name, array $params = [], bool $force = false)
Add a group_selector field to your form
at line 836
FormHidden&FormComponent
add_field_hidden(string $name, array|string $params = [], bool $force = false)
Add a hidden field to your form
at line 910
FormIconSelect&FormComponent
add_field_icon_select(string $name, array $params = [], bool $force = false)
Add a icon select field to your form
at line 1122
FormMediaAttachment&FormComponent
add_field_media_attachment(string $name, array $params = [], bool $force = false)
Add a media attachment field which may contain an image or video
at line 1213
FormMultifile&FormComponent
add_field_multifile(string $name, array $params = [], bool $force = false)
deprecated
deprecated
Add a file field to your form
at line 975
FormMultitext&FormComponent
add_field_multitext(string $name, array $params = [], bool $force = false)
Add a multitext field to your form
at line 743
FormNumber&FormComponent
add_field_number(string $name, array $params = [], bool $force = false)
Add an Number field to your form
at line 884
FormPassword&FormComponent
add_field_password(string $name, array $params = [], bool $force = false)
Add a password field to your form
at line 730
FormPhone&FormComponent
add_field_phone(string $name, array $params = [], bool $force = false)
Add an Phone field to your form
at line 1185
FormPolicySelector&FormComponent
add_field_policy_selector(string $name, array $params = [], bool $force = false)
Add a policy_selector field to your form
at line 949
FormRadio&FormComponent
add_field_radio(string $name, array $params = [], bool $force = false)
Add a radio field to your form
at line 1044
FormRrule&FormComponent
add_field_rrule(string $name, array $params = [], bool $force = false)
Add a recurring rule field (datetime variant) to your form
at line 704
FormSearch&FormComponent
add_field_search(string $name, array $params = [], bool $force = false)
Add a Search field to your form
at line 795
FormSectionBreak&FormComponent
add_field_section_break(string $name = null, array $params = [], bool $force = false)
Add a section_break to your form
at line 897
FormSelect&FormComponent
add_field_select(string $name, array $params = [], bool $force = false)
Add a select field to your form
at line 1057
FormSlider&FormComponent
add_field_slider(string $name, array $params = [], bool $force = false)
Add a slider field to your form
at line 852
FormStaticText&FormComponent
add_field_static_text(string $name = null, array $params = [], bool $force = false)
Add a static_text field to your form
at line 1002
FormStaticValue&FormComponent
add_field_static_value(string $name, $params = [], bool $force = false)
Add a static_value field to your form
at line 869
FormTag&FormComponent
add_field_tag(string $name, array $params = [], bool $force = false)
Add a tag field to your form
at line 691
FormTextbox&FormComponent
add_field_text(string $name, array $params = [], bool $force = false)
Add a Textbox to your form
at line 782
FormTextarea&FormComponent
add_field_textarea(string $name, array $params = [], bool $force = false)
Add a Textbox to your form
at line 769
FormTextboxList&FormComponent
add_field_textbox_list(string $name, array $params = [], bool $force = false)
Add a Textbox list to your form
at line 1031
FormToggleSwitch&FormComponent
add_field_toggle_switch(string $name, array $params = [], bool $force = false)
Add a toggle switch field to your form
at line 756
FormUrl&FormComponent
add_field_url(string $name, array $params = [], bool $force = false)
Add an URL field to your form
at line 1096
FormUserSelector&FormComponent
add_field_user_selector(string $name, array $params = [], bool $force = false)
Add an user_selector field to your form
at line 1070
FormWebfetcher&FormComponent
add_field_webfetcher(string $name, array $params = [], bool $force = false)
Add a group_selector field to your form
at line 1349
add_loading_message(string $message = null)
deprecated
deprecated
Add a loading indicator when the form is submitted
at line 4398
mixed
add_obj()
deprecated
deprecated
No description
at line 657
FormComponent
add_required_sfield(string $name, string $label, string $type = null, mixed $default = null, array $params = array())
deprecated
deprecated
Add required (String) Field (params as separate string parameters)
at line 1601
FormRowRenderer
add_row_renderer(string $name, FormRowRenderer $render_obj)
Add a new row renderer
at line 1556
FormRowRendererMultifieldRow
add_row_renderer_multifield_row(string $name, mixed $label, array $field_names, array $column_width = [], string $layout = 'side', bool $hide_labels = true, array|string $css_classes = array(), array $tags = array())
Create a single field row containing multiple fields, e.g. a select box and a textfield in one row
at line 1582
FormRowRendererMultirowTable
add_row_renderer_multirow_table(string $name, array $fields, array $labels = array(), array $rows = array(), array|string $css_classes = array())
Create a table with multiple rows containing multiple fields.
at line 637
FormComponent
add_sfield(string $name, string $label, string $type = null, mixed $default = null, array $params = array())
deprecated
deprecated
Add (String) Field (params as separate string parameters)
in
FormBase at line 198
append(string $name, mixed $value, bool|string $key = false)
No description
at line 2057
cb_model_get_property($matches)
No description
at line 4084
close_fieldset()
No description
at line 2954
string
close_form($includeButtons = false)
No description
in
FormBase at line 183
void
concat(string $name, string $value)
No description
in
FormBase at line 168
mixed
destroy($name)
No description
at line 2898
string
display_feedback()
No description
at line 3683
string
display_field(string $field, FormBase $data = null)
No description
at line 3346
string
display_form(bool $with_form_tag = true)
No description
at line 3754
bool|Form
fdl2form($config)
No description
at line 3485
bool
form_has_required_fields()
Returns true if the form contains required fields
at line 2065
bool
form_request_valid()
No description
in
FormBase at line 77
mixed
get(string $name)
No description
at line 2919
array
getAjaxFormCallbacks()
Callbacks getter method.
in
FormBase at line 84
array
getConfig()
No description
at line 4383
DocumentIndex|null
getDocumentIndex()
Return DocumentIndex associated with form (if available)
at line 4374
DocumentModel|null
getDocumentModel()
Return DocumentModel associated with form (if available)
at line 4274
string
getFormActionURL()
Get current FORM Action URL
at line 4173
bool
getIsAjaxForm()
No description
at line 3170
array
getLinkFormParams($field = false)
Returns a link array containing the base parameters for this form (xui_form_name, ...) to be identified as this form in the form->process() function
at line 4365
Model|null
getModel()
Return Model associated with form (if available)
at line 1808
array
getWritableFieldValues(bool $forceSingleValues = false)
Get the properties of all available and writable fields
at line 1677
false
get_additional_filesources()
Get all dms instances available for this portlet to use as file-source in form
at line 3185
array
get_buttons_array(array $button_ids = array())
Get Buttons Array
at line 2910
string
get_close_form()
Returns the Form Closing HTML
at line 199
string
get_curent_process_id_lookup_name()
No description
at line 209
get_current_process_id()
Returns a unique id for the current form processing.
This id will consist through post request and, if possible, when refreshing the page.
at line 1824
get_edit_var()
No description
at line 4134
string
get_feedback(string $type = null)
Return the last Feedback Message
at line 3503
string
get_field(string $field, FormComponent $data = null)
No description
at line 1721
string
get_field_data(string $field, string $attribute)
No description
at line 1766
string
get_field_default_value(string $field)
No description
at line 1733
string
get_field_dom_id(string $fieldId)
Returns the ID for the form element, e.g. used in FormDocument.
at line 1782
FormComponent|null
get_field_object(string $field_name)
No description
at line 1745
mixed
get_field_value(string $field, bool $force_single_value = false)
Get the property associated with a specific field
at line 1793
array
get_field_values(bool $force_single_values = false)
No description
in
FormBase at line 217
array
get_group(string $prefix)
No description
at line 361
Core|false
get_mod()
No description
at line 3017
string
get_open_form()
No description
in
FormBase at line 92
array
get_properties()
No description
at line 1688
mixed
get_request_var(string $field_name)
No description
at line 1967
handle_ajax_response(bool $throw_ajax_response = true)
No description
in
FormBase at line 39
init_obj()
Initializes the form base
at line 597
insertField(string $fieldId, FormComponent $formComponent, string|null $insertBeforeFieldId = null, string|null $insertAfterFieldId = null)
Inserts a form component in the field array of the form.
Usually the new component is added as the last field. However, it is possible to place a field before or after another component.
in
FormBase at line 237
bool
is_displayed()
Checks if the field is hidden by a tag. It is important when validating
at line 2097
bool
is_validated()
Form passed all validations?
at line 2810
void
onValidate(Closure $callback)
Set an additional validation callback, which is triggered during process()
at line 3029
string
open_form(bool $only_hidden_fields = false)
No description
at line 2668
string
parse_pop_query($src)
No description
at line 2707
bool
populate(int $record_id)
No description
at line 2470
protected
post_processing()
No description
at line 2148
process(bool $throw_ajax_response = true)
No description
at line 2375
protected array
process_fields(array $loop_fields)
No description
at line 2792
query($query)
No description
at line 2358
void
redirect_back()
Redirect Back (Uses previous page in form if available)
at line 3324
string
render(bool $with_form_tag = true)
No description
at line 3362
string
render_field(string $name, string $value, array $params)
Returns the rendered field as defined by the parameters
at line 3384
array
render_form(bool $with_form_tag = true)
No description
at line 2777
reset()
No description
at line 2531
protected
save_data(array $data_array = array())
No description
at line 2052
sendAjaxResponseJsonHeader()
Adds the JSON response into the header.
in
FormBase at line 104
$this
set(string $propertyName, mixed $propertyValue)
No description
at line 4266
Form
setFormActionURL(string $url = null)
Set Form Action URL Default: none
Old param: form_action
at line 4252
Form
setFormName(string $name = null)
Set Form Name Default: Autogenerated unique id
Old param: form_name
at line 4165
Form
setIsAjaxForm(bool $bool = true, bool $autoSubmit = false)
Submit and Process this form via AJAX Default: false Old Param: ajax_form
at line 4238
Form
setIsHiddenLabel(bool $bool = true)
Set all labels to be hidden Default: false
Old param: hide_label
at line 4150
Form
setIsModalClosedOnAjaxSubmit(bool $bool = true)
If you know that your form is used in context of an AJAX modal dialog, set this option for automatically closing the modal dialog Default: false Old Param: ajax_close
at line 4224
Form
setIsReadonly(bool $bool = true)
Set complete form to be readonly Default: false
at line 4308
Form
setIsSecureForm(bool $bool = true)
Apply security measures available to this form (CSFR Check),
Default: true
at line 4212
Form
setLoadingMessage(null $message = null)
Display Loading spinner and message when user submits form Default: none Old Param: loading_message
at line 4199
Form
setRedirectURL(string $url = 'back')
Redirect user after successful form submission to the specified URL Using back as special param, will automatically use the referer to send the user back to the previous url before opening the form Default: none Old Param: redirect
at line 4290
Form
setRequestMethod(string $method = self::REQUEST_METHOD_POST)
Set Form Name - Default is an autogenerated unique id Default: POST Old param: request_method
at line 4320
Form
setTitle(string $title)
Set Form Title, Title use automatically used in feedback messages
at line 4185
void
setUITarget(UIAjaxComponent $component)
Sets an ui component as target. Uses the dom unique id of the component as data entry in the form payload to trigger the ui component on submit.
at line 1623
set_db_handler($handler)
No description
at line 1645
set_download_handler($handler)
No description
at line 1847
set_edit_var(string $value)
No description
at line 342
set_enable_auto_lock(bool $bool)
If true, this form uses the DocumentLock to lock this form and show lock/view information.
at line 4121
set_error(mixed $field, mixed $message)
mark field as Error and return custom Error-Message
at line 4099
set_feedback(string $message, bool $error = false, bool $reset = false)
Set Form Feedback
at line 1882
bool
set_field_property(mixed $value_array, bool|string $specific_property = false, bool|string $specific_field = false)
No description
at line 1612
set_focus(mixed $field_id)
Specify the field which should get the focus by default Use TRUE to set focus to first field
at line 1865
set_form_property(string $property, string $value)
No description
at line 352
set_mod($mod)
No description
at line 1633
set_model(Model $model)
No description
in
FormBase at line 153
void
set_properties(array $array)
No description
at line 1699
set_request_var(string $field_name, mixed $value)
No description
at line 2105
bool
set_request_vars()
No description
at line 1709
unset_request_var(string $field_name)
Removes a certain field from the request array
at line 2818
bool
validate()
deprecated
deprecated
No description
at line 2830
bool
validateFormFields()
No description