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|DocumentModel | $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
Add a color picker to your form
Add a field to edit the given config variable
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
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 list_selector field to your form
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 payment 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 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.
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
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?
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 242
__construct($args = array())
No description
at line 2798
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 641
FormComponent
addComponent(string $name, FormComponent $object, array $params = [], bool $force = false)
Adds the given form component object to the form as field.
at line 1591
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 1261
bool
add_button(string $name, mixed $params)
No description
at line 1204
bool
add_button_cancel(bool|string $label = false, null $href = null, array $params = array())
Add a cancel button
at line 1191
bool
add_button_reset(bool|string $label = false, array $params = array())
Add a save/submit button
at line 1179
bool
add_button_submit(bool|string $label = false, array $params = array())
Add a save/submit button
at line 358
T|FormComponent
add_field(string $name, array $params, bool $force = false, array $p1 = array())
No description
at line 1073
FormComponent
add_field_captcha(string $name, array $params = [], bool $force = false)
Add a captcha
at line 1086
FormComponent
add_field_cat_selector(string $name, array $params = [], bool $force = false)
Add a cat_selector field to your form
at line 1099
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 886
FormComponent
add_field_checkbox(string $name, array $params = [], bool $force = false)
Add a checkbox field to your form
at line 873
FormComponent
add_field_color(string $name, array $params = [], bool $force = false)
Add a color picker to your form
at line 1242
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 968
FormComponent
add_field_date(string $name, array $params = [], bool $force = false)
Add a date field to your form
at line 912
FormComponent
add_field_datetime(string $name, array $params = [], bool $force = false)
Add a datetime field to your form
at line 938
FormComponent
add_field_description(string $name = null, array $params = [], bool $force = false)
Add a description field to your form
at line 1059
FormComponent
add_field_document(string $name, array $params = [], bool $force = false)
Add a document selector field to your form
at line 1222
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 667
FormComponent
add_field_email(string $name, array $params = [], bool $force = false)
Add an Email field to your form
at line 759
FormComponent
add_field_fieldset(string $name = null, array $params = [], bool $force = false)
Add a Fieldset to your form
at line 773
FormComponent
add_field_fieldset_close(string $name, array $params = [], bool $force = false)
Add a Fieldset Close to your form
at line 1139
FormComponent
add_field_file(string $name, array $params = [], bool $force = false)
Add a file field to your form
at line 1033
FormComponent
add_field_group_selector(string $name, array $params = [], bool $force = false)
Add a group_selector field to your form
at line 786
FormComponent
add_field_hidden(string $name, array|string $params = [], bool $force = false)
Add a hidden field to your form
at line 860
FormComponent
add_field_icon_select(string $name, array $params = [], bool $force = false)
Add a icon select field to your form
at line 1126
FormComponent
add_field_list_selector(string $name, array $params = [], bool $force = false)
deprecated
deprecated
Add a list_selector field to your form
at line 1153
FormComponent
add_field_multifile(string $name, array $params = [], bool $force = false)
deprecated
deprecated
Add a file field to your form
at line 925
FormComponent
add_field_multitext(string $name, array $params = [], bool $force = false)
Add a multitext field to your form
at line 693
FormComponent
add_field_number(string $name, array $params = [], bool $force = false)
Add an Number field to your form
at line 834
FormComponent
add_field_password(string $name, array $params = [], bool $force = false)
Add a password field to your form
at line 1166
FormComponent
add_field_payment(string $name, array $params = [], bool $force = false)
Add an payment field to your form
at line 680
FormComponent
add_field_phone(string $name, array $params = [], bool $force = false)
Add an Phone field to your form
at line 1112
FormComponent
add_field_policy_selector(string $name, array $params = [], bool $force = false)
Add a policy_selector field to your form
at line 899
FormComponent
add_field_radio(string $name, array $params = [], bool $force = false)
Add a radio field to your form
at line 994
FormComponent
add_field_rrule(string $name, array $params = [], bool $force = false)
Add a recurring rule field (datetime variant) to your form
at line 745
FormComponent
add_field_section_break(string $name = null, array $params = [], bool $force = false)
Add a section_break to your form
at line 847
FormComponent
add_field_select(string $name, array $params = [], bool $force = false)
Add a select field to your form
at line 1007
FormComponent
add_field_slider(string $name, array $params = [], bool $force = false)
Add a slider field to your form
at line 802
FormComponent
add_field_static_text(string $name = null, array $params = [], bool $force = false)
Add a static_text field to your form
at line 952
FormComponent
add_field_static_value(string $name, $params = [], bool $force = false)
Add a static_value field to your form
at line 819
FormComponent
add_field_tag(string $name, array $params = [], bool $force = false)
Add a tag field to your form
at line 654
FormComponent
add_field_text(string $name, array $params = [], bool $force = false)
Add a Textbox to your form
at line 732
FormComponent
add_field_textarea(string $name, array $params = [], bool $force = false)
Add a Textbox to your form
at line 719
FormComponent
add_field_textbox_list(string $name, array $params = [], bool $force = false)
Add a Textbox list to your form
at line 981
FormComponent
add_field_toggle_switch(string $name, array $params = [], bool $force = false)
Add a toggle switch field to your form
at line 706
FormComponent
add_field_url(string $name, array $params = [], bool $force = false)
Add an URL field to your form
at line 1046
FormComponent
add_field_user_selector(string $name, array $params = [], bool $force = false)
Add an user_selector field to your form
at line 1020
FormComponent
add_field_webfetcher(string $name, array $params = [], bool $force = false)
Add a group_selector field to your form
at line 1281
add_loading_message(string $message = null)
deprecated
deprecated
Add a loading indicator when the form is submitted
at line 4212
mixed
add_obj()
deprecated
deprecated
No description
at line 620
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 1533
FormRowRenderer
add_row_renderer(string $name, FormRowRenderer $render_obj)
Add a new row renderer
at line 1488
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 1514
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 600
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 200
append(string $name, mixed $value, bool|string $key = false)
No description
at line 1973
cb_model_get_property($matches)
No description
at line 3933
close_fieldset()
No description
at line 2821
string
close_form()
No description
in
FormBase at line 185
void
concat(string $name, string $value)
No description
in
FormBase at line 170
mixed
destroy($name)
No description
at line 2765
string
display_feedback()
No description
at line 3533
string
display_field(string $field, FormBase $data = null)
No description
at line 3205
string
display_form(bool $with_form_tag = true)
No description
at line 3604
bool|Form
fdl2form($config)
No description
at line 3344
bool
form_has_required_fields()
Returns true if the form contains required fields
at line 1981
bool
form_request_valid()
No description
in
FormBase at line 76
mixed
get(string $name)
No description
at line 2786
array
getAjaxFormCallbacks()
Callbacks getter method.
in
FormBase at line 83
array
getConfig()
No description
at line 4115
string
getFormActionURL()
Get current FORM Action URL
at line 4014
bool
getIsAjaxForm()
No description
at line 3035
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 1609
false
get_additional_filesources()
Get all dms instances available for this portlet to use as file-source in form
at line 3050
array
get_buttons_array(array $button_ids = array())
Get Buttons Array
at line 2777
string
get_close_form()
Returns the Form Closing HTML
at line 181
string
get_curent_process_id_lookup_name()
No description
at line 191
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 1740
get_edit_var()
No description
at line 3975
string
get_feedback(string $type = null)
Return the last Feedback Message
at line 3362
string
get_field(string $field, FormComponent $data = null)
No description
at line 1653
string
get_field_data(string $field, string $attribute)
No description
at line 1697
string
get_field_default_value(string $field)
No description
at line 1665
string
get_field_dom_id(string $fieldId)
Returns the ID for the form element, e.g. used in FormDocument.
at line 1713
FormComponent|false
get_field_object(string $field_name)
No description
at line 1677
mixed
get_field_value(string $field, bool $force_single_value = false)
Get the property associated with a specific field
at line 1728
array
get_field_values(bool $force_single_values = false)
No description
in
FormBase at line 219
array
get_group(string $prefix)
No description
at line 343
Core|false
get_mod()
No description
at line 2874
string
get_open_form()
No description
in
FormBase at line 91
array
get_properties()
No description
at line 1620
mixed
get_request_var(string $field_name)
No description
at line 1883
handle_ajax_response(bool $throw_ajax_response = true)
No description
in
FormBase at line 39
init_obj()
Initializes the form base
at line 560
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 239
bool
is_displayed()
Checks if the field is hidden by a tag. It is important when validating
at line 2013
bool
is_validated()
Form passed all validations?
at line 2886
string
open_form(bool $only_hidden_fields = false)
No description
at line 2584
string
parse_pop_query($src)
No description
at line 2621
bool
populate(int $record_id)
No description
at line 2386
protected
post_processing()
No description
at line 2064
process(bool $throw_ajax_response = true)
No description
at line 2291
protected array
process_fields(array $loop_fields)
No description
at line 2706
query($query)
No description
at line 2274
void
redirect_back()
Redirect Back (Uses previous page in form if available)
at line 3183
string
render(bool $with_form_tag = true)
No description
at line 3221
string
render_field(string $name, string $value, array $params)
Returns the rendered field as defined by the parameters
at line 3243
array
render_form(bool $with_form_tag = true)
No description
at line 2691
reset()
No description
at line 2447
protected
save_data(array $data_array = array())
No description
at line 1968
sendAjaxResponseJsonHeader()
Adds the JSON response into the header.
in
FormBase at line 103
$this
set(string $name, mixed $value)
No description
at line 4107
Form
setFormActionURL(string $url = null)
Set Form Action URL Default: none
Old param: form_action
at line 4093
Form
setFormName(string $name = null)
Set Form Name Default: Autogenerated unique id
Old param: form_name
at line 4006
Form
setIsAjaxForm(bool $bool = true, bool $autoSubmit = false)
Submit and Process this form via AJAX Default: false Old Param: ajax_form
at line 4079
Form
setIsHiddenLabel(bool $bool = true)
Set all labels to be hidden Default: false
Old param: hide_label
at line 3991
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 4065
Form
setIsReadonly(bool $bool = true)
Set complete form to be readonly Default: false
at line 4149
Form
setIsSecureForm(bool $bool = true)
Apply security measures available to this form (CSFR Check),
Default: true
at line 4053
Form
setLoadingMessage(null $message = null)
Display Loading spinner and message when user submits form Default: none Old Param: loading_message
at line 4040
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 4131
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 4161
Form
setTitle(string $title)
Set Form Title, Title use automatically used in feedback messages
at line 4026
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 1555
set_db_handler($handler)
No description
at line 1577
set_download_handler($handler)
No description
at line 1763
set_edit_var(string $value)
No description
at line 324
set_enable_auto_lock(bool $bool)
If true, this form uses the DocumentLock to lock this form and show lock/view information.
at line 3962
set_error(mixed $field, mixed $message)
mark field as Error and return custom Error-Message
at line 3948
set_feedback(string $message, bool $error = false, bool $reset = false)
Set Form Feedback
at line 1798
bool
set_field_property(mixed $value_array, bool|string $specific_property = false, bool|string $specific_field = false)
No description
at line 1544
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 1781
set_form_property(string $property, string $value)
No description
at line 334
set_mod($mod)
No description
at line 1565
set_model(Model $model)
No description
in
FormBase at line 155
void
set_properties(array $array)
No description
at line 1631
set_request_var(string $field_name, mixed $value)
No description
at line 2021
bool
set_request_vars()
No description
at line 1641
unset_request_var(string $field_name)
Removes a certain field from the request array
at line 2718
bool
validate()
No description