CWIS Developer Documentation
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
TransportControlsUI_Base Class Reference

Class to provide support for transport controls (used for paging back and forth through a list) in the user interface. More...

Inheritance diagram for TransportControlsUI_Base:
Inheritance graph
[legend]

Public Member Functions

 __construct ($ItemTypes, $ItemsPerPage)
 Class constructor. More...
 
 ItemCount ($ItemCounts=NULL)
 Get/set count of items in search results. More...
 
 StartingIndex ($NewValue=NULL)
 Get/set current starting index values. More...
 
 SortField ($NewValue=NULL)
 Get/set ID of field(s) currently used for sorting. More...
 
 ActiveTab ($NewValue=NULL)
 Get/set the active tab value (usually an item type). More...
 
 ReverseSortFlag ($NewValue=NULL)
 Get/set whether to reverse the sort order from normal. More...
 
 UrlParameterString ($EncodeSeparators=TRUE, $ExcludeParameters=NULL)
 Get string containing URL parameters, ready for inclusion in URL. More...
 
 ItemTypeNames ($Names=NULL)
 Get/set printable names for item types. More...
 
 SetItemType ($ItemType)
 Set current item type for Show or Link methods. More...
 
 SetBaseLink ($BaseLink)
 Set current base link for Link methods. More...
 
 ShowAnyForwardButtons ()
 Report whether any forward buttons should be displayed. More...
 
 ShowAnyReverseButtons ()
 Report whether any reverse buttons should be displayed. More...
 
 ShowForwardButton ()
 Report whether forward button should be displayed. More...
 
 ShowReverseButton ()
 Report whether reverse button should be displayed. More...
 
 ShowFastForwardButton ()
 Report whether fast forward button should be displayed. More...
 
 ShowFastReverseButton ()
 Report whether fast reverse button should be displayed. More...
 
 ForwardLink ()
 Get link for forward button. More...
 
 ReverseLink ()
 Get link for reverse button. More...
 
 FastForwardLink ()
 Get link for fast forward button. More...
 
 FastReverseLink ()
 Get link for fast reverse button. More...
 
 GoToEndLink ()
 Get link for button to go to end. More...
 
 GoToStartLink ()
 Get link for button to go to start. More...
 

Static Public Member Functions

static DefaultSortField ($NewValue=NULL)
 Get/set default sort field value. More...
 
static DefaultActiveTab ($NewValue=NULL)
 Get/set the default active tab value (usually an item type). More...
 

Public Attributes

const NO_ITEM_TYPE = PHP_INT_MAX
 Constant to use when no item types available. More...
 

Protected Member Functions

 FastDistance ()
 Get distance to jump for fast forward/reverse. More...
 
 GetLinkWithStartingIndex ($StartingIndex)
 Generate link with specified modified starting index. More...
 
 IsValidField ($Field, $ItemType)
 Check whether specified field looks valid for specified item type. More...
 

Protected Attributes

 $ActiveTab
 
 $CurrentBaseLink
 
 $CurrentItemType
 
 $ItemCounts
 
 $ItemsPerPage
 
 $ItemTypeNames
 
 $ItemTypes
 
 $LastPageStartIndexes
 
 $ReverseSortFlags
 
 $SortFields
 
 $StartingIndexes
 

Static Protected Attributes

static $DefaultActiveTab = MetadataSchema::SCHEMAID_DEFAULT
 
static $DefaultSortField = "R"
 

Detailed Description

Class to provide support for transport controls (used for paging back and forth through a list) in the user interface.

This is an abstract base class, that provides everything but the constants defining the $_GET variable names for values and the method that actually prints the HTML for the controls. The intent is to provide the ability to customize that HTML by replacing just the child class in a different (custom, active) interface.

Definition at line 18 of file TransportControlsUI_Base.php.

Constructor & Destructor Documentation

TransportControlsUI_Base::__construct (   $ItemTypes,
  $ItemsPerPage 
)

Class constructor.

Retrieves values for starting index, sort field, and reverse sort order from $_GET using the indexes "SI", "SF", and "RS", respectively (indexes defined in TransportControlsUI class).

Parameters
mixed$ItemTypesItem type or array of item types.
mixed$ItemsPerPageNumber of items displayed per page or array of number of items displayed per page, indexed by item type. If an array, there must be an entry for every item type present in $ItemCounts.

