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

__construct()

FormBase constructor.

from  FormBase
_cb_handle_new_document($instance_id, $hook_name, $name)

No description

addAdditionalUploadParam(string $key, string $value)

Helper method that can be used to add additional arguments as parameters for requests made when documents are added or changed.

addPasteSource(string $pasteSource)

Adds a DOM selector which is used to pasting clip board content.

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

No description

from  FormBase
clear()

Clears (remove) the temp folder

void
concat(string $name, string $value)

No description

from  FormBase
array
convertDefaultValue(string $value)

Converts the value as string representation into an array with values.

mixed
destroy($name)

No description

from  FormBase
string
display_field(mixed $fieldname, mixed $default_value = false)

Renders the GUI

string
display_field_print(string $fieldname, string $default_value = false)

Display field in print mode

mixed
get(string $name)

No description

from  FormBase
array
getAdditionalUploadParams()

No description

array
getConfig()

No description

from  FormBase
array
getDefault()

Returns the default value for this component.

string
getDelimiter()

Returns the separator of multiple values.

bool
getDisableLinks()

Returns if the user is allowed to select links

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

string
getElementVisibilityClass()

Get Element Visibility Class Formerly known as tag class

array
getImageEditSettings()

Returns the settings for the image edit functionality.

int
getImagePreviewResizeHeight()

Returns the preview image height based on the display mode and cropping. This is used to resize images on the server depending on the required frontend size

int
getImagePreviewResizeWidth()

Returns the preview image width based on the display mode. This is used to resize images on the server depending on the required frontend size

string
getImagePreviewSize()

Returns the current image preview size

bool
getIsVisible()

Determine visibilty based on user input on dependent fields

string
getLabel()

Get Field label

string|null
getLocation()

Returns a relative location path.

string
getMinReferenceLevel()

No description

string
getNoDocumentIcon()

Returns an icon to reflect the possible file types

string
getNoDocumentMessage()

Returns a message which is displayed when no document is selected.

bool
getNoUpload()

Returns whether client side upload listener should be attached or not.

string|null
getOnChange()

Returns a string that contains a js callback function name.

DocumentModel|null
getOwnerDocument()

Returns a document model.

string|null
getPasteSource()

Returns a DOM selector which is used to pasting clip board content.

bool
getSaveInCascadedFolder()

This option is used by the replace location with id method.

bool
getSelectorAutoSubmit()

Returns whether a submit should be triggered after a document selection.

string
getUploadLabel()

Returns a custom label name for the upload field.

string|null
getWebDir()

Returns the storage path where to save files.

string
get_description()

No description

mixed
get_display_value()

returns the displayed value

array
get_group(string $prefix)

No description

from  FormBase
array
get_items()

No description

array
get_properties()

No description

from  FormBase
string
get_tmp_folder(null|string $process_id = null)

No description

string
get_unique_dom_id()

Get a unique DOM ID Replaces . with _ to prevent possible ambiguous ID's like #form_id.cms_comp

get_uploaded_documents()

No description

array|bool
get_validation_options()

No description

get_value()

No description

bool
hasCombinedInputFields()

Does this component use combined input fields which required special handling from form?

bool
hasRequiredStyle()

Return if the component should be shown as required with specified style class.

void
init()

Initialize the component, loading all dependent instances and required JS and CSS files

init_obj()

Initializes the form base

from  FormBase
$this
insertAfter(FormComponent $formComponent = null)

Insert this field after the specified field

$this
insertBefore(FormComponent $formComponent = null)

Insert this field before the specified field

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.

bool
isFormSubmitOnChange()

Returns whether changes to attachments should trigger a form submit.

bool
isMultiple()

Returns TRUE if this component supports multiple document selection.

bool
isReadonly()

Returns TRUE if field is readonly, FALSE otherwise.

bool
isSerialized()

Returns TRUE if the values of this component are serialized.

bool
is_displayed()

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

from  FormBase
void
post_process()

No description

void
process()

Process the component, storing provided files in a temporary folder

string
render(string|false $name = false, string|false $value = false)

No description

string
renderThumb(string $thumbUrl, $filetypeClass = false, $tooltip = false)

Returns the THUMB HTML. The iconClass is the fallback if no thumbURL is provided

mixed|string
render_selected_documents(bool $file_ids = false)

Generates a list of selection items, as provided in the argument

mixed
save()

Serializes the selection, saving temporary files in the xfs file system

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

No description

from  FormBase
$this
setAllowFileExtension(string ...$fileExtensions)

Set the allow file extensions which can be uploaded.

setAllowImage($allowImage = true)

Enable filter of input to accept image types

