silverorange Code


Swat.SwatChangeOrder
/Swat/SwatChangeOrder.php at line 23

Class SwatChangeOrder

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

public class SwatChangeOrder
extends SwatOptionControl

An element ordering widget

This widget uses JavaScript to present an orderable list of elements. The ordering of elements is what this widget returns.

If two options are added to this control with equivalent values the returned order of the two options is arbitrary.

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

Field Summary
string

$height

Height of the order box (in stylesheet units).

array

$values

Value ordered array.

string

$width

Width of the order box (in stylesheet units).

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

SwatChangeOrder(string id)

Creates a new change-order widget.

Method Summary
void

display()

Displays this change-order control.

private void

displayButtons()

protected array

getCSSClassNames()

Gets the array of CSS classes that are applied to this change-order widget.

protected string

getInlineJavaScript()

Gets the inline JavaScript required by this change-order control.

SwatMessage

getNote()

Gets a note letting the user know drag-and-drop is available for ordering items.

array

getOrderedOptions()

Gets the options of this change-order control ordered by the values of this change-order.

void

getState()

void

process()

Processes this widget.

void

setState(mixed state)

Methods inherited from Swat.SwatOptionControl
addOption, addOptionsByArray, getOption, getOptions, getOptionsByValue, removeOption, removeOptionsByValue
Methods inherited from Swat.SwatInputControl
getForm, getValidationMessage, 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/SwatChangeOrder.php at line 49

height

public string $height = '180px'

Height of the order box (in stylesheet units)


/Swat/SwatChangeOrder.php at line 35

values

public array $values = null

Value ordered array

The current ordering of options in the widget. If null, options are displayed in the order of the options array.


/Swat/SwatChangeOrder.php at line 42

width

public string $width = '300px'

Width of the order box (in stylesheet units)


Constructor Detail

/Swat/SwatChangeOrder.php at line 61

SwatChangeOrder

public SwatChangeOrder(string id)

Creates a new change-order widget

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

Method Detail

/Swat/SwatChangeOrder.php at line 85

display

public void display()

Displays this change-order control


/Swat/SwatChangeOrder.php at line 271

displayButtons

private void displayButtons()

/Swat/SwatChangeOrder.php at line 243

getCSSClassNames

protected array getCSSClassNames()

Gets the array of CSS classes that are applied to this change-order widget

Returns:
the array of CSS classes that are applied to this change-order widget.
See Also:
SwatUIObject::getCSSClassString()

/Swat/SwatChangeOrder.php at line 260

getInlineJavaScript

protected string getInlineJavaScript()

Gets the inline JavaScript required by this change-order control

Returns:
the inline JavaScript required by this change-order control.

/Swat/SwatChangeOrder.php at line 167

getNote

public SwatMessage getNote()

Gets a note letting the user know drag-and-drop is available for ordering items

Returns:
a note letting the user know drag-and-drop is available for ordering items.
See Also:
SwatControl::getNote()

/Swat/SwatChangeOrder.php at line 207

getOrderedOptions

public array getOrderedOptions()

Gets the options of this change-order control ordered by the values of this change-order

If this control has two or more equivalent values, the order of options having those values is arbitrary.

Returns:
the options of this change-order control ordered by the values of this change-order.

/Swat/SwatChangeOrder.php at line 178

getState

public void getState()

/Swat/SwatChangeOrder.php at line 141

process

public void process()

Processes this widget

After a form submit, this widget processes itself and its dependencies and then recursively processes any of its child widgets.

Composite widgets of this widget are automatically processed as well.

If this widget has not been initialized, it is automatically initialized before processing.


/Swat/SwatChangeOrder.php at line 189

setState

public void setState(mixed state)

silverorange Code