class Form extends FormBase

Class Form

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

Methods

__construct(array $args = array())

No description

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_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_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_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_list_selector(string $name, array $params = [], bool $force = false) deprecated

Add a list_selector field to your form

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_payment(string $name, array $params = [], bool $force = false)

Add an payment 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_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, array $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())

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|bool $column_width = false, 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())

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(mixed $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
getConfig()

No description

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

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(Boolean $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
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(FormComponent|string $src)

No description

bool
populate(int $record_id)

No description

post_processing()

No description

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

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

setReuestMethod(string $method = 'POST')

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

set_db_handler(array $handler)

No description

set_download_handler(array $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(Core $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 198
__construct(array $args = array())

Parameters

array $args || title, table, key_name, var_type, form_name, form_action, ajax_form, ajax_button, ajax_output, web_dir (see wiki for more) field_default_options => db : boolean

at line 549
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 1482
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 1166
bool add_button(string $name, mixed $params)

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 1109
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 1096
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 1084
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 312
FormComponent add_field(string $name, array $params, bool $force = false, array $p1 = array())

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

FormComponent

at line 978
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 991
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 1004
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 794
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 781
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 1147
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 873
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 820
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 846
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 964
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 1127
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 575
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 667
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 681
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 1044
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 938
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 694
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 768
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 1031
FormListSelector|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

FormListSelector|FormComponent

at line 1058
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 833
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 601
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 742
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 1071
FormPayment|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

FormPayment|FormComponent

at line 588
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 1017
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 807
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 899
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

at line 653
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 755
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 912
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 710
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 860
FormStaticValue|FormComponent add_field_static_value(string $name, array $params = [], bool $force = false)

Add a static_value 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

FormStaticValue|FormComponent

at line 727
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 562
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 640
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 627
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 886
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 614
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 951
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 925
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 1186
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 3873
mixed add_obj() deprecated

deprecated

Return Value

mixed OR field object

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

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 1424
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 1379
FormRowRendererMultifieldRow add_row_renderer_multifield_row(string $name, mixed $label, array $field_names, array|bool $column_width = false, 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|bool $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 1405
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 508
FormComponent add_sfield(string $name, string $label, string $type = null, mixed $default = null, array $params = array())

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 160
append(string $name, mixed $value, bool|string $key = false)

Parameters

string $name property name
mixed $value property value
bool|string $key key of property array

at line 1833
cb_model_get_property($matches)

Parameters

$matches

at line 3680
close_fieldset()

at line 2611
string close_form()

Return Value

string html

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

Parameters

string $name of the property
string $value to be concated

Return Value

void

in FormBase at line 130
mixed destroy($name)

Parameters

$name

Return Value

mixed last value

at line 2591
string display_feedback()

Return Value

string HTML

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

Parameters

string $field Field Name
FormBase $data

Return Value

string HTML

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

Parameters

bool $with_form_tag

Return Value

string

Exceptions

ContentException

at line 3356
bool|Form fdl2form(mixed $config)

Parameters

mixed $config array

Return Value

bool|Form

at line 3094
bool form_has_required_fields()

Returns true if the form contains required fields

Return Value

bool True if form contains required fields

at line 1841
bool form_request_valid()

Return Value

bool

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

Parameters

string $name name of the property

Return Value

mixed

in FormBase at line 83
array getConfig()

Return Value

array

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

Get Buttons Array

Parameters

array $button_ids Filter for Buttons

Return Value

array

at line 2603
string get_close_form()

Returns the Form Closing HTML

Return Value

string html

at line 140
string get_curent_process_id_lookup_name()

Return Value

string

at line 152
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 1617
get_edit_var()

at line 3722
string get_feedback(string $type = null)

Return the last Feedback Message

Parameters

string $type 'error', 'ok'

Return Value

string

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

Parameters

string $field Field ID
FormComponent $data Field Data

Return Value

string Form HTML for the field

Exceptions

Exception

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

Parameters

string $field Fieldname
string $attribute Property name

Return Value

string

at line 1574
string get_field_default_value(string $field)

Parameters

string $field Fieldname

Return Value

string Default Value of Field

at line 1590
FormComponent|false get_field_object(string $field_name)

Parameters

string $field_name Fieldname

Return Value

FormComponent|false Field Object or false if object does not exist

at line 1557
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 1605
array get_field_values(Boolean $force_single_values = false)

Parameters

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

Return Value

array

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

Parameters

string $prefix prefix (e.g. mygroup_ )

Return Value

array

at line 298
Core|false get_mod()

Return Value

Core|false

at line 2645
string get_open_form()

Return Value

string

Exceptions

ContentException

in FormBase at line 91
array get_properties()

Return Value

array

at line 1511
mixed get_request_var(string $field_name)

Parameters

string $field_name variable name

Return Value

mixed value

at line 1760
handle_ajax_response(bool $throw_ajax_response = true)

Parameters

bool $throw_ajax_response

Exceptions

ContentException

in FormBase at line 39
init_obj()

Initializes the form base

in FormBase at line 199
bool is_displayed()

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

Return Value

bool

at line 1873
bool is_validated()

Form passed all validations?

Return Value

bool Success

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

Parameters

bool $only_hidden_fields

Return Value

string

Exceptions

ContentException

at line 2410
string parse_pop_query(FormComponent|string $src)

Parameters

FormComponent|string $src query or field/form component

Return Value

string new query

at line 2447
bool populate(int $record_id)

Parameters

int $record_id Record ID

Return Value

bool

at line 2216
protected post_processing()

at line 1919
process($throw_ajax_response = true)

Parameters

$throw_ajax_response

at line 2141
protected array process_fields(array $loop_fields)

Parameters

array $loop_fields Array with field objects to process

Return Value

array Returns array with fields, values and raw_values

at line 2532
query($query)

Parameters

$query

at line 2124
void redirect_back()

Redirect Back (Uses previous page in form if available)

Return Value

void

Exceptions

Exception

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

Parameters

bool $with_form_tag

Return Value

string

Exceptions

ContentException

at line 2970
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 2993
array render_form(bool $with_form_tag = true)

Parameters

bool $with_form_tag

Return Value

array Marker Array

Exceptions

ContentException
Exception

at line 2517
reset()

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

Parameters

array $data_array Array with fields, values and raw_values

Exceptions

Exception

at line 1828
sendAjaxResponseJsonHeader()

Adds the JSON response into the header.

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

Parameters

string $name propoerty name
mixed $value property value

Return Value

$this

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

Set Form Action URL Default: none

Old param: form_action

Parameters

string $url

Return Value

Form

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

Set Form Name Default: Autogenerated unique id

Old param: form_name

Parameters

string $name

Return Value

Form

at line 3751
Form setIsAjaxForm(bool $bool = true)

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

Parameters

bool $bool

Return Value

Form

at line 3804
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 3738
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 3790
Form setIsReadonly(bool $bool = true)

Set complete form to be readonly Default: false

Parameters

bool $bool

Return Value

Form

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

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

Default: true

Parameters

bool $bool

Return Value

Form

at line 3778
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 3765
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}

Return Value

Form

at line 3845
Form setReuestMethod(string $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 1446
set_db_handler(array $handler)

Parameters

array $handler callback

at line 1468
set_download_handler(array $handler)

Parameters

array $handler callback

at line 1640
set_edit_var(string $value)

Parameters

string $value Usually the value of your primary key

at line 279
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 3709
set_error(mixed $field, mixed $message)

mark field as Error and return custom Error-Message

Parameters

mixed $field
mixed $message

at line 3695
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 1675
bool set_field_property(mixed $value_array, bool|string $specific_property = false, bool|string $specific_field = false)

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 1435
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 1658
set_form_property(string $property, string $value)

Parameters

string $property
string $value

at line 289
set_mod(Core $mod)

Parameters

Core $mod

at line 1456
set_model(Model $model)

Parameters

Model $model

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

Parameters

array $array associated array like property=>value

Return Value

void

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

Parameters

string $field_name variable name
mixed $value value

at line 1881
bool set_request_vars()

Return Value

bool

at line 1532
unset_request_var(string $field_name)

Removes a certain field from the request array

Parameters

string $field_name Field ID to remove

at line 2544
bool validate()

Return Value

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