CWIS Developer Documentation
|
Class to provide support for transport controls (used for paging back and forth through a list) in the user interface. More...
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" |
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.
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).
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().
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).
int | $NewValue | New active tab. (OPTIONAL) |
Definition at line 317 of file TransportControlsUI_Base.php.
Referenced by __construct(), ItemCount(), and UrlParameterString().
|
static |
Get/set the default active tab value (usually an item type).
int | $NewValue | New default active tab. (OPTIONAL) |
Definition at line 333 of file TransportControlsUI_Base.php.
|
static |
Get/set default sort field value.
mixed | $NewValue | New default sort field. |
Definition at line 302 of file TransportControlsUI_Base.php.
Referenced by ItemListUI\__construct().
|
protected |
Get distance to jump for fast forward/reverse.
Definition at line 693 of file TransportControlsUI_Base.php.
References $CurrentItemType, and ItemsPerPage().
Referenced by FastForwardLink(), FastReverseLink(), ShowFastForwardButton(), and ShowFastReverseButton().
TransportControlsUI_Base::FastForwardLink | ( | ) |
Get link for fast forward button.
Definition at line 633 of file TransportControlsUI_Base.php.
References FastDistance(), and GetLinkWithStartingIndex().
TransportControlsUI_Base::FastReverseLink | ( | ) |
Get link for fast reverse button.
Definition at line 645 of file TransportControlsUI_Base.php.
References FastDistance(), and GetLinkWithStartingIndex().
TransportControlsUI_Base::ForwardLink | ( | ) |
Get link for forward button.
Definition at line 610 of file TransportControlsUI_Base.php.
References GetLinkWithStartingIndex(), and ItemsPerPage().
|
protected |
Generate link with specified modified starting index.
int | $StartingIndex | Index to use for current item type. |
Definition at line 705 of file TransportControlsUI_Base.php.
References $CurrentItemType.
Referenced by FastForwardLink(), FastReverseLink(), ForwardLink(), GoToEndLink(), GoToStartLink(), and ReverseLink().
TransportControlsUI_Base::GoToEndLink | ( | ) |
Get link for button to go to end.
Definition at line 656 of file TransportControlsUI_Base.php.
References GetLinkWithStartingIndex().
TransportControlsUI_Base::GoToStartLink | ( | ) |
Get link for button to go to start.
Definition at line 666 of file TransportControlsUI_Base.php.
References GetLinkWithStartingIndex().
|
protected |
Check whether specified field looks valid for specified item type.
int | $Field | Field to check. |
int | $ItemType | Type of item to check against. |
Definition at line 727 of file TransportControlsUI_Base.php.
Referenced by SortField().
TransportControlsUI_Base::ItemCount | ( | $ItemCounts = NULL | ) |
Get/set count of items in search results.
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) |
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.
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. |
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().
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.)
array | $Names | Item type names, indexed by item type IDs. (OPTIONAL) |
Definition at line 490 of file TransportControlsUI_Base.php.
References $ItemTypeNames.
Referenced by TransportControlsUI\PrintControls().
TransportControlsUI_Base::ReverseLink | ( | ) |
Get link for reverse button.
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.
mixed | $NewValue | New value or array of values (indexed by item type). |
Definition at line 351 of file TransportControlsUI_Base.php.
Referenced by __construct().
TransportControlsUI_Base::SetBaseLink | ( | $BaseLink | ) |
Set current base link for Link methods.
string | $BaseLink | New base URL. |
Definition at line 515 of file TransportControlsUI_Base.php.
Referenced by TransportControlsUI\PrintControls().
TransportControlsUI_Base::SetItemType | ( | $ItemType | ) |
Set current item type for Show or Link methods.
int | $ItemType | Item type for operations. |
Definition at line 506 of file TransportControlsUI_Base.php.
Referenced by TransportControlsUI\PrintControls().
TransportControlsUI_Base::ShowAnyForwardButtons | ( | ) |
Report whether any forward buttons should be displayed.
The item type must be set via SetItemType() before using this.
Definition at line 527 of file TransportControlsUI_Base.php.
References ItemsPerPage().
Referenced by TransportControlsUI\PrintControls().
TransportControlsUI_Base::ShowAnyReverseButtons | ( | ) |
Report whether any reverse buttons should be displayed.
The item type must be set via SetItemType() before using this.
Definition at line 542 of file TransportControlsUI_Base.php.
Referenced by TransportControlsUI\PrintControls().
TransportControlsUI_Base::ShowFastForwardButton | ( | ) |
Report whether fast forward button should be displayed.
The item type must be set via SetItemType() before using this.
Definition at line 582 of file TransportControlsUI_Base.php.
References FastDistance(), and ItemsPerPage().
Referenced by TransportControlsUI\PrintControls().
TransportControlsUI_Base::ShowFastReverseButton | ( | ) |
Report whether fast reverse button should be displayed.
The item type must be set via SetItemType() before using this.
Definition at line 598 of file TransportControlsUI_Base.php.
References FastDistance(), and ItemsPerPage().
Referenced by TransportControlsUI\PrintControls().
TransportControlsUI_Base::ShowForwardButton | ( | ) |
Report whether forward button should be displayed.
The item type must be set via SetItemType() before using this.
Definition at line 554 of file TransportControlsUI_Base.php.
References ItemsPerPage().
Referenced by TransportControlsUI\PrintControls().
TransportControlsUI_Base::ShowReverseButton | ( | ) |
Report whether reverse button should be displayed.
The item type must be set via SetItemType() before using this.
Definition at line 568 of file TransportControlsUI_Base.php.
References ItemsPerPage().
Referenced by TransportControlsUI\PrintControls().
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.
mixed | $NewValue | Field ID or array of field IDs (indexed by item type). |
Definition at line 246 of file TransportControlsUI_Base.php.
References IsValidField().
Referenced by __construct().
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.
mixed | $NewValue | New starting index value or array of index values with item types for indexes. (OPTIONAL) |
Definition at line 194 of file TransportControlsUI_Base.php.
Referenced by __construct().
TransportControlsUI_Base::UrlParameterString | ( | $EncodeSeparators = TRUE , |
|
$ExcludeParameters = NULL |
|||
) |
Get string containing URL parameters, ready for inclusion in URL.
bool | $EncodeSeparators | If TRUE, "&" 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) |
Definition at line 403 of file TransportControlsUI_Base.php.
References $ActiveTab, and ActiveTab().
|
protected |
Definition at line 674 of file TransportControlsUI_Base.php.
Referenced by UrlParameterString().
|
protected |
Definition at line 675 of file TransportControlsUI_Base.php.
|
protected |
Definition at line 676 of file TransportControlsUI_Base.php.
Referenced by FastDistance(), and GetLinkWithStartingIndex().
|
staticprotected |
Definition at line 686 of file TransportControlsUI_Base.php.
|
staticprotected |
Definition at line 687 of file TransportControlsUI_Base.php.
|
protected |
Definition at line 677 of file TransportControlsUI_Base.php.
Referenced by ItemCount().
|
protected |
Definition at line 678 of file TransportControlsUI_Base.php.
Referenced by __construct(), and ItemsPerPage().
|
protected |
Definition at line 679 of file TransportControlsUI_Base.php.
Referenced by ItemTypeNames().
|
protected |
Definition at line 680 of file TransportControlsUI_Base.php.
Referenced by __construct().
|
protected |
Definition at line 681 of file TransportControlsUI_Base.php.
|
protected |
Definition at line 682 of file TransportControlsUI_Base.php.
|
protected |
Definition at line 683 of file TransportControlsUI_Base.php.
|
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().