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

__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

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

Add a captcha

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

Add a cat_selector field to your form

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

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

Add a checkbox field to your form

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

Add a color picker to your form

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

Add a field to edit the given config variable

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

Add a date field to your form

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

Add a datetime field to your form

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

Add a description field to your form

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

Add a document selector field to your form

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

Add a field to edit the given config variable

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

Add an Email field to your form

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

Add a Fieldset to your form

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

Add a Fieldset Close to your form

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

Add a file field to your form

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

Add a group_selector field to your form

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

Add a hidden field to your form

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

Add a icon select field to your form

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

Add a list_selector field to your form

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

Add a file field to your form

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

Add a multitext field to your form

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

Add an Number field to your form

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

Add a password field to your form

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

Add an payment field to your form

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

Add an Phone field to your form

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

Add a policy_selector field to your form

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

Add a radio field to your form

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

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

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

Add a section_break to your form

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

Add a select field to your form

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

Add a slider field to your form

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

Add a static_text field to your form

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

Add a static_value field to your form

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

Add a tag field to your form

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

Add a Textbox to your form

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

Add a Textbox to your form

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

Add a Textbox list to your form

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

Add a toggle switch field to your form

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

Add an URL field to your form

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

Add an user_selector field to your form

FormComponent
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()

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
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

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.

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?

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 $name, mixed $value)

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()

No description

Details

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

No description

Parameters

$args

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

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 641
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 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

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 1261
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 1204
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 1191
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 1179
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 358
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 1073
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

FormComponent

at line 1086
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

FormComponent

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

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

FormComponent

at line 886
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

FormComponent

at line 873
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

FormComponent

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)

Parameters

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

Return Value

FormComponent

at line 968
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

FormComponent

at line 912
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

FormComponent

at line 938
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

FormComponent

at line 1059
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

FormComponent

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)

Parameters

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

Return Value

FormComponent

at line 667
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

FormComponent

at line 759
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

FormComponent

at line 773
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

FormComponent

at line 1139
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

FormComponent

at line 1033
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

FormComponent

at line 786
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

FormComponent

at line 860
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

FormComponent

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

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

FormComponent

at line 1153
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

FormComponent

at line 925
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

FormComponent

at line 693
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

FormComponent

at line 834
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

FormComponent

at line 1166
FormComponent add_field_payment(string $name, array $params = [], bool $force = false)

Add an payment 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

FormComponent

at line 680
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

FormComponent

at line 1112
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

FormComponent

at line 899
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

FormComponent

at line 994
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

FormComponent

at line 745
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

FormComponent

at line 847
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

FormComponent

at line 1007
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

FormComponent

at line 802
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

FormComponent

at line 952
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

FormComponent

at line 819
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

FormComponent

at line 654
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

FormComponent

at line 732
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

FormComponent

at line 719
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

FormComponent

at line 981
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

FormComponent

at line 706
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

FormComponent

at line 1046
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

FormComponent

at line 1020
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

FormComponent

at line 1281
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 4212
mixed add_obj() deprecated

deprecated

No description

Return Value

mixed

OR field object

at line 620
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 1533
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 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

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 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.

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 600
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 200
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 1973
cb_model_get_property($matches)

No description

Parameters

$matches

at line 3933
close_fieldset()

No description

at line 2821
string close_form()

No description

Return Value

string

html

in FormBase at line 185
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 170
mixed destroy($name)

No description

Parameters

$name

Return Value

mixed

last value

at line 2765
string display_feedback()

No description

Return Value

string

HTML

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

No description

Parameters

string $field

Field Name

FormBase $data

Return Value

string

HTML

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

No description

Parameters

bool $with_form_tag

Return Value

string

Exceptions

ContentException

at line 3604
bool|Form fdl2form($config)

No description

Parameters

$config

Return Value

bool|Form

at line 3344
bool form_has_required_fields()

Returns true if the form contains required fields

Return Value

bool

True if form contains required fields

at line 1981
bool form_request_valid()

No description

Return Value

bool

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

No description

Parameters

string $name

name of the property

Return Value

mixed

at line 2786
array getAjaxFormCallbacks()

Callbacks getter method.

Return Value

array

in FormBase at line 83
array getConfig()

No description

Return Value

array

at line 4115
string getFormActionURL()

Get current FORM Action URL

Return Value

string

at line 4014
bool getIsAjaxForm()

No description

Return Value

bool

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

Parameters

$field

Return Value

array

at line 1609
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 3050
array get_buttons_array(array $button_ids = array())

