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

__construct($args = array())

No description

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.

addComponent(string $name, FormComponent $object, array $params = [], bool $force = false)

Adds the given form component object to the form as field.

add_additional_filesource(string $key, array $get_selector_link_cb, array $get_file_cb, string $title)

Add a additional filesource for form file elements

bool
add_button(string $name, mixed $params)

No description

bool
add_button_cancel(bool|string $label = false, null $href = null, array $params = array())

Add a cancel button

bool
add_button_reset(bool|string $label = false, array $params = array())

Add a save/submit button

bool
add_button_submit(bool|string $label = false, array $params = array())

Add a save/submit button

add_field(string $name, array $params, bool $force = false, array $p1 = array())

No description

add_field_captcha(string $name, array $params = [], bool $force = false)

Add a captcha

add_field_cat_selector(string $name, array $params = [], bool $force = false)

Add a cat_selector field to your form

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

add_field_checkbox(string $name, array $params = [], bool $force = false)

Add a checkbox field to your form

add_field_choice(string $name, array $params = [], bool $force = false)

No description

add_field_color(string $name, array $params = [], bool $force = false)

Add a color picker to your form

add_field_config(string $variable, string $context, array $params = [], bool $force = false)

Add a field to edit the given config variable

add_field_content_attachment(string $name, array $params = [], bool $force = false)

Add content attachment field which may contain several content references like trendvotes

add_field_date(string $name, array $params = [], bool $force = false)

Add a date field to your form

add_field_datetime(string $name, array $params = [], bool $force = false)

Add a datetime field to your form

add_field_description(string $name = null, array $params = [], bool $force = false)

Add a description field to your form

add_field_document(string $name, array $params = [], bool $force = false)

Add a document selector field to your form

add_field_dyn_config(string $variable, string $context, bool $params = false, bool $force = false) deprecated

Add a field to edit the given config variable

add_field_email(string $name, array $params = [], bool $force = false)

Add an Email field to your form

add_field_fieldset(string $name = null, array $params = [], bool $force = false)

Add a Fieldset to your form

add_field_fieldset_close(string $name, array $params = [], bool $force = false)

Add a Fieldset Close to your form

add_field_file(string $name, array $params = [], bool $force = false)

Add a file field to your form

add_field_geo_selector(string $name, array $params = [], bool $force = false)

No description

add_field_group_selector(string $name, array $params = [], bool $force = false)

Add a group_selector field to your form

add_field_hidden(string $name, array|string $params = [], bool $force = false)

Add a hidden field to your form

add_field_icon_select(string $name, array $params = [], bool $force = false)

Add a icon select field to your form

add_field_media_attachment(string $name, array $params = [], bool $force = false)

Add a media attachment field which may contain an image or video

add_field_multifile(string $name, array $params = [], bool $force = false) deprecated

Add a file field to your form

add_field_multitext(string $name, array $params = [], bool $force = false)

Add a multitext field to your form

add_field_number(string $name, array $params = [], bool $force = false)

Add an Number field to your form

add_field_password(string $name, array $params = [], bool $force = false)

Add a password field to your form

add_field_phone(string $name, array $params = [], bool $force = false)

Add an Phone field to your form

add_field_policy_selector(string $name, array $params = [], bool $force = false)

Add a policy_selector field to your form

add_field_radio(string $name, array $params = [], bool $force = false)

Add a radio field to your form

add_field_rrule(string $name, array $params = [], bool $force = false)

Add a recurring rule field (datetime variant) to your form

add_field_search(string $name, array $params = [], bool $force = false)

Add a Search field to your form

add_field_section_break(string $name = null, array $params = [], bool $force = false)

Add a section_break to your form

add_field_select(string $name, array $params = [], bool $force = false)

Add a select field to your form

add_field_slider(string $name, array $params = [], bool $force = false)

Add a slider field to your form

add_field_static_text(string $name = null, array $params = [], bool $force = false)

Add a static_text field to your form

add_field_static_value(string $name, $params = [], bool $force = false)

Add a static_value field to your form

add_field_tag(string $name, array $params = [], bool $force = false)

Add a tag field to your form

add_field_text(string $name, array $params = [], bool $force = false)

Add a Textbox to your form

add_field_textarea(string $name, array $params = [], bool $force = false)

Add a Textbox to your form

add_field_textbox_list(string $name, array $params = [], bool $force = false)

Add a Textbox list to your form

add_field_toggle_switch(string $name, array $params = [], bool $force = false)

Add a toggle switch field to your form

add_field_url(string $name, array $params = [], bool $force = false)

Add an URL field to your form

add_field_user_selector(string $name, array $params = [], bool $force = false)

Add an user_selector field to your form

add_field_webfetcher(string $name, array $params = [], bool $force = false)

Add a group_selector field to your form

add_loading_message(string $message = null) deprecated

Add a loading indicator when the form is submitted

mixed
add_obj() deprecated