setAllowVideo($allowVideo = true)

Enable filter of input to accept video types

setAutoStore(bool $bool)

Set TRUE to let this class handle the attached / uploaded documents. The handling will be triggered on save.

$this
setCSSClassName(string $class = null)

Set Field Row CSS class name

$this
setCustomErrorText(string $error_msg)

Show Custom Error Message for this field

setDefaultValue(mixed $value = null)

Set Field default value

setDelimiter(string $delimiter = ',')

Sets the separator for multiple values.

$this
setDescriptionText(string $description = null)

Set Field Help Text

setDisableLinks($allowLinks = true)

Disable the selector to allow the user to select existing documents / links

setFormSubmitOnChange(bool $bool)

Sets whether changes to attachments should trigger a form submit.

$this
setGridClass(string $gridClass = null)

Set Flexbox Grid Class

$this
setHelpText(string $help = null)

Set Field Help Text

setImageCropperSettings(string $aspectRatio, bool $roundShape = false, array $minimumSize = [])

Sets the image edit settings for cropping function.

setImageEditorSettings(array $settings)

Sets the configuration for image editing.

setImagePreviewSize($size)

Sets a fixed image preview size which will be used for single image selects

$this
setIsDBField(bool $bool = true)

Field is to be loaded from and saved to database.

$this
setIsI18NField(bool $bool = true)

Field is considered to be translatable. This is usually determined automatically reading the instance configuration of the calling instance

$this
setIsReadonly(bool $bool = true)

Consider Field as readonly

$this
setIsRequired(bool $bool = true, bool $onlyRequiredIfVisible = true)

Consider Field as required

$this
setLabel(string $label = '', string $icon_class = null)

Set Field label

$this
setLabelIconClass(string $icon_class = '')

Set label icon class

setLocation(string $location)

Sets a relative location path.

setMinReferenceLevel(string $level)

No description

setMultiple(bool $bool)

Sets whether this component supports multiple documents.

setNoDocumentMessage(string $message)

Sets a message which is displayed when no document is selected.

setNoUpload(bool $bool)

Sets whether client side upload listener should be attached or not.

setOnChange(string $onChange)

Sets a js callback function name.

setOwnerDocument(DocumentModel $document)

Sets a document model.

setPasteSource(FormComponent $pasteSource)

Set the source element which should be checked for File Uploads by Copy&Paste Events

setPasteSourceDomSelector(string $cssSelector)

Sets a DOM selector which is used to pasting clip board content.

$this
setPopulateField(FormComponent $target, string $dataURL = null)

Manipulate another fields data when the value of the current field changes.

$this
setPrefixHTML(string $html = null)

Add Custom HTML before the field element

setSaveInCascadedFolder(bool $bool)

Set TRUE to use cascaded folder.

setSelectorAutoSubmit(bool $bool)

Sets whether a submit should be triggered after a document selection.

setSerialize(bool $bool)

If TRUE, field values will be saved serialized.

$this
setSuffixHTML(string $html = null)

Add Custom HTML after the field element

setUploadLabel(string $label)

Sets a custom label name for upload field.

$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

$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

setWebDir(string $webDir)

Sets the path to the storage where to save files on upload.

set_display_value(mixed $value)

set the displayed value

void
set_properties(array $array)

No description

from  FormBase
set_request_vars($request)

No description

array
validate()

Validate Attachments

bool
validateInFrontendAsRequired()

Should this field be marked with HTML5 required attribute? HTML5 required should not be used when field may be hidden, as it might still be required frontend-wise, even if hidden!

bool
validateInRequestAsRequired()

Should this field be treated as required during request validation?

Details

in FormBase at line 31
__construct()

FormBase constructor.

The constructor is able to set an array of properties options

at line 1615
_cb_handle_new_document($instance_id, $hook_name, $name)

No description

Parameters

$instance_id
$hook_name
$name

Exceptions

Exception

at line 2430
FormDocument addAdditionalUploadParam(string $key, string $value)

Helper method that can be used to add additional arguments as parameters for requests made when documents are added or changed.

Parameters

string $key
string $value

Return Value

FormDocument

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

Parameters

string $pasteSource

Return Value

FormDocument

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

No description

Parameters

string $name

property name

mixed $value

property value

bool|string $key

key of property array

at line 736
clear()

Clears (remove) the temp folder

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

No description

Parameters

string $name

of the property

string $value

to be concated

Return Value

void

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

Parameters

string $value

Return Value

array

See also

FormDocument::setDelimiter
FormDocument::getDelimiter

in FormBase at line 168
mixed destroy($name)

No description

Parameters

