CWIS Developer Documentation

- Home
- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

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:
[legend]

## Public Member Functions
| __construct ($ItemTypes, $ItemsPerPage=10)
| Class constructor. More...
| ItemsPerPage ($NewValue=NULL)
| Get/set maximum number of items per page. 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 = `10`
| ) |  |

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 | $ItemTypes | Item type or array of item types.
  mixed | $ItemsPerPage | Number 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. (OPTIONAL, defaults to 10)

Definition at line 35 of file TransportControlsUI_Base.php.

References $ItemsPerPage, $ItemTypes, ActiveTab(), ItemsPerPage(), 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 | $NewValue | New active tab. (OPTIONAL)

Returns
  int Current active tab.

Definition at line 317 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 | $NewValue | New default active tab. (OPTIONAL)

Returns
  int Current default active tab.

Definition at line 333 of file TransportControlsUI_Base.php.

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

Get/set default sort field value.

Parameters

  mixed | $NewValue | New default sort field.

Returns
  mixed Current default sort field.

Definition at line 302 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 693 of file TransportControlsUI_Base.php.

References $CurrentItemType, and ItemsPerPage().

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 633 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 645 of file TransportControlsUI_Base.php.

References FastDistance(), and GetLinkWithStartingIndex().

TransportControlsUI_Base::ForwardLink | ( |  | ) |

Get link for forward button.

Returns
  string Link URL.

Definition at line 610 of file TransportControlsUI_Base.php.

References GetLinkWithStartingIndex(), and ItemsPerPage().

TransportControlsUI_Base::GetLinkWithStartingIndex | ( |  | $StartingIndex | ) |
| protected

Generate link with specified modified starting index.

Parameters

  int | $StartingIndex | Index to use for current item type.

Returns
  string Generated link.

Definition at line 705 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 656 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 666 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 | $Field | Field to check.
  int | $ItemType | Type of item to check against.

Returns
  bool TRUE if field looks valid, otherwise FALSE.

Definition at line 727 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 | $ItemCounts | Count 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 113 of file TransportControlsUI_Base.php.

References $ItemCounts, ActiveTab(), and ItemsPerPage().

TransportControlsUI_Base::ItemsPerPage | ( |  | $NewValue = `NULL` | ) |

Get/set maximum number of items per page.

Parameters

  mixed | $NewValue | Number 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 the $ItemCounts array supplied to the constructor.

Returns
  array Current number of items per page, indexed by item type.

Exceptions

  InvalidArgumentException | If number of items per page values does not match the number of item types supplied to the constructor.

Definition at line 77 of file TransportControlsUI_Base.php.

References $ItemsPerPage.

Referenced by __construct(), FastDistance(), ForwardLink(), ItemCount(), ReverseLink(), ShowAnyForwardButtons(), ShowFastForwardButton(), ShowFastReverseButton(), ShowForwardButton(), and ShowReverseButton().

Here is the caller graph for this function:

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 | $Names | Item type names, indexed by item type IDs. (OPTIONAL)

Returns
  array Current item type names, indexed by item type ID.

Definition at line 490 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 622 of file TransportControlsUI_Base.php.

References GetLinkWithStartingIndex(), and ItemsPerPage().

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 | $NewValue | New 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 351 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 | $BaseLink | New base URL.

Definition at line 515 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 | $ItemType | Item type for operations.

Definition at line 506 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 527 of file TransportControlsUI_Base.php.

References ItemsPerPage().

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 542 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 582 of file TransportControlsUI_Base.php.

References FastDistance(), and ItemsPerPage().

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 598 of file TransportControlsUI_Base.php.

References FastDistance(), and ItemsPerPage().

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 554 of file TransportControlsUI_Base.php.

References ItemsPerPage().

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 568 of file TransportControlsUI_Base.php.

References ItemsPerPage().

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 | $NewValue | Field 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 246 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 | $NewValue | New 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 194 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 | $EncodeSeparators | If TRUE, "&amp;" is used to separate arguments, otherwise "&" is used. (OPTIONAL, defaults to TRUE)
  array | $ExcludeParameters | Array with one or more parameters to exclude from the parameter string. (OPTIONAL)

Returns
  string URL parameter string, with leading "&amp;" if parameters are included.

Definition at line 403 of file TransportControlsUI_Base.php.

References $ActiveTab, and ActiveTab().

## Member Data Documentation

TransportControlsUI_Base::$ActiveTab
| protected

Definition at line 674 of file TransportControlsUI_Base.php.

Referenced by UrlParameterString().

TransportControlsUI_Base::$CurrentBaseLink
| protected

Definition at line 675 of file TransportControlsUI_Base.php.

TransportControlsUI_Base::$CurrentItemType
| protected

Definition at line 676 of file TransportControlsUI_Base.php.

Referenced by FastDistance(), and GetLinkWithStartingIndex().

TransportControlsUI_Base::$DefaultActiveTab = MetadataSchema::SCHEMAID_DEFAULT
| static protected

Definition at line 686 of file TransportControlsUI_Base.php.

TransportControlsUI_Base::$DefaultSortField = "R"
| static protected

Definition at line 687 of file TransportControlsUI_Base.php.

TransportControlsUI_Base::$ItemCounts
| protected

Definition at line 677 of file TransportControlsUI_Base.php.

Referenced by ItemCount().

TransportControlsUI_Base::$ItemsPerPage
| protected

Definition at line 678 of file TransportControlsUI_Base.php.

Referenced by __construct(), and ItemsPerPage().

TransportControlsUI_Base::$ItemTypeNames
| protected

Definition at line 679 of file TransportControlsUI_Base.php.

Referenced by ItemTypeNames().

TransportControlsUI_Base::$ItemTypes
| protected

Definition at line 680 of file TransportControlsUI_Base.php.

Referenced by __construct().

TransportControlsUI_Base::$LastPageStartIndexes
| protected

Definition at line 681 of file TransportControlsUI_Base.php.

TransportControlsUI_Base::$ReverseSortFlags
| protected

Definition at line 682 of file TransportControlsUI_Base.php.

TransportControlsUI_Base::$SortFields
| protected

Definition at line 683 of file TransportControlsUI_Base.php.

TransportControlsUI_Base::$StartingIndexes
| protected

Definition at line 684 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:

- interface/default/objects/TransportControlsUI_Base.php