silverorange Code


Swat.SwatTimeZoneEntry
/Swat/SwatTimeZoneEntry.php at line 18

Class SwatTimeZoneEntry

SwatObject
└─SwatUIObject
└─SwatWidget
└─SwatControl
└─SwatInputControl
└─SwatTimeZoneEntry
All Implemented Interfaces:
SwatState

public class SwatTimeZoneEntry
extends SwatInputControl

A time-zone selection widget

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

Field Summary
string

$value

Time-zone identifier.

Fields inherited from Swat.SwatInputControl
required
Constructor Summary

SwatTimeZoneEntry(string id)

Creates a new time-zone selector widget.

Method Summary
protected void

createCompositeWidgets()

Creates all internal widgets required for this time-zone entry.

void

display()

Displays this time-zone entry widget.

private string

getArea(string time_zone)

Gets an area from a time-zone identifier.

protected array

getCSSClassNames()

Gets the array of CSS classes that are applied to this time zone entry widget.

private string

getRegion(string time_zone)

Gets a region from a time-zone identifier.

private string

getRegionTitle(string region)

Gets a formatted region title from the region part of a time-zone identifier.

string

getState()

Gets the current state of this time-zone entry widget.

private array

parseAreaWhitelist(array area_whitelist)

Parses a whitelist of valid areas.

void

process()

Processes this time-zone entry widget.

private void

setAreas(array time_zone_list)

Sets areas.

private void

setRegions(array regions, string area)

Builds the internal array of SwatOptions for the specified regions.

void

setState(string state)

Sets the current state of this time-zone entry widget.

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/SwatTimeZoneEntry.php at line 29

value

public string $value = null

Time-zone identifier

The id of the selected time-zone.


Constructor Detail

/Swat/SwatTimeZoneEntry.php at line 62

SwatTimeZoneEntry

public SwatTimeZoneEntry(string id)

Creates a new time-zone selector widget

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

Method Detail

/Swat/SwatTimeZoneEntry.php at line 197

createCompositeWidgets

protected void createCompositeWidgets()

Creates all internal widgets required for this time-zone entry


/Swat/SwatTimeZoneEntry.php at line 82

display

public void display()

Displays this time-zone entry widget

Outputs a cascading list of time-zones.


/Swat/SwatTimeZoneEntry.php at line 319

getArea

private string getArea(string time_zone)

Gets an area from a time-zone identifier

Returns the area part of a full time-zone.

Parameters:
time_zone - the time-zone identifier to get the area from.
Returns:
an area name.

/Swat/SwatTimeZoneEntry.php at line 184

getCSSClassNames

protected array getCSSClassNames()

Gets the array of CSS classes that are applied to this time zone entry widget

Returns:
the array of CSS classes that are applied to this time zone entry widget.
See Also:
SwatUIObject::getCSSClassString()

/Swat/SwatTimeZoneEntry.php at line 343

getRegion

private string getRegion(string time_zone)

Gets a region from a time-zone identifier

Parameters:
time_zone - the time-zone identifier from which to get the region.
Returns:
the region part of a full time-zone indentifier.

/Swat/SwatTimeZoneEntry.php at line 367

getRegionTitle

private string getRegionTitle(string region)

Gets a formatted region title from the region part of a time-zone identifier

Parameters:
region - the region part of the time-zone identifier.
Returns:
the formatted region title.

/Swat/SwatTimeZoneEntry.php at line 154

getState

public string getState()

Gets the current state of this time-zone entry widget

Returns:
the current state of this time-zone entry widget.
See Also:
SwatState::getState()

/Swat/SwatTimeZoneEntry.php at line 227

parseAreaWhitelist

private array parseAreaWhitelist(array area_whitelist)

Parses a whitelist of valid areas

Filters the full list of areas down to a select list and returns a tree-structured array of areas, regions, and subregions.

Parameters:
area_whitelist - an array of valid area names.
Returns:
a tree-structured array of areas regions and subregions inside the specified whitelist of areas.

/Swat/SwatTimeZoneEntry.php at line 116

process

public void process()

Processes this time-zone entry widget

If any validation type errors occur, an error message is attached to this entry widget.


/Swat/SwatTimeZoneEntry.php at line 259

setAreas

private void setAreas(array time_zone_list)

Sets areas

Builds the class variable array $areas.

Parameters:
time_zone_list - a tree structured array of areas and regions.

/Swat/SwatTimeZoneEntry.php at line 286

setRegions

private void setRegions(array regions, string area)

Builds the internal array of SwatOptions for the specified regions

Parameters:
regions - an array of regions.
area - the region's area.

/Swat/SwatTimeZoneEntry.php at line 169

setState

public void setState(string state)

Sets the current state of this time-zone entry widget

Parameters:
state - the new state of this time-zone entry widget.
See Also:
SwatState::setState()

silverorange Code