No description

add_required_sfield(string $name, string $label, string $type = null, mixed $default = null, array $params = array()) deprecated

Add required (String) Field (params as separate string parameters)

add_row_renderer(string $name, FormRowRenderer $render_obj)

Add a new row renderer

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

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.

add_sfield(string $name, string $label, string $type = null, mixed $default = null, array $params = array()) deprecated

Add (String) Field (params as separate string parameters)

append(string $name, mixed $value, bool|string $key = false)

No description

from  FormBase
cb_model_get_property($matches)

No description

close_fieldset()

No description

string
close_form($includeButtons = false)

No description

void
concat(string $name, string $value)

No description

from  FormBase
mixed
destroy($name)

No description

from  FormBase
string
display_feedback()

No description

string
display_field(string $field, FormBase $data = null)

No description

string
display_form(bool $with_form_tag = true)

No description

bool|Form
fdl2form($config)

No description

bool
form_has_required_fields()

Returns true if the form contains required fields

bool
form_request_valid()

No description

mixed
get(string $name)

No description

from  FormBase
array
getAjaxFormCallbacks()

Callbacks getter method.

array
getConfig()

No description

from  FormBase
DocumentIndex|null
getDocumentIndex()

Return DocumentIndex associated with form (if available)

DocumentModel|null
getDocumentModel()

Return DocumentModel associated with form (if available)

string
getFormActionURL()

Get current FORM Action URL

bool
getIsAjaxForm()

No description

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

Model|null
getModel()

Return Model associated with form (if available)

array
getWritableFieldValues(bool $forceSingleValues = false)

Get the properties of all available and writable fields

false
get_additional_filesources()

Get all dms instances available for this portlet to use as file-source in form

array
get_buttons_array(array $button_ids = array())

Get Buttons Array

string
get_close_form()

Returns the Form Closing HTML

string
get_current_process_id()

Returns a unique id for the current form processing.

get_edit_var()

No description

string
get_feedback(string $type = null)

Return the last Feedback Message

string
get_field(string $field, FormComponent $data = null)

No description

string
get_field_data(string $field, string $attribute)

No description

string
get_field_default_value(string $field)

No description

string
get_field_dom_id(string $fieldId)

Returns the ID for the form element, e.g. used in FormDocument.

FormComponent|null
get_field_object(string $field_name)

No description

mixed
get_field_value(string $field, bool $force_single_value = false)

Get the property associated with a specific field

array
get_field_values(bool $force_single_values = false)

No description

array
get_group(string $prefix)

No description

from  FormBase
Core|false
get_mod()

No description

string
get_open_form()

No description

array
get_properties()

No description

from  FormBase
mixed
get_request_var(string $field_name)

No description

handle_ajax_response(bool $throw_ajax_response = true)

No description

init_obj()

Initializes the form base

from  FormBase
insertField(string $fieldId, FormComponent $formComponent, string|null $insertBeforeFieldId = null, string|null $insertAfterFieldId = null)

Inserts a form component in the field array of the form.

bool
is_displayed()

Checks if the field is hidden by a tag. It is important when validating

from  FormBase
bool
is_validated()

Form passed all validations?

void
onValidate(Closure $callback)

Set an additional validation callback, which is triggered during process()

string
open_form(bool $only_hidden_fields = false)

No description

string
parse_pop_query($src)

No description

bool
populate(int $record_id)

No description

post_processing()

No description

process(bool $throw_ajax_response = true)

No description

array
process_fields(array $loop_fields)

No description

query($query)

No description

void
redirect_back()

Redirect Back (Uses previous page in form if available)

string
render(bool $with_form_tag = true)

No description

string
render_field(string $name, string $value, array $params)

Returns the rendered field as defined by the parameters

array
render_form(bool $with_form_tag = true)

No description

reset()

No description

save_data(array $data_array = array())

No description

sendAjaxResponseJsonHeader()

Adds the JSON response into the header.

$this
set(string $propertyName, mixed $propertyValue)

No description

from  FormBase
setFormActionURL(string $url = null)

Set Form Action URL Default: none

setFormName(string $name = null)

Set Form Name Default: Autogenerated unique id

setIsAjaxForm(bool $bool = true, bool $autoSubmit = false)

Submit and Process this form via AJAX Default: false Old Param: ajax_form

setIsHiddenLabel(bool $bool = true)

Set all labels to be hidden Default: false

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

setIsReadonly(bool $bool = true)

Set complete form to be readonly Default: false

setIsSecureForm(bool $bool = true)

Apply security measures available to this form (CSFR Check),

setLoadingMessage(null $message = null)

Display Loading spinner and message when user submits form Default: none Old Param: loading_message

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

setRequestMethod(string $method = self::REQUEST_METHOD_POST)

Set Form Name - Default is an autogenerated unique id Default: POST Old param: request_method

setTitle(string $title)

Set Form Title, Title use automatically used in feedback messages

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.

