silverorange Code


Swat.SwatCheckboxList
/Swat/SwatCheckboxList.php at line 20

Class SwatCheckboxList

SwatObject
└─SwatUIObject
└─SwatWidget
└─SwatControl
└─SwatInputControl
└─SwatOptionControl
└─SwatCheckboxList

public class SwatCheckboxList
extends SwatOptionControl

A checkbox list widget

Copyright:
2005-2008 silverorange
License:
http://www.gnu.org/copyleft/lesser.html LGPL License 2.1

Field Summary
integer or array of integers

$columns

Defines the columns in which this list is displayed.

boolean

$show_check_all

Whether to show the check all box.

array

$values

List values.

Fields inherited from Swat.SwatOptionControl
options, serialize_values
Fields inherited from Swat.SwatInputControl
required
Constructor Summary

SwatCheckboxList(string id)

Creates a new checkbox list.

Method Summary
protected void

createCompositeWidgets()

Creates and adds composite widgets of this widget.

void

display()

Displays this checkbox list.

protected void

displayOption(SwatOption option, integer index)

Helper method to display a single option of this checkbox list.

protected array

getCSSClassNames()

Gets the array of CSS classes that are applied to this checkbox list.

protected string

getInlineJavaScript()

Gets the inline JavaScript for this checkbox list.

protected void

getLiTag(mixed option)

array

getState()

Gets the current state of this checkbox list.

void

init()

Initializes this checkbox list.

void

process()

Processes this checkbox list widget.

protected void

processValues()

Processes the values of this checkbox list from raw form data.

void

reset()

Reset this checkbox list.

void

setState(array state)

Sets the current state of this checkbox list.

Methods inherited from Swat.SwatOptionControl
addOption, addOptionsByArray, getOption, getOptions, getOptionsByValue, removeOption, removeOptionsByValue
Methods inherited from Swat.SwatInputControl
getForm, init
Methods inherited from Swat.SwatControl
addMessage, getNote, printWidgetTree
Methods inherited from Swat.SwatWidget
addCompositeWidget, addMessage, confirmCompositeWidgets, copy, createCompositeWidgets, display, displayHtmlHeadEntries, getCSSClassNames, getCompositeWidget, getCompositeWidgets, getFocusableHtmlId, getHtmlHeadEntrySet, getMessages, hasMessage, init, isDisplayed, isInitialized, isProcessed, isSensitive, printWidgetTree, process, replaceWithContainer
Methods inherited from Swat.SwatUIObject
addComment, addJavaScript, addStyleSheet, addTangoAttribution, copy, getCSSClassNames, getCSSClassString, getFirstAncestor, getHtmlHeadEntrySet, getInlineJavaScript, getUniqueId, isVisible

Field Detail

/Swat/SwatCheckboxList.php at line 53

columns

public integer or array of integers $columns = 1

Defines the columns in which this list is displayed

If unspecified, the list will be displayed in one column.

Each column is displayed using a separate XHTML unordered list (<ul>). If the value is an integer it specifies the number of columns to display. If the value is an array of integers it specifies the number of checkboxes to display in each column.


/Swat/SwatCheckboxList.php at line 38

show_check_all

public boolean $show_check_all = true

Whether to show the check all box


/Swat/SwatCheckboxList.php at line 31

values

public array $values = array()

List values

The values of the selected items.


Constructor Detail

/Swat/SwatCheckboxList.php at line 65

SwatCheckboxList

public SwatCheckboxList(string id)

Creates a new checkbox list

Parameters:
id - a non-visible unique id for this widget.
See Also:
SwatWidget::__construct()

Method Detail

/Swat/SwatCheckboxList.php at line 371

createCompositeWidgets

protected void createCompositeWidgets()

Creates and adds composite widgets of this widget

Created composite widgets should be added in this method using SwatWidget::addCompositeWidget().


/Swat/SwatCheckboxList.php at line 111

display

public void display()

Displays this checkbox list

The check-all widget is only displayed if more than one checkable item is displayed.


/Swat/SwatCheckboxList.php at line 286

displayOption

protected void displayOption(SwatOption option, integer index)

Helper method to display a single option of this checkbox list

Parameters:
option - the option to display.
index - a numeric index indicating which option is being displayed.

/Swat/SwatCheckboxList.php at line 355

getCSSClassNames

protected array getCSSClassNames()

Gets the array of CSS classes that are applied to this checkbox list

Returns:
the array of CSS classes that are applied to this checkbox list.
See Also:
SwatUIObject::getCSSClassString()

/Swat/SwatCheckboxList.php at line 332

getInlineJavaScript

protected string getInlineJavaScript()

Gets the inline JavaScript for this checkbox list

Returns:
the inline JavaScript for this checkbox list.

/Swat/SwatCheckboxList.php at line 317

getLiTag

protected void getLiTag(mixed option)

/Swat/SwatCheckboxList.php at line 247

getState

public array getState()

Gets the current state of this checkbox list

Returns:
the current state of this checkbox list.
See Also:
SwatState::getState()

/Swat/SwatCheckboxList.php at line 86

init

public void init()

Initializes this checkbox list

Throws:
if there are duplicate values in the options array
See Also:
SwatWidget::init()

/Swat/SwatCheckboxList.php at line 196

process

public void process()

Processes this checkbox list widget


/Swat/SwatCheckboxList.php at line 258

processValues

protected void processValues()

Processes the values of this checkbox list from raw form data


/Swat/SwatCheckboxList.php at line 217

reset

public void reset()

Reset this checkbox list.

Reset the list to its default state. This is useful to call from a display() method when persistence is not desired.


/Swat/SwatCheckboxList.php at line 232

setState

public void setState(array state)

Sets the current state of this checkbox list

Parameters:
state - the new state of this checkbox list.
See Also:
SwatState::setState()

silverorange Code