Properties

$_options

$_options : mixed||string|int

Options

Type

mixed||string|int —

$_multiple

$_multiple : 

Allow multiple selections?

Type

$_size

$_size : 

Number of rows. "1" makes a dropdown list.

Type

$_value

$_value : mixed||string|int

Pre-selcted values

Type

mixed||string|int —

$customValidationCode

$customValidationCode : mixed||string|int

Javascript performing additional validation of this element data

This property contains a list of Javascript snippets that will be sent to APIForm::renderValidationJS(). NB: All elements are added to the output one after the other, so don't forget to add a ";" after each to ensure no Javascript syntax error is generated.

Type

mixed||string|int — ()

$_name

$_name : 

"name" attribute of the element

Type

$_caption

$_caption : 

caption of the element

Type

$_accesskey

$_accesskey : 

Accesskey for this element

Type

$_class

$_class : mixed||string|int

HTML classes for this element

Type

mixed||string|int —

$_hidden

$_hidden : 

hidden?

Type

$_extra

$_extra : mixed||string|int

extra attributes to go in the tag

Type

mixed||string|int —

$_required

$_required : 

required field?

Type

$_description

$_description : 

description of the field

Type

$_nocolspan

$_nocolspan : 

CAtzwolf: Modified for No Colspan

Lets a developer have only one column in a form element rather than two. Example of usgage: Allows text editors to span 2 columns rathe than pushed into one column

Type

$_formtype

$_formtype : 

Get form type

Type

Methods

__construct()

__construct(  caption,   name,   value = null,   size = 1) : 

Constructor

Parameters

caption
name
value

Pre-selected value (or array of them). Legal is any name of a API_ROOT_PATH."/language/" subdirectory.

size

Number of rows. "1" makes a drop-down-list.

Returns

isMultiple()

isMultiple() : 

Are multiple selections allowed?

Returns

getSize()

getSize() : 

Get the size

Returns

getValue()

getValue(  encode = false) : mixed||string|int

Get an array of pre-selected values

Parameters

encode

To sanitizer the text?

Returns

mixed||string|int —

setValue()

setValue( value) : 

Set pre-selected values

Parameters

value

mixed

Returns

addOption()

addOption(  value,   name) : 

Add an option

Parameters

value

"value" attribute

name

"name" attribute

Returns

addOptionArray()

addOptionArray(mixed||string|int  options) : 

Add multiple options

Parameters

mixed||string|int options

Associative array of value->name pairs

Returns

getOptions()

getOptions(bool|int  encode = false) : mixed||string|int

Get an array with all the options

Note: both name and value should be sanitized. However for backward compatibility, only value is sanitized for now.

Parameters

bool|int encode

To sanitizer the text? potential values: 0 - skip; 1 - only for value; 2 - for both value and name

Returns

mixed||string|int —

Associative array of value->name pairs

render()

render() : 

Generates output for the element.

This method is abstract and must be overwritten by the child classes.

Returns

renderValidationJS()

renderValidationJS() : 

Render custom javascript validation code

Returns

isContainer()

isContainer() : 

Is this element a container of other elements?

Returns

false

setName()

setName(  name) : 

set the "name" attribute for the element

Parameters

name

"name" attribute for the element

Returns

getName()

getName(  encode = true) : 

get the "name" attribute for the element

Parameters

encode

Returns

"name" attribute

setAccessKey()

setAccessKey(  key) : 

set the "accesskey" attribute for the element

Parameters

key

"accesskey" attribute for the element

Returns

getAccessKey()

getAccessKey() : 

get the "accesskey" attribute for the element

Returns

"accesskey" attribute value

getAccessString()

getAccessString(  str) : 

If the accesskey is found in the specified string, underlines it

Parameters

str

String where to search the accesskey occurence

Returns

Enhanced string with the 1st occurence of accesskey underlined

setClass()

setClass(  class) : 

set the "class" attribute for the element

Parameters

class

Returns

getClass()

getClass() : 

get the "class" attribute for the element

Returns

"class" attribute value

setCaption()

setCaption(  caption) : 

set the caption for the element

Parameters

caption

Returns

getCaption()

getCaption(  encode = false) : 

get the caption for the element

Parameters

encode

To sanitizer the text?

Returns

getTitle()

getTitle(  encode = true) : 

get the caption for the element

Parameters

encode

To sanitizer the text?

Returns

setDescription()

setDescription(  description) : 

set the element's description

Parameters

description

Returns

getDescription()

getDescription(  encode = false) : 

get the element's description

Parameters

encode

To sanitizer the text?

Returns

setHidden()

setHidden() : 

flag the element as "hidden"

Returns

isHidden()

isHidden() : 

Find out if an element is "hidden".

Returns

isRequired()

isRequired() : 

Find out if an element is required.

Returns

setExtra()

setExtra(  extra,   replace = false) : mixed||string|int

Add extra attributes to the element.

This string will be inserted verbatim and unvalidated in the element's tag. Know what you are doing!

Parameters

extra
replace

If true, passed string will replace current content otherwise it will be appended to it

Returns

mixed||string|int —

New content of the extra string

getExtra()

getExtra(  encode = false) : 

Get the extra attributes for the element

Parameters

encode

To sanitizer the text?

Returns

setNocolspan()

setNocolspan(  nocolspan = true) : 

Set the element's nocolspan Modified by Catzwolf

Parameters

nocolspan

Returns

getNocolspan()

getNocolspan() : 

Get the element's nocolspan Modified by Catzwolf

Returns

getFormType()

getFormType() : 

get the element's nocolspan Modified by Catzwolf

Returns

setFormType()

setFormType(  value) : 

set the element's nocolspan Modified by Catzwolf

Parameters

value

Returns