set_db_handler($handler)

No description

set_download_handler($handler)

No description

set_edit_var(string $value)

No description

set_enable_auto_lock(bool $bool)

If true, this form uses the DocumentLock to lock this form and show lock/view information.

set_error(mixed $field, mixed $message)

mark field as Error and return custom Error-Message

set_feedback(string $message, bool $error = false, bool $reset = false)

Set Form Feedback

bool
set_field_property(mixed $value_array, bool|string $specific_property = false, bool|string $specific_field = false)

No description

set_focus(mixed $field_id)

Specify the field which should get the focus by default Use TRUE to set focus to first field

set_form_property(string $property, string $value)

No description

set_mod($mod)

No description

set_model(Model $model)

No description

void
set_properties(array $array)

No description

from  FormBase
set_request_var(string $field_name, mixed $value)

No description

bool
set_request_vars()

No description

unset_request_var(string $field_name)

Removes a certain field from the request array

bool
validate() deprecated

No description

bool
validateFormFields()

No description

Details

at line 260
__construct($args = array())

No description

Parameters

$args

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.");');

Parameters

string $event

Needs to be one of the allowed event names: before, success, failed or complete.

string $jsFunction

Must be a string containing an anonymous JavaScript function, e.g. 'function () { alert("test"); }'

bool $wrapInAnonFunction

Should the passed $jsFunction be wrapped in an anonymous function call (function () {...}) or not. Set this to false, if you're about to do that yourself - for whatever reason.

Return Value

void

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.

Parameters

string $name
FormComponent $object
array $params
bool $force

Return Value

FormComponent

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

Parameters

string $key

uniq identifier

array $get_selector_link_cb

callback for getting the selector string - will get fieldname as arg - array($this, 'get_document_selector_link')

array $get_file_cb

callback for getting the path to selected file - will get selected value as arg - array($this, 'get_document_for_selector')

string $title

at line 1329
bool add_button(string $name, mixed $params)

No description

Parameters

string $name

of the field [unique within a form]

mixed $params

is an array with information about the button (type is 'href','submit' or 'button'

Return Value

bool success

at line 1272
bool add_button_cancel(bool|string $label = false, null $href = null, array $params = array())

Add a cancel button

Parameters

bool|string $label

Label for Button, default 'Cancel'

null $href
array $params

Return Value

bool success

at line 1259
bool add_button_reset(bool|string $label = false, array $params = array())

Add a save/submit button

Parameters

bool|string $label

Label for Button, default 'Save'

array $params

Return Value

bool success

at line 1247
bool add_button_submit(bool|string $label = false, array $params = array())

Add a save/submit button

Parameters

bool|string $label

Label for Button, default 'Save'

array $params

Return Value

bool success

at line 376
T|FormComponent add_field(string $name, array $params, bool $force = false, array $p1 = array())

No description

Parameters

string $name

of the field [unique within a form]

array $params

is an array with information about the field

bool $force

force default false for overwriting fields

array $p1

Return Value

T|FormComponent

at line 1146
FormCaptcha&FormComponent add_field_captcha(string $name, array $params = [], bool $force = false)

Add a captcha

Parameters

string $name

Name of your field

array $params

Supply additional information like class, width, default

bool $force

Overwrite already existing fields with the same name

Return Value

FormCaptcha&FormComponent

at line 1159
FormCatSelector&FormComponent add_field_cat_selector(string $name, array $params = [], bool $force = false)

Add a cat_selector field to your form

Parameters

string $name

Name of your field

array $params

Supply additional information like class, width, default

bool $force

Overwrite already existing fields with the same name

Return Value

FormCatSelector&FormComponent

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

Parameters

string $name

Name of your field

array $params

Supply additional information like class, width, default

bool $force

Overwrite already existing fields with the same name

Return Value

FormCategorySelector&FormComponent

at line 936
FormCheckbox&FormComponent add_field_checkbox(string $name, array $params = [], bool $force = false)

Add a checkbox field to your form

Parameters

string $name

Name of your field

array $params

Supply additional information like class, width, default

bool $force

Overwrite already existing fields with the same name

Return Value

FormCheckbox&FormComponent

at line 1224
FormChoice add_field_choice(string $name, array $params = [], bool $force = false)

No description

Parameters

string $name
array $params
bool $force

Return Value

FormChoice

at line 923
FormColor&FormComponent add_field_color(string $name, array $params = [], bool $force = false)

Add a color picker to your form

Parameters

string $name

Name of your field

array $params

Supply additional information like class, width, default

bool $force

Overwrite already existing fields with the same name

Return Value

FormColor&FormComponent

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)

Parameters

string $variable
string $context
array $params
bool $force

Return Value

FormConfig&FormComponent

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

Parameters

string $name

The name of the field

array $params

Possible values are maxentries, db, label

bool $force

Return Value

FormContentAttachment