Definition at line 35 of file TransportControlsUI_Base.php.

References $ItemsPerPage, $ItemTypes, ActiveTab(), ReverseSortFlag(), SortField(), and StartingIndex().

Member Function Documentation

TransportControlsUI_Base::ActiveTab (   $NewValue = NULL)

Get/set the active tab value (usually an item type).

This can be used to override the value obtained from $_GET (if any).

Parameters
int$NewValueNew active tab. (OPTIONAL)
Returns
int Current active tab.

Definition at line 291 of file TransportControlsUI_Base.php.

Referenced by __construct(), ItemCount(), and UrlParameterString().

Here is the caller graph for this function:

static TransportControlsUI_Base::DefaultActiveTab (   $NewValue = NULL)
static

Get/set the default active tab value (usually an item type).

Parameters
int$NewValueNew default active tab. (OPTIONAL)
Returns
int Current default active tab.

Definition at line 307 of file TransportControlsUI_Base.php.

static TransportControlsUI_Base::DefaultSortField (   $NewValue = NULL)
static

Get/set default sort field value.

Parameters
mixed$NewValueNew default sort field.
Returns
mixed Current default sort field.

Definition at line 276 of file TransportControlsUI_Base.php.

Referenced by ItemListUI\__construct().

Here is the caller graph for this function:

TransportControlsUI_Base::FastDistance ( )
protected

Get distance to jump for fast forward/reverse.

Returns
int Number of items to jump.

Definition at line 667 of file TransportControlsUI_Base.php.

References $CurrentItemType.

Referenced by FastForwardLink(), FastReverseLink(), ShowFastForwardButton(), and ShowFastReverseButton().

Here is the caller graph for this function:

TransportControlsUI_Base::FastForwardLink ( )

Get link for fast forward button.

Returns
string Link URL.

Definition at line 607 of file TransportControlsUI_Base.php.

References FastDistance(), and GetLinkWithStartingIndex().

TransportControlsUI_Base::FastReverseLink ( )

Get link for fast reverse button.

Returns
string Link URL.

Definition at line 619 of file TransportControlsUI_Base.php.

References FastDistance(), and GetLinkWithStartingIndex().

TransportControlsUI_Base::ForwardLink ( )

Get link for forward button.

Returns
string Link URL.

Definition at line 584 of file TransportControlsUI_Base.php.

References GetLinkWithStartingIndex().

TransportControlsUI_Base::GetLinkWithStartingIndex (   $StartingIndex)
protected

Generate link with specified modified starting index.

Parameters
int$StartingIndexIndex to use for current item type.
Returns
string Generated link.

Definition at line 679 of file TransportControlsUI_Base.php.

References $CurrentItemType.

Referenced by FastForwardLink(), FastReverseLink(), ForwardLink(), GoToEndLink(), GoToStartLink(), and ReverseLink().

Here is the caller graph for this function:

TransportControlsUI_Base::GoToEndLink ( )

Get link for button to go to end.

Returns
string Link URL.

Definition at line 630 of file TransportControlsUI_Base.php.

References GetLinkWithStartingIndex().

TransportControlsUI_Base::GoToStartLink ( )

Get link for button to go to start.

Returns
string Link URL.

Definition at line 640 of file TransportControlsUI_Base.php.

References GetLinkWithStartingIndex().

TransportControlsUI_Base::IsValidField (   $Field,
  $ItemType 
)
protected

Check whether specified field looks valid for specified item type.

Parameters
int$FieldField to check.
int$ItemTypeType of item to check against.
Returns
bool TRUE if field looks valid, otherwise FALSE.

Definition at line 701 of file TransportControlsUI_Base.php.

Referenced by SortField().

Here is the caller graph for this function:

TransportControlsUI_Base::ItemCount (   $ItemCounts = NULL)

Get/set count of items in search results.

Parameters
mixed$ItemCountsCount of total items, array of counts of total items (indexed by item type), or array of arrays of items (top level indexed by item type). If an array of arrays (like search results) is passed in, counts will be taken from the size of the inner arrays. (OPTIONAL)
Returns
Current item count when no types are in use or array of item counts indexed by type when they are.

