FormFile
class FormFile extends FormComponent
Class FormFile
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 | |
Controller | $mod | ||
protected string | $file_select | ||
protected string|bool | $file_name | ||
protected string|bool | $file_path | ||
array | $image_mimes |
Methods
FormFile constructor.
No description
No description
Display field in print mode
Returns the previously set file extensions or system wide if not set
Returns the content type.
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
Returns a download handler.
Get Element Visibility Class Formerly known as tag class
Returns whether to display upload options or not.
Returns a relative location path.
Returns a maximum height for images.
Returns the maximum upload size.
Returns a maximum width for images.
Returns the supported mime types.
This option is used by the replace location with id method.
Returns the upload callback.
Returns whether the system dms will be used for storing or not.
Returns the storage path where to save files.
Does this component use combined input fields which required special handling from form?
Returns TRUE if a thumbnail should be displayed.
Initialize
Checks if the field is hidden by a tag. It is important when validating
No description
No description
No description
Move File to Final Location and return the filename
The accepted file extensions.
Sets the content type.
Show Custom Error Message for this field
Sets a download handler.
Sets whether to display upload options or not.
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.
Sets a maximum height for images.
Sets the maximum upload size.
Sets a maximum width for images.
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 thumbnail should be displayed or not.
Sets a upload callback.
Sets whether the system dms will be used for storing or not.
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
Validate, Check MimeTypes
Details
at line 48
__construct()
FormFile constructor.
in
FormBase at line 200
append(string $name, mixed $value, bool|string $key = false)
No description
in
FormBase at line 185
void
concat(string $name, string $value)
No description
at line 1140
protected bool
delete_file()
No description
in
FormBase at line 170
mixed
destroy($name)
No description
at line 493
string
display_field(string $fieldname, bool|string $default_value = false)
No description
at line 717
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
at line 149
array|null
getAcceptedExtensions()
Returns the previously set file extensions or system wide if not set
in
FormBase at line 83
array
getConfig()
No description
at line 306
string
getContentType()
Returns the content type.
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
at line 285
callable
getDownloadHandler()
Returns a download handler.
in
FormComponent at line 595
protected string
getElementVisibilityClass()
Get Element Visibility Class Formerly known as tag class
at line 264
bool
getHideOptions()
Returns whether to display upload options or not.
in
FormComponent at line 496
bool
getIsVisible()
Determine visibilty based on user input on dependent fields
at line 91
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 402
int
getMaxHeight()
Returns a maximum height for images.
This value is used for image uploads to restrict the size of an image.
at line 229
int
getMaxUploadSize()
Returns the maximum upload size.
at line 372
int
getMaxWidth()
Returns a maximum width for images.
This value is used for image uploads to restrict the size of an image.
at line 118
string
getMime()
Returns the supported mime types.
The returned value can contains multiple mime types which are separated by comma.
at line 415
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 329
mixed
getUploadCallback()
Returns the upload callback.
The callback is called before the upload starts.
at line 171
bool
getUseSystemDMS()
Returns whether the system dms will be used for storing or not.
at line 196
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
in
FormBase at line 91
array
get_properties()
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 243
string|null
hasThumbnail()
Returns TRUE if a thumbnail should be displayed.
at line 440
init()
Initialize
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
in
FormComponent at line 369
bool
isReadonly()
Returns TRUE if field is readonly, FALSE otherwise.
in
FormBase at line 239
bool
is_displayed()
Checks if the field is hidden by a tag. It is important when validating
at line 1078
void
post_process()
No description
at line 461
void
process()
No description
in
FormComponent at line 198
string
render(string|false $name = false, string|false $value = false)
No description
at line 971
mixed
save()
Move File to Final Location and return the filename
in
FormBase at line 103
$this
set(string $name, mixed $value)
No description
at line 140
FormFile
setAcceptedExtensions(array $extensions)
The accepted file extensions.
in
FormComponent at line 391
$this
setCSSClassName(string $class = null)
Set Field Row CSS class name
at line 317
FormFile
setContentType(string $type)
Sets the content type.
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
in
FormComponent at line 413
$this
setDescriptionText(string $description = null)
Set Field Help Text
at line 296
FormFile
setDownloadHandler(callable $callable)
Sets a download handler.
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 275
FormFile
setHideOptions(bool $bool)
Sets whether to display upload options or not.
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 105
FormFile
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 389
FormFile
setMaxHeight(int $height)
Sets a maximum height for images.
This value is used for image uploads to restrict the size of an image. This should be used in combination with width.
at line 219
FormFile
setMaxUploadSize(int $size)
Sets the maximum upload size.
at line 359
FormFile
setMaxWidth(int $width)
Sets a maximum width for images.
This value is used for image uploads to restrict the size of an image. This should be used in combination with height.
at line 129
FormFile
setMime(string $mimes)
Sets mime type.
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 432
FormFile
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.
in
FormComponent at line 435
$this
setSuffixHTML(string $html = null)
Add Custom HTML after the field element
at line 254
FormFile
setThumbnail(bool $bool)
Sets whether a thumbnail should be displayed or not.
at line 343
FormFile
setUploadCallback(callable $callback)
Sets a upload callback.
The callback is called before the upload starts. The callback will be called with params "tmp_name" as first and "name" as second function param.
at line 182
FormFile
setUseSystemDMS(bool $bool)
Sets whether the system dms will be used for storing or not.
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 207
FormFile
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
at line 726
bool|string
validate()
Validate, Check MimeTypes