at line 1018
FormDate&FormComponent add_field_date(string $name, array $params = [], bool $force = false)

Add a date field to your form

Parameters

string $name

Name of your field

array $params

Supply additional information like class, width, default

bool $force

Overwrite already existing fields with the same name

Return Value

FormDate&FormComponent

at line 962
FormDatetime&FormComponent add_field_datetime(string $name, array $params = [], bool $force = false)

Add a datetime field to your form

Parameters

string $name

Name of your field

array $params

Supply additional information like class, width, default

bool $force

Overwrite already existing fields with the same name

Return Value

FormDatetime&FormComponent

at line 988
FormDescription&FormComponent add_field_description(string $name = null, array $params = [], bool $force = false)

Add a description field to your form

Parameters

string $name

Name of your field

array $params

Supply additional information like class, width, default

bool $force

Overwrite already existing fields with the same name

Return Value

FormDescription&FormComponent

at line 1109
FormDocument&FormComponent add_field_document(string $name, array $params = [], bool $force = false)

Add a document selector field to your form

Parameters

string $name

Name of your field

array $params

Possible values are maxentries, db, label

bool $force

Overwrite already existing fields with the same name

Return Value

FormDocument&FormComponent

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)

Parameters

string $variable
string $context
bool $params
bool $force

Return Value

FormDynConfig&FormComponent

at line 717
FormEmail&FormComponent add_field_email(string $name, array $params = [], bool $force = false)

Add an Email field to your form

Parameters

string $name

Name of your field

array $params

Supply additional information like class, width, default

bool $force

Overwrite already existing fields with the same name

Return Value

FormEmail&FormComponent

at line 809
FormFieldset&FormComponent add_field_fieldset(string $name = null, array $params = [], bool $force = false)

Add a Fieldset to your form

Parameters

string $name

Name of your field

array $params

Supply additional information like class, width, default

bool $force

Overwrite already existing fields with the same name

Return Value

FormFieldset&FormComponent

at line 823
FormFieldsetClose&FormComponent add_field_fieldset_close(string $name, array $params = [], bool $force = false)

Add a Fieldset Close to your form

Parameters

string $name

Name of your field

array $params

Supply additional information like class, width, default

bool $force

Overwrite already existing fields with the same name

Return Value

FormFieldsetClose&FormComponent

at line 1199
FormFile&FormComponent add_field_file(string $name, array $params = [], bool $force = false)

Add a file field to your form

Parameters

string $name

Name of your field

array $params

Supply additional information like class, width, default

bool $force

Overwrite already existing fields with the same name

Return Value

FormFile&FormComponent

at line 1235
FormGeoSelector add_field_geo_selector(string $name, array $params = [], bool $force = false)

No description

Parameters

string $name
array $params
bool $force

Return Value

FormGeoSelector

at line 1083
FormGroupSelector&FormComponent add_field_group_selector(string $name, array $params = [], bool $force = false)

Add a group_selector field to your form

Parameters

string $name

Name of your field

array $params

Supply additional information like class, width, default

bool $force

Overwrite already existing fields with the same name

Return Value

FormGroupSelector&FormComponent

at line 836
FormHidden&FormComponent add_field_hidden(string $name, array|string $params = [], bool $force = false)

Add a hidden field to your form

Parameters

string $name

Name of your field

array|string $params

Supply additional information like class, width, default or use simple value as string

bool $force

Overwrite already existing fields with the same name

Return Value

FormHidden&FormComponent

at line 910
FormIconSelect&FormComponent add_field_icon_select(string $name, array $params = [], bool $force = false)

Add a icon select field to your form

Parameters

string $name

Name of your field

array $params

Supply additional information like class, width, default

bool $force

Overwrite already existing fields with the same name

Return Value

FormIconSelect&FormComponent

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

Parameters

string $name

Name of your field

array $params

Possible values are maxentries, db, label

bool $force

Overwrite already existing fields with the same name

Return Value

FormMediaAttachment&FormComponent

at line 1213
FormMultifile&FormComponent add_field_multifile(string $name, array $params = [], bool $force = false) deprecated

deprecated Will not be maintained anylonger, please use file or document fields to handle uploads

Add a file field to your form

Parameters

string $name

Name of your field

array $params

Supply additional information like class, width, default

bool $force

Overwrite already existing fields with the same name

Return Value

FormMultifile&FormComponent

at line 975
FormMultitext&FormComponent add_field_multitext(string $name, array $params = [], bool $force = false)

Add a multitext field to your form

Parameters

string $name

Name of your field

array $params

Supply additional information like class, width, default

bool $force

Overwrite already existing fields with the same name

Return Value

FormMultitext&FormComponent

at line 743
FormNumber&FormComponent add_field_number(string $name, array $params = [], bool $force = false)

Add an Number field to your form

Parameters

string $name

Name of your field

array $params

Supply additional information like class, width, default

bool $force

Overwrite already existing fields with the same name

