XOOPS 2.5.6  Final
 All Classes Namespaces Files Functions Variables Pages
XoopsFormSelect Class Reference
Inheritance diagram for XoopsFormSelect:
Inheritance graph

Public Member Functions

 addOption ($value, $name= '')
 
 addOptionArray ($options)
 
 getOptions ($encode=false)
 
 getSize ()
 
 getValue ($encode=false)
 
 isMultiple ()
 
 render ()
 
 renderValidationJS ()
 
 setValue ($value)
 
 XoopsFormSelect ($caption, $name, $value=null, $size=1, $multiple=false)
 
- Public Member Functions inherited from XoopsFormElement
 getAccessKey ()
 
 getAccessString ($str)
 
 getCaption ($encode=false)
 
 getClass ()
 
 getDescription ($encode=false)
 
 getExtra ($encode=false)
 
 getFormType ()
 
 getName ($encode=true)
 
 getNocolspan ()
 
 getTitle ($encode=true)
 
 isContainer ()
 
 isHidden ()
 
 isRequired ()
 
 render ()
 
 renderValidationJS ()
 
 setAccessKey ($key)
 
 setCaption ($caption)
 
 setClass ($class)
 
 setDescription ($description)
 
 setExtra ($extra, $replace=false)
 
 setFormType ($value= '')
 
 setHidden ()
 
 setName ($name)
 
 setNocolspan ($nocolspan=true)
 
 XoopsFormElement ()
 

Public Attributes

 $_multiple = false
 
 $_options = array()
 
 $_size
 
 $_value = array()
 
- Public Attributes inherited from XoopsFormElement
 $_accesskey = ''
 
 $_caption
 
 $_class = array()
 
 $_description = ''
 
 $_extra = array()
 
 $_formtype = ''
 
 $_hidden = false
 
 $_name
 
 $_nocolspan = false
 
 $_required = false
 
 $customValidationCode = array()
 

Detailed Description

Definition at line 36 of file formselect.php.

Member Function Documentation

XoopsFormSelect::addOption (   $value,
  $name = '' 
)

Add an option

Parameters
string$value"value" attribute
string$name"name" attribute

Definition at line 150 of file formselect.php.

Referenced by profile_getFieldForm().

Here is the caller graph for this function:

XoopsFormSelect::addOptionArray (   $options)

Add multiple options

Parameters
array$optionsAssociative array of value->name pairs

Definition at line 164 of file formselect.php.

References $options.

Referenced by profile_getFieldForm().

Here is the caller graph for this function:

XoopsFormSelect::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
int$encodeTo sanitizer the text? 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 181 of file formselect.php.

XoopsFormSelect::getSize ( )

Get the size

Returns
int

Definition at line 105 of file formselect.php.

XoopsFormSelect::getValue (   $encode = false)

Get an array of pre-selected values

Parameters
bool$encodeTo sanitizer the text?
Returns
array

Definition at line 116 of file formselect.php.

XoopsFormSelect::isMultiple ( )

Are multiple selections allowed?

Returns
bool

Definition at line 95 of file formselect.php.

XoopsFormSelect::render ( )

Prepare HTML for output

Returns
string HTML

Definition at line 198 of file formselect.php.

References $ret.

XoopsFormSelect::renderValidationJS ( )

Render custom javascript validation code

XoopsForm::renderValidationJS

Definition at line 226 of file formselect.php.

References _FORM_ENTER.

XoopsFormSelect::setValue (   $value)

Set pre-selected values

Parameters
$valuemixed

Definition at line 133 of file formselect.php.

XoopsFormSelect::XoopsFormSelect (   $caption,
  $name,
  $value = null,
  $size = 1,
  $multiple = false 
)

Constructor

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

Definition at line 79 of file formselect.php.

Member Data Documentation

XoopsFormSelect::$_multiple = false

Definition at line 52 of file formselect.php.

XoopsFormSelect::$_options = array()

Definition at line 44 of file formselect.php.

XoopsFormSelect::$_size

Definition at line 60 of file formselect.php.

XoopsFormSelect::$_value = array()

Definition at line 68 of file formselect.php.


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