FormDocument
class FormDocument extends FormComponent
Class FormDocument
Properties
protected array | $config | from FormBase | |
bool | $save_requires_edit_var | from FormBase | |
Form | $form | from FormComponent | |
protected | $field_disable_save | Set to false if this field is not "saveable", e.g. static test |
from FormBase |
$REQUEST_VARS | from FormComponent | ||
$name | from FormComponent | ||
callable|bool | $db_handler | from FormComponent |
Methods
No description
Adds a DOM selector which is used to pasting clip board content.
Clears (remove) the temp folder
Converts the value as string representation into an array with values.
Renders the GUI
Display field in print mode
Returns the default value for this component.
Returns the separator of multiple values.
Return Dom Selector for this field within the current form (This is NOT necessary unique if you are having 2 forms with identical names in form and field names
Get Element Visibility Class Formerly known as tag class
Returns the settings for the image edit functionality.
Returns a relative location path.
No description
Returns a message which is displayed when no document is selected.
Returns whether client side upload listener should be attached or not.
Returns a string that contains a js callback function name.
Returns a document model.
Returns a DOM selector which is used to pasting clip board content.
This option is used by the replace location with id method.
Returns whether a submit should be triggered after a document selection.
Returns a custom label name for the upload field.
Returns the storage path where to save files.
No description
No description
Get a unique DOM ID Replaces . with _ to prevent possible ambiguous ID's like #form_id.cms_comp
No description
Does this component use combined input fields which required special handling from form?
Initialize the component, loading all dependent instances and required JS and CSS files
This class provides an automated handling for storing attached / uploaded documents. This handling will be triggered on save and if this option (auto store) is TRUE.
Returns whether changes to attachments should trigger a form submit.
Returns TRUE if this component supports multiple document selection.
Returns TRUE if the values of this component are serialized.
Checks if the field is hidden by a tag. It is important when validating
No description
Process the component, storing provided files in a temporary folder
No description
Generates a list of selection items, as provided in the argument
Serializes the selection, saving temporary files in the xfs file system
Set TRUE to let this class handle the attached / uploaded documents. The handling will be triggered on save.
Show Custom Error Message for this field
Sets the separator for multiple values.
Sets whether changes to attachments should trigger a form submit.
Sets the image edit settings for cropping function.
Sets the configuration for image editing.
Field is to be loaded from and saved to database.
Field is considered to be translatable. This is usually determined automatically reading the instance configuration of the calling instance
Consider Field as required
Set Field label
Sets a relative location path.
No description
Sets whether this component supports multiple documents.
Sets a message which is displayed when no document is selected.
Sets whether client side upload listener should be attached or not.
Sets a js callback function name.
Set the source element which should be checked for File Uploads by Copy&Paste Events
Sets a DOM selector which is used to pasting clip board content.
Manipulate another fields data when the value of the current field changes.
Add Custom HTML before the field element
Set TRUE to use cascaded folder.
Sets whether a submit should be triggered after a document selection.
If TRUE, field values will be saved serialized.
Sets a custom label name for upload field.
Set Visibility Dependency if you want your field only to be shown if another field has a specify value Array Syntax: tag, tag_source
Set field to be the event source for another dependent field. Changes of this fields values will trigger events to their dependent fields and change their visibility in the frontend
Sets the path to the storage where to save files on upload.
Details
in
FormBase at line 31
__construct()
FormBase constructor.
The constructor is able to set an array of properties options
at line 1271
_cb_handle_new_document($instance_id, $hook_name, $name)
No description
at line 454
FormDocument
addPasteSource(string $pasteSource)
Adds a DOM selector which is used to pasting clip board content.
This parameter will be pass to the client JS engine vor evaluating.
IMPORTANT: Make sure that the pasteSource only uses DOTs as CSS selectors not part of the name.
in
FormBase at line 200
append(string $name, mixed $value, bool|string $key = false)
No description
at line 598
clear()
Clears (remove) the temp folder
in
FormBase at line 185
void
concat(string $name, string $value)
No description
at line 146
protected array
convertDefaultValue(string $value)
Converts the value as string representation into an array with values.
This is e.g. used to convert default value to an array with values which can be evaluated by process and save method. This method considers the serialization option and uses the defined value separator.
in
FormBase at line 170
mixed
destroy($name)
No description
at line 1023
string
display_field(mixed $fieldname, mixed $default_value = false)
Renders the GUI
at line 1260
string
display_field_print(string $fieldname, string $default_value = false)
Display field in print mode
in
FormBase at line 76
mixed
get(string $name)
No description
in
FormBase at line 83
array
getConfig()
No description
at line 122
array
getDefault()
Returns the default value for this component.
This method considers the model set on the form. If the model is set, it will prefer the value from model instead of the default value set by option setter. This method uses the convert method to ensure to return a valid default value.
at line 193
string
getDelimiter()
Returns the separator of multiple values.
This separator is used for multiple values which are not serialized. This shouldn't be used together with serialization.
in
FormComponent at line 583
string
getDomSelector()
Return Dom Selector for this field within the current form (This is NOT necessary unique if you are having 2 forms with identical names in form and field names
in
FormComponent at line 595
protected string
getElementVisibilityClass()
Get Element Visibility Class Formerly known as tag class
at line 218
array
getImageEditSettings()
Returns the settings for the image edit functionality.
The settings contains options for different image edit types.
in
FormComponent at line 496
bool
getIsVisible()
Determine visibilty based on user input on dependent fields
at line 495
string|null
getLocation()
Returns a relative location path.
The relative location path is used to determine the exact destination path inside of the web dir.
at line 607
string
getMinReferenceLevel()
No description
at line 327
string
getNoDocumentMessage()
Returns a message which is displayed when no document is selected.
at line 365
bool
getNoUpload()
Returns whether client side upload listener should be attached or not.
at line 468
string|null
getOnChange()
Returns a string that contains a js callback function name.
This callback will be triggered when the attachments are changed. This parameter will be pass to the client JS engine vor evaluating.
at line 291
DocumentModel|null
getOwnerDocument()
Returns a document model.
This document model is used as parent model for attached documents. This document model will be the owner of all documents that will be attached or uploaded.
at line 411
string|null
getPasteSource()
Returns a DOM selector which is used to pasting clip board content.
at line 548
bool
getSaveInCascadedFolder()
This option is used by the replace location with id method.
Returns TRUE if the id should be cascaded (e.g. k1 for 10.000 - 19.999)
at line 577
bool
getSelectorAutoSubmit()
Returns whether a submit should be triggered after a document selection.
This options will be pass to the client to trigger the client side submit.
at line 336
string
getUploadLabel()
Returns a custom label name for the upload field.
at line 523
string|null
getWebDir()
Returns the storage path where to save files.
If this form component does not provide a web dir then this method will return the web dir defined in the form or null if no one is defined.
in
FormComponent at line 168
string
get_description()
No description
in
FormComponent at line 274
mixed
get_display_value()
returns the displayed value
in
FormBase at line 219
array
get_group(string $prefix)
No description
in
FormComponent at line 149
string
get_help_tooltip_icon()
No description
at line 1842
array
get_items()
No description
in
FormBase at line 91
array
get_properties()
No description
at line 637
protected string
get_tmp_folder(null|string $process_id = null)
No description
at line 628
string
get_unique_dom_id()
Get a unique DOM ID Replaces . with _ to prevent possible ambiguous ID's like #form_id.cms_comp
at line 1684
XfsDocument[]
get_uploaded_documents()
No description
in
FormComponent at line 47
array|bool
get_validation_options()
No description
in
FormComponent at line 187
get_value()
No description
in
FormComponent at line 39
bool
hasCombinedInputFields()
Does this component use combined input fields which required special handling from form?
at line 66
init()
Initialize the component, loading all dependent instances and required JS and CSS files
in
FormBase at line 39
init_obj()
Initializes the form base
in
FormComponent at line 544
$this
insertAfter(FormComponent $formComponent = null)
Insert this field after the specified field
in
FormComponent at line 529
$this
insertBefore(FormComponent $formComponent = null)
Insert this field before the specified field
at line 91
bool
isAutoStore()
This class provides an automated handling for storing attached / uploaded documents. This handling will be triggered on save and if this option (auto store) is TRUE.
at line 388
bool
isFormSubmitOnChange()
Returns whether changes to attachments should trigger a form submit.
This parameter will be pass to the client JS engine vor evaluating.
at line 267
bool
isMultiple()
Returns TRUE if this component supports multiple document selection.
in
FormComponent at line 369
bool
isReadonly()
Returns TRUE if field is readonly, FALSE otherwise.
at line 167
bool
isSerialized()
Returns TRUE if the values of this component are serialized.
in
FormBase at line 239
bool
is_displayed()
Checks if the field is hidden by a tag. It is important when validating
at line 1849
void
post_process()
No description
at line 652
void
process()
Process the component, storing provided files in a temporary folder
in
FormComponent at line 198
string
render(string|false $name = false, string|false $value = false)
No description
at line 1310
protected mixed|string
render_selected_documents(bool $file_ids = false)
Generates a list of selection items, as provided in the argument
at line 1691
mixed
save()
Serializes the selection, saving temporary files in the xfs file system
in
FormBase at line 103
$this
set(string $name, mixed $value)
No description
at line 103
FormDocument
setAutoStore(bool $bool)
Set TRUE to let this class handle the attached / uploaded documents. The handling will be triggered on save.
in
FormComponent at line 391
$this
setCSSClassName(string $class = null)
Set Field Row CSS class name
in
FormComponent at line 559
$this
setCustomErrorText(string $error_msg)
Show Custom Error Message for this field
in
FormComponent at line 380
$this
setDefaultValue(mixed $value = null)
Set Field default value
at line 206
FormDocument
setDelimiter(string $delimiter = ',')
Sets the separator for multiple values.
This method affects operation only when no serialization is used.
in
FormComponent at line 413
$this
setDescriptionText(string $description = null)
Set Field Help Text
at line 401
FormDocument
setFormSubmitOnChange(bool $bool)
Sets whether changes to attachments should trigger a form submit.
Old Param: commit_on_change
in
FormComponent at line 573
$this
setGridClass(string $gridClass = null)
Set Flexbox Grid Class
in
FormComponent at line 402
$this
setHelpText(string $help = null)
Set Field Help Text
at line 231
FormDocument
setImageCropperSettings(string $aspectRatio)
Sets the image edit settings for cropping function.
at line 257
FormDocument
setImageEditorSettings(array $settings)
Sets the configuration for image editing.
If this settings are set, the image edit will be enabled. The settings contains options for different image edit types. This method should only used to pass automated created settings. For custom use of settings use the specific image edit type settings.
in
FormComponent at line 336
$this
setIsDBField(bool $bool = true)
Field is to be loaded from and saved to database.
in
FormComponent at line 349
$this
setIsI18NField(bool $bool = true)
Field is considered to be translatable. This is usually determined automatically reading the instance configuration of the calling instance
in
FormComponent at line 360
$this
setIsReadonly(bool $bool = true)
Consider Field as readonly
in
FormComponent at line 325
$this
setIsRequired(bool $bool = true, bool $onlyRequiredIfVisible = true)
Consider Field as required
in
FormComponent at line 311
$this
setLabel(string $label = '', string $icon_class = '', int $width_in_px = null)
Set Field label
at line 509
FormDocument
setLocation(string $location)
Sets a relative location path.
The relative location path is used to determine the exact destination path inside of the web dir.
at line 614
setMinReferenceLevel(string $level)
No description
at line 278
FormDocument
setMultiple(bool $bool)
Sets whether this component supports multiple documents.
at line 317
FormDocument
setNoDocumentMessage(string $message)
Sets a message which is displayed when no document is selected.
at line 376
FormDocument
setNoUpload(bool $bool)
Sets whether client side upload listener should be attached or not.
at line 482
FormDocument
setOnChange(string $onChange)
Sets a js callback function name.
This callback will be triggered when the attachments are changed. This parameter will be pass to the client JS engine vor evaluating.
at line 305
FormDocument
setOwnerDocument(DocumentModel $document)
Sets a document model.
This document model is used as parent model for attached documents. This document model will be the owner of all documents that will be attached or uploaded.
at line 422
FormDocument
setPasteSource(FormComponent $pasteSource)
Set the source element which should be checked for File Uploads by Copy&Paste Events
at line 438
FormDocument
setPasteSourceDomSelector(string $cssSelector)
Sets a DOM selector which is used to pasting clip board content.
This parameter will be pass to the client JS engine vor evaluating.
IMPORTANT: Make sure that the pasteSource only uses DOTs as CSS selectors not part of the name.
in
FormComponent at line 448
$this
setPopulateField(FormComponent $target, string $dataURL = null)
Manipulate another fields data when the value of the current field changes.
Common usage: Populate a second select once user chooses from the first select
in
FormComponent at line 424
$this
setPrefixHTML(string $html = null)
Add Custom HTML before the field element
at line 565
FormDocument
setSaveInCascadedFolder(bool $bool)
Set TRUE to use cascaded folder.
Cascaded folder are used to avoid long id folder names. This is used by replace id in location method.
at line 590
FormDocument
setSelectorAutoSubmit(bool $bool)
Sets whether a submit should be triggered after a document selection.
This options will be pass to the client to trigger the client side submit.
at line 178
FormDocument
setSerialize(bool $bool)
If TRUE, field values will be saved serialized.
in
FormComponent at line 435
$this
setSuffixHTML(string $html = null)
Add Custom HTML after the field element
at line 354
FormDocument
setUploadLabel(string $label)
Sets a custom label name for upload field.
in
FormComponent at line 462
$this
setVisibilityDependsOn(FormComponent $formComponent = null, array $matchingValues = [])
Set Visibility Dependency if you want your field only to be shown if another field has a specify value Array Syntax: tag, tag_source
in
FormComponent at line 486
$this
setVisibilityIsSource(bool $bool = true)
Set field to be the event source for another dependent field. Changes of this fields values will trigger events to their dependent fields and change their visibility in the frontend
Fields are automatically set to be a source if used in a call of setVisibilityDependsOn()
Array Syntax: tag_source
at line 534
FormDocument
setWebDir(string $webDir)
Sets the path to the storage where to save files on upload.
in
FormComponent at line 265
set_display_value(mixed $value)
set the displayed value
in
FormBase at line 155
void
set_properties(array $array)
No description
in
FormComponent at line 31
set_request_vars($request)
No description
in
FormComponent at line 90
bool|string
validate()
No description