Return Value

FormNumber&FormComponent

at line 884
FormPassword&FormComponent add_field_password(string $name, array $params = [], bool $force = false)

Add a password field to your form

Parameters

string $name

Name of your field

array $params

Supply additional information like class, width, default, use_hide_value (PASSWORD_AUTO_HIDE_VALUE)

bool $force

Overwrite already existing fields with the same name

Return Value

FormPassword&FormComponent

at line 730
FormPhone&FormComponent add_field_phone(string $name, array $params = [], bool $force = false)

Add an Phone field to your form

Parameters

string $name

Name of your field

array $params

Supply additional information like class, width, default

bool $force

Overwrite already existing fields with the same name

Return Value

FormPhone&FormComponent

at line 1185
FormPolicySelector&FormComponent add_field_policy_selector(string $name, array $params = [], bool $force = false)

Add a policy_selector field to your form

Parameters

string $name

Name of your field

array $params

Supply additional information like class, width, default

bool $force

Overwrite already existing fields with the same name

Return Value

FormPolicySelector&FormComponent

at line 949
FormRadio&FormComponent add_field_radio(string $name, array $params = [], bool $force = false)

Add a radio field to your form

Parameters

string $name

Name of your field

array $params

Supply additional information like class, width, default

bool $force

Overwrite already existing fields with the same name

Return Value

FormRadio&FormComponent

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

Parameters

string $name

Name of your field

array $params

Supply additional information like class, width, default

bool $force

Overwrite already existing fields with the same name

Return Value

FormRrule&FormComponent

Add a Search field to your form

Parameters

string $name

Name of your field

array $params

Supply additional information like class, width, default

bool $force

Overwrite already existing fields with the same name

Return Value

FormSearch&FormComponent

at line 795
FormSectionBreak&FormComponent add_field_section_break(string $name = null, array $params = [], bool $force = false)

Add a section_break to your form

Parameters

string $name

Name of your field

array $params

Supply additional information like class, width, default

bool $force

Overwrite already existing fields with the same name

Return Value

FormSectionBreak&FormComponent

at line 897
FormSelect&FormComponent add_field_select(string $name, array $params = [], bool $force = false)

Add a select field to your form

Parameters

string $name

Name of your field

array $params

Supply additional information like class, width, default

bool $force

Overwrite already existing fields with the same name

Return Value

FormSelect&FormComponent

at line 1057
FormSlider&FormComponent add_field_slider(string $name, array $params = [], bool $force = false)

Add a slider field to your form

Parameters

string $name

Name of your field

array $params

Typical params are min, max, values, min_label, max_label, value_labels

bool $force

Overwrite already existing fields with the same name

Return Value

FormSlider&FormComponent

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

Parameters

string $name

Name of your field

array $params

Supply additional information like class, width, default

bool $force

Overwrite already existing fields with the same name

Return Value

FormStaticText&FormComponent

at line 1002
FormStaticValue&FormComponent add_field_static_value(string $name, $params = [], bool $force = false)

Add a static_value field to your form

Parameters

string $name

Name of your field

$params
bool $force

Overwrite already existing fields with the same name

Return Value

FormStaticValue&FormComponent

at line 869
FormTag&FormComponent add_field_tag(string $name, array $params = [], bool $force = false)

Add a tag field to your form

Parameters

string $name

Name of your field

array $params

Supply additional information like class, width, default

bool $force

Overwrite already existing fields with the same name

Return Value

FormTag&FormComponent

at line 691
FormTextbox&FormComponent add_field_text(string $name, array $params = [], bool $force = false)

Add a Textbox to your form

Parameters

string $name

Name of your field

array $params

Supply additional information like class, width, default

bool $force

Overwrite already existing fields with the same name

Return Value

FormTextbox&FormComponent

at line 782
FormTextarea&FormComponent add_field_textarea(string $name, array $params = [], bool $force = false)

Add a Textbox to your form

Parameters

string $name

Name of your field

array $params

Supply additional information like class, width, default

bool $force

Overwrite already existing fields with the same name

Return Value

FormTextarea&FormComponent

at line 769
FormTextboxList&FormComponent add_field_textbox_list(string $name, array $params = [], bool $force = false)

Add a Textbox list to your form

Parameters

string $name

Name of your field

array $params

Supply additional information like class, width, default

bool $force

Overwrite already existing fields with the same name

Return Value

FormTextboxList&FormComponent

at line 1031
FormToggleSwitch&FormComponent add_field_toggle_switch(string $name, array $params = [], bool $force = false)

Add a toggle switch field to your form

Parameters

string $name

Name of your field

array $params

Supply additional information like class, width, default, label_set => yes/no

bool $force

Overwrite already existing fields with the same name

Return Value

FormToggleSwitch&FormComponent

at line 756
FormUrl&FormComponent add_field_url(string $name, array $params = [], bool $force = false)

Add an URL field to your form

Parameters

