Jelix 1.8.13

jFormsControlImageUpload extends jFormsControlUpload2
in package

base class for all jforms control.

Tags
subpackage

forms

Table of Contents

$accept  : mixed
$alertInvalid  : string
$alertRequired  : string
$capture  : mixed
$datatype  : jDatatype
$defaultValue  : mixed
$emptyValueLabel  : string
$fileInfo  : mixed
$help  : string
$hint  : string
$initialActivation  : bool
$initialReadOnly  : bool
$label  : string
$maxHeight  : int
$maxsize  : mixed
$maxWidth  : int
$mimetype  : mixed
$ref  : string
$required  : bool
$type  : string
$attributes  : array<string|int, mixed>
$container  : jFormsDataContainer
$error  : mixed
$form  : jFormsBase
$modified  : mixed
__construct()  : mixed
check()  : null|int
check and filter the value of the control.
deactivate()  : mixed
deleteFile()  : mixed
delete the current file indicated into the control
getAttribute()  : mixed
getDisplayValue()  : mixed
getNewFile()  : string
The filename of the file uploaded during the form submission
getOriginalFile()  : string
the filename sets into the form during its initialization
getTempFile()  : mixed
getUniqueFileName()  : string
Return a filename under which the file can be saved without overwriting an existing file.
getWidgetType()  : string
isActivated()  : bool
check if the control is activated.
isContainer()  : mixed
says if the control can have multiple values.
isHtmlContent()  : mixed
says if the content is html or not.
isModified()  : mixed
isReadOnly()  : bool
check if the control is readonly.
saveFile()  : bool
Save the uploaded file into the given directory, under the original filename, or under the name given into $alternateName
setAttribute()  : mixed
setData()  : mixed
setDataFromDao()  : mixed
setForm()  : mixed
setNewFile()  : void
Change the name of the new file name. If there is already an uploaded file, it is deleted
setReadOnly()  : mixed
setValueFromRequest()  : mixed
_diffValues()  : bool
deleteNewFile()  : mixed
isUploadedFile()  : mixed
moveUploadedFile()  : mixed
processNewFile()  : mixed
processUpload()  : mixed

Properties

$alertInvalid

public string $alertInvalid = ''

the message when the value is invalid

Tags

$alertRequired

public string $alertRequired = ''

the message when there is no value and it is required

Tags

$defaultValue

public mixed $defaultValue = ''

the value when the form is created (and not initialized by a data source

Tags

$emptyValueLabel

public string $emptyValueLabel

label displayed when only values are displayed, and when there is no value

Tags

$help

public string $help = ''

the message for the help on the control (typically help displayed in a popup)

Tags

$hint

public string $hint = ''

the message for tips on the control (typically the tooltip value)

Tags

$initialReadOnly

public bool $initialReadOnly = \false

indicate if the control is in read only mode

Tags

$required

public bool $required = \false

true if the control should be filled by the user

Tags

$attributes

protected array<string|int, mixed> $attributes = array()

miscellaneous values attached to the control

Tags

Methods

__construct()

public __construct(string $ref) : mixed
Parameters
$ref : string

the identifiant of the control

Tags
Return values
mixed

check()

check and filter the value of the control.

public check() : null|int

It is the responsability of the implementation to fill the "errors" or "data" properties of the container.

Tags
Return values
null|int

null if it is ok, or one of jForms::ERRDATA_* constants when there is an error

deactivate()

public deactivate([mixed $deactivation = true ]) : mixed
Parameters
$deactivation : mixed = true
Tags
Return values
mixed

deleteFile()

delete the current file indicated into the control

public deleteFile(string $directoryPath) : mixed
Parameters
$directoryPath : string

the directory where the file is supposed to be stored

Tags
Return values
mixed

getAttribute()

public getAttribute(mixed $name) : mixed
Parameters
$name : mixed
Tags
Return values
mixed

getDisplayValue()

public getDisplayValue(mixed $value) : mixed
Parameters
$value : mixed
Tags
Return values
mixed

getNewFile()

The filename of the file uploaded during the form submission

public getNewFile() : string
Tags
Return values
string

getOriginalFile()

the filename sets into the form during its initialization

public getOriginalFile() : string
Tags
Return values
string

getUniqueFileName()

Return a filename under which the file can be saved without overwriting an existing file.

public getUniqueFileName(string $directoryPath[, string $alternateName = '' ]) : string

The base name of the file is the name of the uploaded file, or the name given into the $alternateName parameter. The returning filename can be ended by a number if there is already a file with the original name.

Parameters
$directoryPath : string

the directory where the file is supposed to be stored

$alternateName : string = ''
Tags
Return values
string

the filename

getWidgetType()

public getWidgetType() : string
Tags
Return values
string

the default widget type to use to render the control

isActivated()

check if the control is activated.

public isActivated() : bool
Tags
Return values
bool

true if it is activated

isContainer()

says if the control can have multiple values.

public isContainer() : mixed
Tags
Return values
mixed

isHtmlContent()

says if the content is html or not.

public isHtmlContent() : mixed
Tags
since
1.2
Return values
mixed

isReadOnly()

check if the control is readonly.

public isReadOnly() : bool
Tags
Return values
bool

true if it is readonly

saveFile()

Save the uploaded file into the given directory, under the original filename, or under the name given into $alternateName

public saveFile(string $directoryPath[, string $alternateName = '' ][, mixed $deletePreviousFile = true ]) : bool

If there is already a file with that name, it will be overwritten. If you don't want this behavior, you can call getUniqueFileName to have a unique name.

This method should be idempotent.

Parameters
$directoryPath : string

the directory where the file is supposed to be stored

$alternateName : string = ''
$deletePreviousFile : mixed = true
Tags
Return values
bool

setAttribute()

public setAttribute(mixed $name, mixed $value) : mixed
Parameters
$name : mixed
$value : mixed
Tags
Return values
mixed

setData()

public setData(mixed $value) : mixed
Parameters
$value : mixed
Tags
Return values
mixed

setDataFromDao()

public setDataFromDao(mixed $value, mixed $daoDatatype) : mixed
Parameters
$value : mixed
$daoDatatype : mixed
Tags
Return values
mixed

setNewFile()

Change the name of the new file name. If there is already an uploaded file, it is deleted

public setNewFile(string $fileName) : void
Parameters
$fileName : string
Tags
Return values
void

setReadOnly()

public setReadOnly([mixed $r = true ]) : mixed
Parameters
$r : mixed = true
Tags
Return values
mixed

_diffValues()

protected _diffValues(mixed &$v1, mixed &$v2) : bool
Parameters
$v1 : mixed
$v2 : mixed
Tags
Return values
bool

true if the values are not equals

isUploadedFile()

protected isUploadedFile(mixed $file) : mixed
Parameters
$file : mixed
Tags
Return values
mixed

moveUploadedFile()

protected moveUploadedFile(mixed $file, mixed $target) : mixed
Parameters
$file : mixed
$target : mixed
Tags
Return values
mixed

processUpload()

protected processUpload(mixed $action, mixed $fileInfo) : mixed
Parameters
$action : mixed
$fileInfo : mixed
Tags
Return values
mixed

Search results