$name

Return Value

mixed

last value

at line 1212
string display_field(mixed $fieldname, mixed $default_value = false)

Renders the GUI

Parameters

mixed $fieldname
mixed $default_value

Return Value

string

Exceptions

ContentException

at line 1604
string display_field_print(string $fieldname, string $default_value = false)

Display field in print mode

Parameters

string $fieldname
string $default_value

Return Value

string

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

No description

Parameters

string $name

name of the property

Return Value

mixed

at line 2407
array getAdditionalUploadParams()

No description

Return Value

array

in FormBase at line 84
array getConfig()

No description

Return Value

array

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

Return Value

array

See also

FormDocument::convertDefaultValue

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

Return Value

string

See also

FormDocument::setSerialize

Returns if the user is allowed to select links

Return Value

bool

in FormComponent at line 588
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

Return Value

string

Exceptions

Exception

in FormComponent at line 600
protected string getElementVisibilityClass()

Get Element Visibility Class Formerly known as tag class

Return Value

string

at line 274
array getImageEditSettings()

Returns the settings for the image edit functionality.

The settings contains options for different image edit types.

Return Value

array

at line 375
protected int getImagePreviewResizeHeight()

Returns the preview image height based on the display mode and cropping. This is used to resize images on the server depending on the required frontend size

Return Value

int Pixel

at line 367
protected int getImagePreviewResizeWidth()

Returns the preview image width based on the display mode. This is used to resize images on the server depending on the required frontend size

Return Value

int Pixel

at line 358
string getImagePreviewSize()

Returns the current image preview size

Return Value

string

'sm', 'md', 'lg'

in FormComponent at line 501
bool getIsVisible()

Determine visibilty based on user input on dependent fields

Return Value

bool

True if considered visible

in FormComponent at line 317
string getLabel()

Get Field label

Return Value

string

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

Return Value

string|null

at line 745
string getMinReferenceLevel()

No description

Return Value

string

at line 460
string getNoDocumentIcon()

Returns an icon to reflect the possible file types

Return Value

string

at line 445
string getNoDocumentMessage()

Returns a message which is displayed when no document is selected.

Return Value

string

at line 503
bool getNoUpload()

Returns whether client side upload listener should be attached or not.

Return Value

bool

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

Return Value

string|null

Returns null if no js callback function is defined.

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

Return Value

DocumentModel|null

Returns a document model or null if not set.

at line 549
string|null getPasteSource()

Returns a DOM selector which is used to pasting clip board content.

Return Value

string|null

at line 686
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)

Return Value

bool

See also

\XELOS\Framework\XF\UI\Form\FormDocument::replace_location_id()
File::get_cascaded_folder

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

Return Value

bool

at line 474
string getUploadLabel()

Returns a custom label name for the upload field.

Return Value

string

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

Return Value

string|null

in FormComponent at line 156
string get_description()

No description

Return Value

string

html or false if no description is set

in FormComponent at line 257
mixed get_display_value()

returns the displayed value

Return Value

mixed value

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

No description

Parameters

string $prefix

prefix (e.g. mygroup_ )

Return Value

array

at line 2248
array get_items()

No description

Return Value

array

in FormBase at line 92
array get_properties()

No description

Return Value

array

at line 827
protected string get_tmp_folder(null|string $process_id = null)

No description

Parameters

null|string $process_id

Return Value

string

at line 818
string get_unique_dom_id()

Get a unique DOM ID Replaces . with _ to prevent possible ambiguous ID's like #form_id.cms_comp

Return Value

string

at line 2091
XfsDocument[] get_uploaded_documents()

No description

Return Value

XfsDocument[]

in FormComponent at line 56
array|bool get_validation_options()

No description

Return Value

array|bool

validation options, false on failure

in FormComponent at line 175
get_value()

No description

in FormComponent at line 48
bool hasCombinedInputFields()

Does this component use combined input fields which required special handling from form?

Return Value

bool

in FormComponent at line 651
protected bool hasRequiredStyle()

Return if the component should be shown as required with specified style class.

Return Value

bool

at line 122
void init()

Initialize the component, loading all dependent instances and required JS and CSS files

Return Value

void

in FormBase at line 39
init_obj()

Initializes the form base

in FormComponent at line 549
$this insertAfter(FormComponent $formComponent = null)

Insert this field after the specified field

Parameters

FormComponent $formComponent

Return Value

$this

in FormComponent at line 534
$this insertBefore(FormComponent $formComponent = null)

Insert this field before the specified field

Parameters

FormComponent $formComponent

Return Value

$this

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

Return Value

bool

at line 526
bool isFormSubmitOnChange()