string $name

Name of your field

array $params

Supply additional information like class, width, default

bool $force

Overwrite already existing fields with the same name

Return Value

FormUrl&FormComponent

at line 1096
FormUserSelector&FormComponent add_field_user_selector(string $name, array $params = [], bool $force = false)

Add an user_selector field to your form

Parameters

string $name

Name of your field

array $params

Possible values are maxentries, valid array values: maxentries, db, label

bool $force

Overwrite already existing fields with the same name

Return Value

FormUserSelector&FormComponent

at line 1070
FormWebfetcher&FormComponent add_field_webfetcher(string $name, array $params = [], bool $force = false)

Add a group_selector field to your form

Parameters

string $name

Name of your field

array $params

url: can be array or link

bool $force

Overwrite already existing fields with the same name

Return Value

FormWebfetcher&FormComponent

at line 1349
add_loading_message(string $message = null) deprecated

deprecated Use setLoadingMessage

Add a loading indicator when the form is submitted

Parameters

string $message

Message to be displayed

at line 4398
mixed add_obj() deprecated

deprecated

No description

Return Value

mixed

OR field object

at line 657
FormComponent add_required_sfield(string $name, string $label, string $type = null, mixed $default = null, array $params = array()) deprecated

deprecated Use add_field_text or add_field_textarea

Add required (String) Field (params as separate string parameters)

Parameters

string $name

Field ID/Name

string $label

Label of field

string $type

Type (default: textbox)

mixed $default

Default Value for Field

array $params

Additional parameters like traditional add_field() format

Return Value

FormComponent

at line 1601
FormRowRenderer add_row_renderer(string $name, FormRowRenderer $render_obj)

Add a new row renderer

Parameters

string $name

NameID of field

FormRowRenderer $render_obj

Custom Renderer Object

Return Value

FormRowRenderer

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

Parameters

string $name

NameID of the multifield

mixed $label

Label for the multifield

array $field_names

Array with names of already created multifields

array $column_width

Array with percentual widths for each field. If false all fields are equally distributed

string $layout

Layout. side=all fields in one row, side_top_aligned=all fields in one row aligned to top border, stacked=one field per row

bool $hide_labels

hide_labels: hide the labels of the containing fields

array|string $css_classes

CSS-Classes: additional custom css classes for wrapping div-element

array $tags

Tags: form tags added to the field

Return Value

FormRowRendererMultifieldRow

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.

Parameters

string $name

ID of the renderer

array $fields

the contained fields

array $labels

the field labels which are displayed in the table header

array $rows

of arrays: this is an array of rows in the table. Each row contains the ids of the elements which are in that row.

array|string $css_classes

CSS-Classes: additional custom css classes for wrapping div-element

Return Value

FormRowRendererMultirowTable

at line 637
FormComponent add_sfield(string $name, string $label, string $type = null, mixed $default = null, array $params = array()) deprecated

deprecated Use add_field_text or add_field_textarea

Add (String) Field (params as separate string parameters)

Parameters

string $name

Field ID/Name

string $label

Label of field

string $type

Type (default: textbox)

mixed $default

Default Value for Field

array $params

Additional parameters like traditional add_field() format

Return Value

FormComponent

in FormBase at line 198
append(string $name, mixed $value, bool|string $key = false)

No description

Parameters

string $name

property name

mixed $value

property value

bool|string $key

key of property array

at line 2057
cb_model_get_property($matches)

No description

Parameters

$matches

at line 4084
close_fieldset()

No description

at line 2954
string close_form($includeButtons = false)

No description

Parameters

$includeButtons

Return Value

string html

in FormBase at line 183
void concat(string $name, string $value)

No description

Parameters

string $name

of the property

string $value

to be concated

Return Value

void

in FormBase at line 168
mixed destroy($name)

No description

Parameters

$name

Return Value

mixed

last value

at line 2898
string display_feedback()

No description

Return Value

string HTML

at line 3683
string display_field(string $field, FormBase $data = null)

No description

Parameters

string $field

Field Name

FormBase $data

Return Value

string HTML

at line 3346
string display_form(bool $with_form_tag = true)

No description

Parameters

bool $with_form_tag

Return Value

string

Exceptions

ContentException

at line 3754
bool|Form fdl2form($config)

No description

Parameters

$config

Return Value

bool|Form

at line 3485
bool form_has_required_fields()

Returns true if the form contains required fields

Return Value

bool

True if form contains required fields

at line 2065
bool form_request_valid()

No description

Return Value

bool

in FormBase at line 77
mixed get(string $name)

No description

Parameters

string $name

name of the property

Return Value

mixed

at line 2919
array getAjaxFormCallbacks()

Callbacks getter method.

Return Value

array

in FormBase at line 84
array getConfig()

No description

Return Value

array

at line 4383
DocumentIndex|null getDocumentIndex()

Return DocumentIndex associated with form (if available)

Return Value

