MediaWiki
REL1_19
|
Table-based display with a user-selectable sort order. More...
Public Member Functions | |
__construct (IContextSource $context=null) | |
formatRow ($row) | |
formatValue ($name, $value) | |
Format a table cell. | |
getCellAttrs ($field, $value) | |
Get any extra attributes to be applied to the given cell. | |
getDefaultSort () | |
The database field name used as a default sort order. | |
getEmptyBody () | |
Hook into getBody(), for the bit between the start and the end when there are no rows. | |
getEndBody () | |
Hook into getBody() for the end of the list. | |
getFieldNames () | |
An array mapping database field names to a textual description of the field name, for use in the table header. | |
getHiddenFields ($blacklist=array()) | |
Get <input type="hidden"> elements for use in a method="get" form. | |
getIndexField () | |
This function should be overridden to return the name of the index fi- eld. | |
getLimitDropdown () | |
Gets a limit selection dropdown. | |
getLimitForm () | |
Get a form containing a limit selection dropdown. | |
getLimitSelect () | |
Get a <select> element which has options for each of the allowed limits. | |
getNavClass () | |
getNavigationBar () | |
A navigation bar with images. | |
getRowAttrs ($row) | |
Get attributes to be applied to the given row. | |
getRowClass ($row) | |
Get a class name to be applied to the given row. | |
getSortHeaderClass () | |
getStartBody () | |
Hook into getBody(), allows text to be inserted at the start. | |
getTableClass () | |
isFieldSortable ($field) | |
Return true if the named field should be sortable by the UI, false otherwise. | |
Public Attributes | |
$mCurrentRow | |
$mSort |
TablePager::__construct | ( | IContextSource $ | context = null | ) |
Reimplemented from IndexPager.
Definition at line 840 of file Pager.php.
References ContextSource\$context, getDefaultSort(), getFieldNames(), ContextSource\getRequest(), and ContextSource\setContext().
TablePager::formatRow | ( | $ | row | ) |
$row | Array |
Reimplemented from IndexPager.
Reimplemented in AllmessagesTablePager.
Definition at line 918 of file Pager.php.
References formatValue(), getCellAttrs(), getFieldNames(), getRowAttrs(), Xml\openElement(), and Xml\tags().
TablePager::formatValue | ( | $ | name, |
$ | value | ||
) | [abstract] |
Format a table cell.
The return value should be HTML, but use an empty string not   for empty cells. Do not include the
and .
The current result row is available as $this->mCurrentRow, in case you need more context.
$name | String: the database field name |
$value | String: the value retrieved from the database |
Reimplemented in AllmessagesTablePager, BlockListPager, and ImageListPager.
Referenced by formatRow().
TablePager::getCellAttrs | ( | $ | field, |
$ | value | ||
) |
Get any extra attributes to be applied to the given cell.
Don't take this as an excuse to hardcode styles; use classes and CSS instead. Row context is available in $this->mCurrentRow
$field | String The column |
$value | String The cell contents |
Reimplemented in AllmessagesTablePager.
Definition at line 969 of file Pager.php.
Referenced by formatRow().
TablePager::getDefaultSort | ( | ) | [abstract] |
The database field name used as a default sort order.
Reimplemented in AllmessagesTablePager, BlockListPager, and ImageListPager.
Referenced by __construct().
Hook into getBody(), for the bit between the start and the end when there are no rows.
Reimplemented from IndexPager.
Definition at line 908 of file Pager.php.
References getFieldNames(), and wfMsgHtml().
TablePager::getFieldNames | ( | ) | [abstract] |
An array mapping database field names to a textual description of the field name, for use in the table header.
The description should be plain text, it will be HTML-escaped later.
Reimplemented in AllmessagesTablePager, BlockListPager, and ImageListPager.
Referenced by __construct(), formatRow(), getEmptyBody(), and getStartBody().
TablePager::getHiddenFields | ( | $ | blacklist = array() | ) |
Get <input type="hidden"> elements for use in a method="get" form.
Resubmits all defined elements of the query string, except for a blacklist, passed in the $blacklist parameter.
$blacklist | Array parameters from the request query which should not be resubmitted |
Definition at line 1082 of file Pager.php.
References ContextSource\getRequest().
Referenced by AllmessagesTablePager\buildForm(), ImageListPager\getForm(), and getLimitDropdown().
This function should be overridden to return the name of the index fi- eld.
If the pager supports multiple orders, it may return an array of 'querykey' => 'indexfield' pairs, so that a request with &count=querykey will use indexfield to sort. In this case, the first returned key is the default.
Needless to say, it's really not a good idea to use a non-unique index for this! That won't page right.
Reimplemented from IndexPager.
Reimplemented in BlockListPager.
Gets a limit selection dropdown.
Definition at line 1118 of file Pager.php.
References getHiddenFields(), getLimitSelect(), and wfMsgHtml().
Referenced by getLimitForm().
Get a form containing a limit selection dropdown.
Definition at line 1102 of file Pager.php.
References $wgScript, getLimitDropdown(), and Xml\openElement().
Get a <select> element which has options for each of the allowed limits.
Definition at line 1049 of file Pager.php.
References $limit, Html\closeElement(), ContextSource\getLanguage(), Html\openElement(), and Xml\option().
Referenced by AllmessagesTablePager\buildForm(), ImageListPager\getForm(), and getLimitDropdown().
Reimplemented in ImageListPager.
Definition at line 981 of file Pager.php.
Referenced by getNavigationBar().
A navigation bar with images.
Implements Pager.
Definition at line 993 of file Pager.php.
References $keys, $path, $wgStylePath, ContextSource\getLanguage(), getNavClass(), IndexPager\getPagingLinks(), IndexPager\isNavigationBarShown(), and wfMsgHtml().
TablePager::getRowAttrs | ( | $ | row | ) |
Get attributes to be applied to the given row.
$row | Object: the database result row |
Definition at line 950 of file Pager.php.
References getRowClass().
Referenced by formatRow().
TablePager::getRowClass | ( | $ | row | ) |
Get a class name to be applied to the given row.
$row | Object: the database result row |
Definition at line 940 of file Pager.php.
Referenced by getRowAttrs().
Reimplemented in ImageListPager.
Definition at line 985 of file Pager.php.
Referenced by getStartBody().
Hook into getBody(), allows text to be inserted at the start.
This will be called even if there are no rows in the result set.
Reimplemented from IndexPager.
Reimplemented in AllmessagesTablePager, and ImageListPager.
Definition at line 858 of file Pager.php.
References $wgStylePath, getFieldNames(), getSortHeaderClass(), getTableClass(), isFieldSortable(), IndexPager\makeLink(), and wfMsg().
Reimplemented in BlockListPager, and ImageListPager.
Definition at line 977 of file Pager.php.
Referenced by getStartBody().
TablePager::isFieldSortable | ( | $ | field | ) | [abstract] |
Return true if the named field should be sortable by the UI, false otherwise.
$field | String |
Reimplemented in AllmessagesTablePager, BlockListPager, and ImageListPager.
Referenced by getStartBody().