Returns whether changes to attachments should trigger a form submit.

This parameter will be pass to the client JS engine vor evaluating.

Return Value

bool

at line 385
bool isMultiple()

Returns TRUE if this component supports multiple document selection.

Return Value

bool

in FormComponent at line 374
bool isReadonly()

Returns TRUE if field is readonly, FALSE otherwise.

Return Value

bool

at line 223
bool isSerialized()

Returns TRUE if the values of this component are serialized.

Return Value

bool

in FormBase at line 237
bool is_displayed()

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

Return Value

bool

at line 2255
void post_process()

No description

Return Value

void

Exceptions

Exception

at line 842
void process()

Process the component, storing provided files in a temporary folder

Return Value

void

Exceptions

ContentException

in FormComponent at line 187
string render(string|false $name = false, string|false $value = false)

No description

Parameters

string|false $name
string|false $value

Return Value

string

at line 1653
protected string renderThumb(string $thumbUrl, $filetypeClass = false, $tooltip = false)

Returns the THUMB HTML. The iconClass is the fallback if no thumbURL is provided

Parameters

string $thumbUrl

URL to the Thumb. This image must not be cached as it will be reloaded in case of modifications by the frontend!

$filetypeClass
$tooltip

Return Value

string

at line 1680
protected mixed|string render_selected_documents(bool $file_ids = false)

Generates a list of selection items, as provided in the argument

Parameters

bool $file_ids

Return Value

mixed|string

at line 2098
mixed save()

Serializes the selection, saving temporary files in the xfs file system

Return Value

mixed

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

No description

Parameters

string $propertyName

propoerty name

mixed $propertyValue

property value

Return Value

$this

at line 785
$this setAllowFileExtension(string ...$fileExtensions)

Set the allow file extensions which can be uploaded.

Parameters

string ...$fileExtensions

without dot, just the extension, e.g. 'pdf'

Return Value

$this

at line 764
FormDocument setAllowImage($allowImage = true)

Enable filter of input to accept image types

Parameters

$allowImage

Return Value

FormDocument

at line 774
FormDocument setAllowVideo($allowVideo = true)

Enable filter of input to accept video types

Parameters

$allowVideo

Return Value

FormDocument

at line 159
FormDocument setAutoStore(bool $bool)

Set TRUE to let this class handle the attached / uploaded documents. The handling will be triggered on save.

Parameters

bool $bool

Return Value

FormDocument

in FormComponent at line 396
$this setCSSClassName(string $class = null)

Set Field Row CSS class name

Parameters

string $class

e.g. hide_label, error

Return Value

$this

in FormComponent at line 564
$this setCustomErrorText(string $error_msg)

Show Custom Error Message for this field

Parameters

string $error_msg

Return Value

$this

in FormComponent at line 385
FormComponent setDefaultValue(mixed $value = null)

Set Field default value

Parameters

mixed $value

Return Value

FormComponent

at line 262
FormDocument setDelimiter(string $delimiter = ',')

Sets the separator for multiple values.

This method affects operation only when no serialization is used.

Parameters

string $delimiter

= ','

Return Value

FormDocument

in FormComponent at line 418
$this setDescriptionText(string $description = null)

Set Field Help Text

Parameters

string $description

String to help people understand this fields value and options

Return Value

$this

Disable the selector to allow the user to select existing documents / links

Parameters

$allowLinks

Return Value

FormDocument

at line 539
FormDocument setFormSubmitOnChange(bool $bool)

Sets whether changes to attachments should trigger a form submit.

Old Param: commit_on_change

Parameters

bool $bool

Return Value

FormDocument

in FormComponent at line 578
$this setGridClass(string $gridClass = null)

Set Flexbox Grid Class

Parameters

string $gridClass

Example: xcol-6_md-12

Return Value

$this

in FormComponent at line 407
$this setHelpText(string $help = null)

Set Field Help Text

Parameters

string $help

String to help people fill out your form

Return Value

$this

at line 289
FormDocument setImageCropperSettings(string $aspectRatio, bool $roundShape = false, array $minimumSize = [])

Sets the image edit settings for cropping function.

Parameters

string $aspectRatio

Width / Height ratio (e.g. 4/3 or 1:1)

bool $roundShape

If set to true the cropping and image will be displayed round

array $minimumSize

Array with [width, height] as minimum size -> cropper can not cut images smaller than this size

Return Value

FormDocument

See also

FormDocument::setImageEditorSettings

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

Parameters

array $settings

Return Value

FormDocument

See also

FormDocument::setImageCropperSettings

at line 349
FormDocument setImagePreviewSize($size)