DocumentIndex|null

at line 4374
DocumentModel|null getDocumentModel()

Return DocumentModel associated with form (if available)

Return Value

DocumentModel|null

at line 4274
string getFormActionURL()

Get current FORM Action URL

Return Value

string

at line 4173
bool getIsAjaxForm()

No description

Return Value

bool

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

Parameters

$field

Return Value

array

at line 4365
Model|null getModel()

Return Model associated with form (if available)

Return Value

Model|null

at line 1808
array getWritableFieldValues(bool $forceSingleValues = false)

Get the properties of all available and writable fields

Parameters

bool $forceSingleValues

= false, Set to true if you do not want multi-field values beeing returned

Return Value

array

at line 1677
false get_additional_filesources()

Get all dms instances available for this portlet to use as file-source in form

Return Value

false

or array of all dms instances

at line 3185
array get_buttons_array(array $button_ids = array())

Get Buttons Array

Parameters

array $button_ids

Filter for Buttons

Return Value

array

at line 2910
string get_close_form()

Returns the Form Closing HTML

Return Value

string html

at line 199
string get_curent_process_id_lookup_name()

No description

Return Value

string

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

Parameters

string $type

'error', 'ok'

Return Value

string

at line 3503
string get_field(string $field, FormComponent $data = null)

No description

Parameters

string $field

Field ID

FormComponent $data

Field Data

Return Value

string

Form HTML for the field

Exceptions

Exception

at line 1721
string get_field_data(string $field, string $attribute)

No description

Parameters

string $field Fieldname
string $attribute

Property name

Return Value

string

at line 1766
string get_field_default_value(string $field)

No description

Parameters

string $field Fieldname

Return Value

string

Default Value of Field

at line 1733
string get_field_dom_id(string $fieldId)

Returns the ID for the form element, e.g. used in FormDocument.

Parameters

string $fieldId

Field name

Return Value

string

The recommended way to set the ID of form elements.

at line 1782
FormComponent|null get_field_object(string $field_name)

No description

Parameters

string $field_name Fieldname

Return Value

FormComponent|null

Field Object or false if object does not exist

at line 1745
mixed get_field_value(string $field, bool $force_single_value = false)

Get the property associated with a specific field

Parameters

string $field

Field name

bool $force_single_value

Set to true if you do not want multi-field-values being returned

Return Value

mixed

at line 1793
array get_field_values(bool $force_single_values = false)

No description

Parameters

bool $force_single_values

= false, Set to true if you do not want multi-field values beeing returned

Return Value

array

in FormBase at line 217
array get_group(string $prefix)

No description

Parameters

string $prefix

prefix (e.g. mygroup_ )

Return Value

array

at line 361
Core|false get_mod()

No description

Return Value

Core|false

at line 3017
string get_open_form()

No description

Return Value

string

Exceptions

ContentException

in FormBase at line 92
array get_properties()

No description

Return Value

array

at line 1688
mixed get_request_var(string $field_name)

No description

Parameters

string $field_name

variable name

Return Value

mixed value

at line 1967
handle_ajax_response(bool $throw_ajax_response = true)

No description

Parameters

bool $throw_ajax_response

Exceptions

ContentException

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.

Parameters

string $fieldId
FormComponent $formComponent
string|null $insertBeforeFieldId
string|null $insertAfterFieldId

in FormBase at line 237
bool is_displayed()

Checks if the field is hidden by a tag. It is important when validating

Return Value

bool

at line 2097
bool is_validated()

Form passed all validations?

Return Value

bool Success

at line 2810
void onValidate(Closure $callback)

Set an additional validation callback, which is triggered during process()

Parameters

Closure $callback

Return Value

void

at line 3029
string open_form(bool $only_hidden_fields = false)

No description

Parameters

bool $only_hidden_fields

Return Value

string

Exceptions

ContentException

at line 2668
string parse_pop_query($src)

No description

Parameters

$src

Return Value

string

new query

at line 2707
bool populate(int $record_id)

No description

Parameters

int $record_id

Record ID

Return Value

bool

at line 2470
protected post_processing()

No description

at line 2148
process(bool $throw_ajax_response = true)

No description

Parameters

bool $throw_ajax_response

if form is an ajax form, after processing there is an ajax response thrown

Exceptions

Exception
ContentException

at line 2375
protected array process_fields(array $loop_fields)

No description

Parameters

array $loop_fields

Array with field objects to process

Return Value

array

Returns array with fields, values and raw_values

at line 2792
query($query)

No description

Parameters

$query

at line 2358
void redirect_back()

Redirect Back (Uses previous page in form if available)

Return Value

void

Exceptions

Exception

at line 3324
string render(bool $with_form_tag = true)

No description

Parameters

bool $with_form_tag

Return Value

string

Exceptions

ContentException

at line 3362
string render_field(string $name, string $value, array $params)

Returns the rendered field as defined by the parameters

Parameters

