HTML_QuickForm_advmultiselect
[ class tree: HTML_QuickForm_advmultiselect ] [ index: HTML_QuickForm_advmultiselect ] [ all elements ]

Class: HTML_QuickForm_advmultiselect

Source Location: /HTML_QuickForm_advmultiselect-1.5.1/advmultiselect.php

Class Overview

HTML_QuickForm_select
   |
   --HTML_QuickForm_advmultiselect

Element for HTML_QuickForm that emulate a multi-select.


Author(s):

Version:

  • Release: @package_version@

Copyright:

  • 2005-2009 Laurent Laville

Methods


Inherited Variables

Inherited Methods


Class Details

[line 70]
Element for HTML_QuickForm that emulate a multi-select.

The HTML_QuickForm_advmultiselect package adds an element to the HTML_QuickForm package that is two select boxes next to each other emulating a multi-select.



[ Top ]


Method Detail

HTML_QuickForm_advmultiselect (Constructor)   [line 275]

void HTML_QuickForm_advmultiselect( [string $elementName = null], [mixed $elementLabel = null], [mixed $options = null], [mixed $attributes = null], [integer $sort = null])

Class constructor

Class constructors : Zend Engine 1 uses HTML_QuickForm_advmultiselect, while Zend Engine 2 uses __construct

  • Since: version 0.4.0 (2005-06-25)
  • Access: public

Parameters:

string   $elementName     Dual Select name attribute
mixed   $elementLabel     Label(s) for the select boxes
mixed   $options     Data to be used to populate options
mixed   $attributes     Either a typical HTML attribute string or an associative array
integer   $sort     Either SORT_ASC for auto ascending arrange, SORT_DESC for auto descending arrange, or NULL for no sort (append at end: default)

[ Top ]

getElementCss   [line 566]

string getElementCss( [boolean $raw = true])

Gets default element stylesheet for a single multi-select shape render

In custom example 4, the template defined allows a single multi-select checkboxes shape. Useful when javascript is disabled (or when browser is not js compliant). In our example, no need to add javascript code, but css is mandatory.


Parameters:

boolean   $raw     (optional) html output with style tags or just raw data

[ Top ]

getElementJs   [line 1011]

string getElementJs( [boolean $raw = true], [boolean $min = false])

Returns the javascript code generated to handle this element
  • Since: version 0.4.0 (2005-06-25)
  • Access: public

Parameters:

boolean   $raw     (optional) html output with script tags or just raw data
boolean   $min     (optional) uses javascript compressed version

[ Top ]

getPersistantOptions   [line 1160]

array getPersistantOptions( )

Returns list of persistant options

Returns list of persistant options (key-values) that could not be selected or unselected.

  • Since: version 1.5.0 (2009-02-15)
  • Access: public

[ Top ]

load   [line 1057]

PEAR_Error|NULL load( mixed &$options, [mixed $param1 = null], [mixed $param2 = null], [mixed $param3 = null], [mixed $param4 = null])

Loads options from different types of data sources

This method overloaded parent method of select element, to allow loading options with fancy attributes.


Parameters:

mixed   &$options     Options source currently supports assoc array or DB_result
mixed   $param1     (optional) See function detail
mixed   $param2     (optional) See function detail
mixed   $param3     (optional) See function detail
mixed   $param4     (optional) See function detail

[ Top ]

loadArray   [line 1083]

PEAR_Error loadArray( array $arr, [mixed $values = null])

Loads the options from an associative array

This method overloaded parent method of select element, to allow to load array of options with fancy attributes.


Parameters:

array   $arr     Associative array of options
mixed   $values     (optional) Array or comma delimited string of selected values

[ Top ]

setButtonAttributes   [line 393]

void setButtonAttributes( string $button, [mixed $attributes = null])

Sets the button attributes

In custom example 1, the add and remove buttons have look set by the css class inputCommand.

In custom example 2, the basic text add and remove buttons are now replaced by images.

In custom example 5, we have ability to sort the selection list (on right side) by :

  - user-end: with Up and Down buttons
  - programming: with the QF element constructor $sort option


Parameters:

string   $button     Button identifier, either 'add', 'remove', 'all', 'none', 'toggle', 'movetop', 'movebottom' 'moveup' or 'movedown'
mixed   $attributes     (optional) Either a typical HTML attribute string or an associative array

[ Top ]

setElementTemplate   [line 520]

string setElementTemplate( [string $html = null], [string $js = true])

Sets element template
  • Since: version 0.4.0 (2005-06-25)
  • Access: public

Parameters:

string   $html     (optional) The HTML surrounding select boxes and buttons
string   $js     (optional) if we need to include qfams javascript handler

[ Top ]

setPersistantOptions   [line 1120]

PEAR_Error setPersistantOptions( mixed $optionValues, [bool $persistant = true])

Sets which items should be persistant

Sets which items should have the disabled attribute to keep it persistant

  • Return: on error and TRUE on success
  • Since: version 1.5.0 (2009-02-15)
  • Throws: PEAR_Error
  • Access: public

Parameters:

mixed   $optionValues     Options (key-values) that should be persistant
bool   $persistant     (optional) TRUE if persistant, FALSE otherwise

[ Top ]

toHtml   [line 586]

string toHtml( )

Returns the HTML generated for the advanced mutliple select component
  • Since: version 0.4.0 (2005-06-25)
  • Access: public

[ Top ]


Documentation generated on Sun, 05 Apr 2009 07:30:04 +0000 by phpDocumentor 1.4.2. PEAR Logo Copyright © PHP Group 2004.