Sets a fixed image preview size which will be used for single image selects

Parameters

$size

string 'sm', 'md', 'lg' (default)

Return Value

FormDocument

in FormComponent at line 341
$this setIsDBField(bool $bool = true)

Field is to be loaded from and saved to database.

Parameters

bool $bool

Return Value

$this

in FormComponent at line 354
$this setIsI18NField(bool $bool = true)

Field is considered to be translatable. This is usually determined automatically reading the instance configuration of the calling instance

Parameters

bool $bool

Return Value

$this

in FormComponent at line 365
$this setIsReadonly(bool $bool = true)

Consider Field as readonly

Parameters

bool $bool

Return Value

$this

in FormComponent at line 330
$this setIsRequired(bool $bool = true, bool $onlyRequiredIfVisible = true)

Consider Field as required

Parameters

bool $bool
bool $onlyRequiredIfVisible

If field is used with dependent visibility we consider the field only required when the field was visible to the user

Return Value

$this

in FormComponent at line 293
$this setLabel(string $label = '', string $icon_class = null)

Set Field label

Parameters

string $label
string $icon_class

CSS Icon class, e.g. icon-time

Return Value

$this

in FormComponent at line 308
$this setLabelIconClass(string $icon_class = '')

Set label icon class

Parameters

string $icon_class

CSS Icon class, e.g. icon-time

Return Value

$this

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

Parameters

string $location

Return Value

FormDocument

at line 752
setMinReferenceLevel(string $level)

No description

Parameters

string $level

at line 396
FormDocument setMultiple(bool $bool)

Sets whether this component supports multiple documents.

Parameters

bool $bool

Return Value

FormDocument

at line 435
FormDocument setNoDocumentMessage(string $message)

Sets a message which is displayed when no document is selected.

Parameters

string $message

Return Value

FormDocument

at line 514
FormDocument setNoUpload(bool $bool)

Sets whether client side upload listener should be attached or not.

Parameters

bool $bool

Return Value

FormDocument

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

Parameters

string $onChange

Return Value

FormDocument

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

Parameters

DocumentModel $document

Return Value

FormDocument

at line 560
FormDocument setPasteSource(FormComponent $pasteSource)

Set the source element which should be checked for File Uploads by Copy&Paste Events

Parameters

FormComponent $pasteSource

Return Value

FormDocument

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

Parameters

string $cssSelector

Return Value

FormDocument

in FormComponent at line 453
$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

Parameters

FormComponent $target
string $dataURL

Return Value

$this

in FormComponent at line 429
$this setPrefixHTML(string $html = null)

Add Custom HTML before the field element

Parameters

string $html

e.g. 'http:// '

Return Value

$this

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

Parameters

bool $bool

Return Value

FormDocument

See also

\XELOS\Framework\XF\UI\Form\FormDocument::replace_location_id()
File::get_cascaded_folder

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

Parameters

bool $bool

Return Value

FormDocument

at line 234
FormDocument setSerialize(bool $bool)

If TRUE, field values will be saved serialized.

Parameters

bool $bool

Return Value

FormDocument

in FormComponent at line 440
$this setSuffixHTML(string $html = null)

Add Custom HTML after the field element

Parameters

string $html

e.g. ' hours'

Return Value

$this

at line 492
FormDocument setUploadLabel(string $label)

Sets a custom label name for upload field.

Parameters

string $label

Return Value

FormDocument

in FormComponent at line 467
$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

Parameters

FormComponent $formComponent

Null will reset and remove all existing dependencies

array $matchingValues

Field will be shown/visible if the dependent field contains/has one of the values specified

Return Value

$this

in FormComponent at line 491
$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

Parameters

bool $bool

Return Value

$this

at line 672
FormDocument setWebDir(string $webDir)

Sets the path to the storage where to save files on upload.

Parameters

string $webDir

Return Value

FormDocument

in FormComponent at line 248
set_display_value(mixed $value)

set the displayed value

Parameters

mixed $value value

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

No description

Parameters

array $array

associated array like property=>value

Return Value

void

in FormComponent at line 40
set_request_vars($request)

No description

Parameters

$request

at line 1454
array validate()

Validate Attachments

Return Value

array

Returns an array with error message strings. Empty array if no errors exist

in FormComponent at line 639
protected bool validateInFrontendAsRequired()

Should this field be marked with HTML5 required attribute? HTML5 required should not be used when field may be hidden, as it might still be required frontend-wise, even if hidden!

Return Value

bool

in FormComponent at line 624
protected bool validateInRequestAsRequired()

Should this field be treated as required during request validation?

Return Value

bool