string $name

Name of the field

string $value Field-Value
array $params

Parameters; same as add_field() syntax

Return Value

string

Returns HTML

Exceptions

Exception

at line 3384
array render_form(bool $with_form_tag = true)

No description

Parameters

bool $with_form_tag

Return Value

array

Marker Array

Exceptions

ContentException
Exception

at line 2777
reset()

No description

at line 2531
protected save_data(array $data_array = array())

No description

Parameters

array $data_array

Array with fields, values and raw_values

Exceptions

Exception

at line 2052
sendAjaxResponseJsonHeader()

Adds the JSON response into the header.

in FormBase at line 104
$this set(string $propertyName, mixed $propertyValue)

No description

Parameters

string $propertyName

propoerty name

mixed $propertyValue

property value

Return Value

$this

at line 4266
Form setFormActionURL(string $url = null)

Set Form Action URL Default: none

Old param: form_action

Parameters

string $url

Return Value

Form

at line 4252
Form setFormName(string $name = null)

Set Form Name Default: Autogenerated unique id

Old param: form_name

Parameters

string $name

Return Value

Form

at line 4165
Form setIsAjaxForm(bool $bool = true, bool $autoSubmit = false)

Submit and Process this form via AJAX Default: false Old Param: ajax_form

Parameters

bool $bool
bool $autoSubmit

The auto-submit functionality should only be used on forms, where no textual fields (like textbox, textbox_list or text/textarea) are present. Nearly each change to the field (e.g. when a user types) is noticed by the form observer (JS) and triggers the form submit. Also the captcha field should be avoided due to unexpected value changes, which can't be handled without a proper field event handler. Additional note: form fields, that change their value via JavaScript after they've been submitted, might trigger the submit mechanism an additional time, since they cause the comparison value to be modified.

Return Value

Form

at line 4238
Form setIsHiddenLabel(bool $bool = true)

Set all labels to be hidden Default: false

Old param: hide_label

Parameters

bool $bool

Return Value

Form

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

Parameters

bool $bool

Return Value

Form

at line 4224
Form setIsReadonly(bool $bool = true)

Set complete form to be readonly Default: false

Parameters

bool $bool

Return Value

Form

at line 4308
Form setIsSecureForm(bool $bool = true)

Apply security measures available to this form (CSFR Check),

Default: true

Parameters

bool $bool

Return Value

Form

at line 4212
Form setLoadingMessage(null $message = null)

Display Loading spinner and message when user submits form Default: none Old Param: loading_message

Parameters

null $message

Return Value

Form

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

Parameters

string $url

You can use placeholder e.g. {id} -- $this->mod->get_url(['page' => 'show', 'cmd' => ['c', '{id}']])

Return Value

Form

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

Parameters

string $method

should be POST or GET

Return Value

Form

at line 4320
Form setTitle(string $title)

Set Form Title, Title use automatically used in feedback messages

Parameters

string $title

Return Value

Form

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.

Parameters

UIAjaxComponent $component

Return Value

void

at line 1623
set_db_handler($handler)

No description

Parameters

$handler

at line 1645
set_download_handler($handler)

No description

Parameters

$handler

at line 1847
set_edit_var(string $value)

No description

Parameters

string $value

Usually the value of your primary key

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.

Parameters

bool $bool

at line 4121
set_error(mixed $field, mixed $message)

mark field as Error and return custom Error-Message

Parameters

mixed $field
mixed $message

at line 4099
set_feedback(string $message, bool $error = false, bool $reset = false)

Set Form Feedback

Parameters

string $message
bool $error

Is Error Message?

bool $reset

at line 1882
bool set_field_property(mixed $value_array, bool|string $specific_property = false, bool|string $specific_field = false)

No description

Parameters

mixed $value_array

Value or Value Array (Assoc: [field (opt.) -> ] property -> value)

bool|string $specific_property

Specify a certain property to be affected by the operation

bool|string $specific_field

Specify a certain field to be affected by the operation

Return Value

bool success

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

Parameters

mixed $field_id

at line 1865
set_form_property(string $property, string $value)

No description

Parameters

string $property
string $value

at line 352
set_mod($mod)

No description

Parameters

$mod

at line 1633
set_model(Model $model)

No description

Parameters

Model $model

in FormBase at line 153
void set_properties(array $array)

No description

Parameters

array $array

associated array like property=>value

Return Value

void

at line 1699
set_request_var(string $field_name, mixed $value)

No description

Parameters

string $field_name

variable name

mixed $value value

at line 2105
bool set_request_vars()

No description

Return Value

bool

at line 1709
unset_request_var(string $field_name)

Removes a certain field from the request array

Parameters

string $field_name

Field ID to remove

at line 2818
bool validate() deprecated

deprecated

No description

Return Value

bool

at line 2830
bool validateFormFields()

No description

Return Value

bool

Returns FALSE if NOT valid - returns TRUE if no error was returned