Definition at line 87 of file TransportControlsUI_Base.php.

References $ItemCounts, and ActiveTab().

TransportControlsUI_Base::ItemTypeNames (   $Names = NULL)

Get/set printable names for item types.

If item type names are supplied, they will be used in the title attributes for the transport control buttons. (This can help with accessibility.)

Parameters
array$NamesItem type names, indexed by item type IDs. (OPTIONAL)
Returns
array Current item type names, indexed by item type ID.

Definition at line 464 of file TransportControlsUI_Base.php.

References $ItemTypeNames.

Referenced by TransportControlsUI\PrintControls().

Here is the caller graph for this function:

TransportControlsUI_Base::ReverseLink ( )

Get link for reverse button.

Returns
string Link URL.

Definition at line 596 of file TransportControlsUI_Base.php.

References GetLinkWithStartingIndex().

TransportControlsUI_Base::ReverseSortFlag (   $NewValue = NULL)

Get/set whether to reverse the sort order from normal.

If new values are supplied, they will replace all current values, resetting any values not supplied back to the default.

Parameters
mixed$NewValueNew value or array of values (indexed by item type).
Returns
mixed TRUE to reverse sort order or FALSE to use normal order for field. A single value is passed back when a single value was passed into the constructor for item types.

Definition at line 325 of file TransportControlsUI_Base.php.

Referenced by __construct().

Here is the caller graph for this function:

TransportControlsUI_Base::SetBaseLink (   $BaseLink)

Set current base link for Link methods.

Parameters
string$BaseLinkNew base URL.

Definition at line 489 of file TransportControlsUI_Base.php.

Referenced by TransportControlsUI\PrintControls().

Here is the caller graph for this function:

TransportControlsUI_Base::SetItemType (   $ItemType)

Set current item type for Show or Link methods.

Parameters
int$ItemTypeItem type for operations.

Definition at line 480 of file TransportControlsUI_Base.php.

Referenced by TransportControlsUI\PrintControls().

Here is the caller graph for this function:

TransportControlsUI_Base::ShowAnyForwardButtons ( )

Report whether any forward buttons should be displayed.

The item type must be set via SetItemType() before using this.

Returns
bool TRUE if at least one forward button should be displayed, otherwise FALSE.
See also
SetItemType()

Definition at line 501 of file TransportControlsUI_Base.php.

Referenced by TransportControlsUI\PrintControls().

Here is the caller graph for this function:

TransportControlsUI_Base::ShowAnyReverseButtons ( )

Report whether any reverse buttons should be displayed.

The item type must be set via SetItemType() before using this.

Returns
bool TRUE if at least one reverse button should be displayed, otherwise FALSE.
See also
SetItemType()

Definition at line 516 of file TransportControlsUI_Base.php.

Referenced by TransportControlsUI\PrintControls().

Here is the caller graph for this function:

TransportControlsUI_Base::ShowFastForwardButton ( )

Report whether fast forward button should be displayed.

The item type must be set via SetItemType() before using this.

Returns
bool TRUE if fast forward button should be displayed, otherwise FALSE.
See also
SetItemType()

Definition at line 556 of file TransportControlsUI_Base.php.

References FastDistance().

Referenced by TransportControlsUI\PrintControls().

Here is the caller graph for this function:

TransportControlsUI_Base::ShowFastReverseButton ( )

Report whether fast reverse button should be displayed.

The item type must be set via SetItemType() before using this.

Returns
bool TRUE if fast reverse button should be displayed, otherwise FALSE.
See also
SetItemType()

Definition at line 572 of file TransportControlsUI_Base.php.

References FastDistance().

Referenced by TransportControlsUI\PrintControls().

Here is the caller graph for this function:

TransportControlsUI_Base::ShowForwardButton ( )

Report whether forward button should be displayed.

The item type must be set via SetItemType() before using this.

Returns
bool TRUE if forward button should be displayed, otherwise FALSE.
See also
SetItemType()

Definition at line 528 of file TransportControlsUI_Base.php.

Referenced by TransportControlsUI\PrintControls().

Here is the caller graph for this function:

TransportControlsUI_Base::ShowReverseButton ( )

Report whether reverse button should be displayed.