Get Buttons Array

Parameters

array $button_ids

Filter for Buttons

Return Value

array

at line 2777
string get_close_form()

Returns the Form Closing HTML

Return Value

string

html

at line 181
string get_curent_process_id_lookup_name()

No description

Return Value

string

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

Parameters

string $type

'error', 'ok'

Return Value

string

at line 3362
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 1653
string get_field_data(string $field, string $attribute)

No description

Parameters

string $field

Fieldname

string $attribute

Property name

Return Value

string

at line 1697
string get_field_default_value(string $field)

No description

Parameters

string $field

Fieldname

Return Value

string

Default Value of Field

at line 1665
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 1713
FormComponent|false get_field_object(string $field_name)

No description

Parameters

string $field_name

Fieldname

Return Value

FormComponent|false

Field Object or false if object does not exist

at line 1677
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 1728
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 219
array get_group(string $prefix)

No description

Parameters

string $prefix

prefix (e.g. mygroup_ )

Return Value

array

at line 343
Core|false get_mod()

No description

Return Value

Core|false

at line 2874
string get_open_form()

No description

Return Value

string

Exceptions

ContentException

in FormBase at line 91
array get_properties()

No description

Return Value

array

at line 1620
mixed get_request_var(string $field_name)

No description

Parameters

string $field_name

variable name

Return Value

mixed

value

at line 1883
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 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.

Parameters

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

in FormBase at line 239
bool is_displayed()

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

Return Value

bool

at line 2013
bool is_validated()

Form passed all validations?

Return Value

bool

Success

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

No description

Parameters

bool $only_hidden_fields

Return Value

string

Exceptions

ContentException

at line 2584
string parse_pop_query($src)

No description

Parameters

$src

Return Value

string

new query

at line 2621
bool populate(int $record_id)

No description

Parameters

int $record_id

Record ID

Return Value

bool

at line 2386
protected post_processing()

No description

at line 2064
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 2291
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 2706
query($query)

No description

Parameters

$query

at line 2274
void redirect_back()

Redirect Back (Uses previous page in form if available)

Return Value

void

Exceptions

Exception

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

No description

Parameters

bool $with_form_tag

Return Value

string

Exceptions

ContentException

at line 3221
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 3243
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 2691
reset()

No description

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

No description

Parameters

array $data_array

Array with fields, values and raw_values

Exceptions

Exception

at line 1968
sendAjaxResponseJsonHeader()

Adds the JSON response into the header.

in FormBase at line 103
$this set(string $name, mixed $value)

No description

Parameters

string $name

propoerty name

mixed $value

property value

Return Value

$this

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

Set Form Action URL Default: none

Old param: form_action

Parameters

string $url

Return Value

Form

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

Set Form Name Default: Autogenerated unique id

Old param: form_name

Parameters

string $name

Return Value

Form

at line 4006
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 4079
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 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

Parameters

bool $bool

Return Value

Form

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

Set complete form to be readonly Default: false

Parameters

bool $bool

Return Value

Form

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

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

Default: true

Parameters

bool $bool

Return Value

Form

at line 4053
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 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

Parameters

string $url

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

Return Value

Form

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

Parameters

string $method

should be POST or GET

Return Value

Form

at line 4161
Form setTitle(string $title)

Set Form Title, Title use automatically used in feedback messages

Parameters

string $title

Return Value

Form

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.

Parameters

UIAjaxComponent $component

Return Value

void

at line 1555
set_db_handler($handler)

No description

Parameters

$handler

at line 1577
set_download_handler($handler)

No description

Parameters

$handler

at line 1763
set_edit_var(string $value)

No description

Parameters

string $value

Usually the value of your primary key

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.

Parameters

bool $bool

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

mark field as Error and return custom Error-Message

Parameters

mixed $field
mixed $message

at line 3948
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 1798
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 1544
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 1781
set_form_property(string $property, string $value)

No description

Parameters

string $property
string $value

at line 334
set_mod($mod)

No description

Parameters

$mod

at line 1565
set_model(Model $model)

No description

Parameters

Model $model

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

No description

Parameters

array $array

associated array like property=>value

Return Value

void

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

No description

Parameters

string $field_name

variable name

mixed $value

value

at line 2021
bool set_request_vars()

No description

Return Value

bool

at line 1641
unset_request_var(string $field_name)

Removes a certain field from the request array

Parameters

string $field_name

Field ID to remove

at line 2718
bool validate()

No description

Return Value

bool

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