XOOPS  2.6.0
Xoops\Form\Select Class Reference
Inheritance diagram for Xoops\Form\Select:
Inheritance graph

Public Member Functions

 __construct ($caption, $name, $value=null, $size=1, $multiple=false)
 
 addOptgroup ($name, $optgroup)
 
 addOption ($value, $name= '')
 
 addOptionArray ($options)
 
 getOptgroup ()
 
 getOptions ($encode=false)
 
 getSize ()
 
 isMultiple ()
 
 render ()
 
 renderValidationJS ()
 
- Public Member Functions inherited from Xoops\Form\Element
 getAccessKey ()
 
 getAccessString ($str)
 
 getCaption ()
 
 getClass ()
 
 getDatalist ()
 
 getDescription ($encode=false)
 
 getExtra ($encode=false)
 
 getMaxcols ()
 
 getName ()
 
 getPattern ()
 
 getPatternDescription ()
 
 getTitle ()
 
 getValue ($encode=false)
 
 isDatalist ()
 
 isHidden ()
 
 isRequired ()
 
 render ()
 
 renderAttributeString ()
 
 renderValidationJS ()
 
 setAccessKey ($key)
 
 setCaption ($caption)
 
 setClass ($class)
 
 setDatalist ($datalist)
 
 setDescription ($description)
 
 setExtra ($extra, $replace=false)
 
 setHidden ()
 
 setName ($name)
 
 setPattern ($pattern, $pattern_description= '')
 
 setRequired ($bool=true)
 
 setTitle ($title)
 
 setValue ($value)
 
- Public Member Functions inherited from Xoops\Html\Attributes
 addAttribute ($name, $value)
 
 getAttribute ($name)
 
 hasAttribute ($name)
 
 renderAttributeString ()
 
 setAttribute ($name, $value=null)
 
 setAttributes ($values)
 
 unsetAttribute ($name)
 

Protected Attributes

 $value = array()
 
- Protected Attributes inherited from Xoops\Form\Element
 $value = ''
 
- Protected Attributes inherited from Xoops\Html\Attributes
 $attributes = array()
 

Private Attributes

 $optgroup = array()
 
 $options = array()
 

Additional Inherited Members

- Public Attributes inherited from Xoops\Form\Element
 $customValidationCode = array()
 

Detailed Description

Definition at line 26 of file Select.php.

Constructor & Destructor Documentation

Xoops\Form\Select::__construct (   $caption,
  $name,
  $value = null,
  $size = 1,
  $multiple = false 
)

Constructor

Parameters
string$captionCaption
string$namename" attribute
mixed$valuePre-selected value (or array of them).
integer$sizeNumber or rows. "1" makes a drop-down-list
boolean$multipleAllow multiple selections?

Definition at line 72 of file Select.php.

References Xoops\Form\Element\$caption, $name, Xoops\Form\Select\$value, Xoops\Html\Attributes\setAttribute(), Xoops\Form\Element\setCaption(), and Xoops\Form\Element\setValue().

Here is the call graph for this function:

Member Function Documentation

Xoops\Form\Select::addOptgroup (   $name,
  $optgroup 
)

Add multiple optgroup

Parameters
string$namename attribute
array$optgroupAssociative array of value->name pairs
Returns
void

Definition at line 146 of file Select.php.

References $name, and Xoops\Form\Select\$optgroup.

Xoops\Form\Select::addOption (   $value,
  $name = '' 
)

Add an option

Parameters
string$valuevalue attribute
string$namename attribute
Returns
void

Definition at line 113 of file Select.php.

References $name, and Xoops\Form\Select\$value.

Referenced by ImagesImageForm\__construct(), MenusMenus_menuForm\__construct(), ImagesImage_imagemanagerForm\__construct(), Xoops\Form\SelectMatchOption\__construct(), and Xoops\Form\Select\addOptionArray().

Here is the caller graph for this function:

Xoops\Form\Select::addOptionArray (   $options)

Add multiple options

Parameters
array$optionsAssociative array of value->name pairs
Returns
void

Definition at line 129 of file Select.php.

References Xoops\Form\Select\$options, and Xoops\Form\Select\addOption().

Referenced by CommentsCommentForm\__construct(), Xoops\Form\SelectTheme\__construct(), Xoops\Form\SelectCountry\__construct(), Xoops\Form\SelectLanguage\__construct(), Xoops\Form\SelectTimeZone\__construct(), Xoops\Form\SelectLocale\__construct(), Xoops\Form\SelectGroup\__construct(), and SystemBlockForm\getForm().

Here is the call graph for this function:

Here is the caller graph for this function:

Xoops\Form\Select::getOptgroup ( )

Get an array with all the optgroup

Returns
array

Definition at line 182 of file Select.php.

References Xoops\Form\Select\$optgroup.

Referenced by Xoops\Form\Select\render().

Here is the caller graph for this function:

Xoops\Form\Select::getOptions (   $encode = false)

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
boolean$encodeencode special characters, potential values: 0 - skip 1 - only for value 2 - for both value and name
Returns
array Associative array of value->name pairs

Definition at line 164 of file Select.php.

References $name, Xoops\Form\Select\$options, and Xoops\Form\Select\$value.

Referenced by Xoops\Form\Select\render().

Here is the caller graph for this function:

Xoops\Form\Select::getSize ( )

Get the size

Returns
int

Definition at line 100 of file Select.php.

References Xoops\Html\Attributes\getAttribute().

Here is the call graph for this function:

Xoops\Form\Select::isMultiple ( )

Are multiple selections allowed?

Returns
bool

Definition at line 90 of file Select.php.

References Xoops\Html\Attributes\hasAttribute().

Here is the call graph for this function:

Xoops\Form\Select::render ( )
Xoops\Form\Select::renderValidationJS ( )

Render custom javascript validation code

Returns
string

Definition at line 235 of file Select.php.

References XoopsLocaleEn_US\F_ENTER, Xoops\Form\Element\getCaption(), Xoops\Form\Element\getName(), and Xoops\Form\Element\isRequired().

Here is the call graph for this function:

Member Data Documentation

Xoops\Form\Select::$optgroup = array()
private

Definition at line 61 of file Select.php.

Referenced by Xoops\Form\Select\addOptgroup(), and Xoops\Form\Select\getOptgroup().

Xoops\Form\Select::$options = array()
private

Definition at line 33 of file Select.php.

Referenced by Xoops\Form\Select\addOptionArray(), and Xoops\Form\Select\getOptions().


The documentation for this class was generated from the following file: