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)
| Class constructor. More...
| ItemCount ($ItemCounts)
| 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...
| 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
| $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 | $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.

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 | $NewValue | New active tab. (OPTIONAL)

Returns
  int Current active tab.

Definition at line 284 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 300 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 269 of file TransportControlsUI_Base.php.

Referenced by ItemListUI\Display().

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 643 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 584 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 596 of file TransportControlsUI_Base.php.

References FastDistance(), and GetLinkWithStartingIndex().

TransportControlsUI_Base::ForwardLink | ( |  | ) |

Get link for forward button.

Returns
  string Link URL.

Definition at line 561 of file TransportControlsUI_Base.php.

References GetLinkWithStartingIndex().

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 655 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 607 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 617 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 677 of file TransportControlsUI_Base.php.

Referenced by SortField().

Here is the caller graph for this function:

TransportControlsUI_Base::ItemCount | ( |  | $ItemCounts | ) |

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.

Definition at line 85 of file TransportControlsUI_Base.php.

References $ItemCounts, and ActiveTab().

TransportControlsUI_Base::ReverseLink | ( |  | ) |

Get link for reverse button.

Returns
  string Link URL.

Definition at line 573 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 | $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 318 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 466 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 457 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 478 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 493 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 533 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 549 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 505 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 519 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 | $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 213 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 161 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 370 of file TransportControlsUI_Base.php.

References $ActiveTab, and ActiveTab().

## Member Data Documentation

TransportControlsUI_Base::$ActiveTab
| protected

Definition at line 625 of file TransportControlsUI_Base.php.

Referenced by UrlParameterString().

TransportControlsUI_Base::$CurrentBaseLink
| protected

Definition at line 626 of file TransportControlsUI_Base.php.

TransportControlsUI_Base::$CurrentItemType
| protected

Definition at line 627 of file TransportControlsUI_Base.php.

Referenced by FastDistance(), and GetLinkWithStartingIndex().

TransportControlsUI_Base::$DefaultActiveTab = MetadataSchema::SCHEMAID_DEFAULT
| staticprotected

Definition at line 636 of file TransportControlsUI_Base.php.

TransportControlsUI_Base::$DefaultSortField = "R"
| staticprotected

Definition at line 637 of file TransportControlsUI_Base.php.

TransportControlsUI_Base::$ItemCounts
| protected

Definition at line 628 of file TransportControlsUI_Base.php.

Referenced by ItemCount().

TransportControlsUI_Base::$ItemsPerPage
| protected

Definition at line 629 of file TransportControlsUI_Base.php.

Referenced by __construct().

TransportControlsUI_Base::$ItemTypes
| protected

Definition at line 630 of file TransportControlsUI_Base.php.

Referenced by __construct().

TransportControlsUI_Base::$LastPageStartIndexes
| protected

Definition at line 631 of file TransportControlsUI_Base.php.

TransportControlsUI_Base::$ReverseSortFlags
| protected

Definition at line 632 of file TransportControlsUI_Base.php.

TransportControlsUI_Base::$SortFields
| protected

Definition at line 633 of file TransportControlsUI_Base.php.

TransportControlsUI_Base::$StartingIndexes
| protected

Definition at line 634 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