The item type must be set via SetItemType() before using this.

Returns
bool TRUE if reverse button should be displayed, otherwise FALSE.
See also
SetItemType()

Definition at line 542 of file TransportControlsUI_Base.php.

Referenced by TransportControlsUI\PrintControls().

Here is the caller graph for this function:

TransportControlsUI_Base::SortField (   $NewValue = NULL)

Get/set ID of field(s) currently used for sorting.

If new value(s) are supplied, they will replace all current values, resetting any values not supplied back to the default.

Parameters
mixed$NewValueField ID or array of field IDs (indexed by item type).
Returns
mixed Sort field ID or array of IDs with item types for the indexes. A single ID is passed back when a single value was passed into the constructor for item types.

Definition at line 220 of file TransportControlsUI_Base.php.

References IsValidField().

Referenced by __construct().

Here is the caller graph for this function:

TransportControlsUI_Base::StartingIndex (   $NewValue = NULL)

Get/set current starting index values.

If new value(s) are supplied, they will replace all current values, resetting any values not supplied back to the default.

Parameters
mixed$NewValueNew starting index value or array of index values with item types for indexes. (OPTIONAL)
Returns
mixed Starting index value or array of values with item types for the indexes. A single value is passed back when a single value was passed into the constructor for item types.

Definition at line 168 of file TransportControlsUI_Base.php.

Referenced by __construct().

Here is the caller graph for this function:

TransportControlsUI_Base::UrlParameterString (   $EncodeSeparators = TRUE,
  $ExcludeParameters = NULL 
)

Get string containing URL parameters, ready for inclusion in URL.

Parameters
bool$EncodeSeparatorsIf TRUE, "&" is used to separate arguments, otherwise "&" is used. (OPTIONAL, defaults to TRUE)
array$ExcludeParametersArray with one or more parameters to exclude from the parameter string. (OPTIONAL)
Returns
string URL parameter string, with leading "&" if parameters are included.

Definition at line 377 of file TransportControlsUI_Base.php.

References $ActiveTab, and ActiveTab().

Member Data Documentation

TransportControlsUI_Base::$ActiveTab
protected

Definition at line 648 of file TransportControlsUI_Base.php.

Referenced by UrlParameterString().

TransportControlsUI_Base::$CurrentBaseLink
protected

Definition at line 649 of file TransportControlsUI_Base.php.

TransportControlsUI_Base::$CurrentItemType
protected

Definition at line 650 of file TransportControlsUI_Base.php.

Referenced by FastDistance(), and GetLinkWithStartingIndex().

TransportControlsUI_Base::$DefaultActiveTab = MetadataSchema::SCHEMAID_DEFAULT
staticprotected

Definition at line 660 of file TransportControlsUI_Base.php.

TransportControlsUI_Base::$DefaultSortField = "R"
staticprotected

Definition at line 661 of file TransportControlsUI_Base.php.

TransportControlsUI_Base::$ItemCounts
protected

Definition at line 651 of file TransportControlsUI_Base.php.

Referenced by ItemCount().

TransportControlsUI_Base::$ItemsPerPage
protected

Definition at line 652 of file TransportControlsUI_Base.php.

Referenced by __construct().

TransportControlsUI_Base::$ItemTypeNames
protected

Definition at line 653 of file TransportControlsUI_Base.php.

Referenced by ItemTypeNames().

TransportControlsUI_Base::$ItemTypes
protected

Definition at line 654 of file TransportControlsUI_Base.php.

Referenced by __construct().

TransportControlsUI_Base::$LastPageStartIndexes
protected

Definition at line 655 of file TransportControlsUI_Base.php.

TransportControlsUI_Base::$ReverseSortFlags
protected

Definition at line 656 of file TransportControlsUI_Base.php.

TransportControlsUI_Base::$SortFields
protected

Definition at line 657 of file TransportControlsUI_Base.php.

TransportControlsUI_Base::$StartingIndexes
protected

Definition at line 658 of file TransportControlsUI_Base.php.

const TransportControlsUI_Base::NO_ITEM_TYPE = PHP_INT_MAX

Constant to use when no item types available.

Definition at line 23 of file TransportControlsUI_Base.php.

Referenced by ItemListUI\__construct(), and ItemListUI\Display().


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