MediaWiki
REL1_24
|
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. | |
getBody () | |
Get the formatted result list. | |
getBodyOutput () | |
Get the formatted result list. | |
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 () | |
getEndBody () | |
getFieldNames () | |
An array mapping database field names to a textual description of the field name, for use in the table header. | |
getFullOutput () | |
Get the formatted result list, with navigation bars. | |
getHiddenFields ($blacklist=array()) | |
Get <input type="hidden"> elements for use in a method="get" form. | |
getIndexField () | |
getLimitDropdown () | |
Gets a limit selection dropdown. | |
getLimitForm () | |
Get a form containing a limit selection dropdown. | |
getLimitSelect ($attribs=array()) | |
Get a "<select>" element which has options for each of the allowed limits. | |
getLimitSelectList () | |
Get a list of items to show in a "<select>" element of limits. | |
getModuleStyles () | |
ResourceLoader modules that must be loaded to provide correct styling for this pager. | |
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 () | |
getTableClass () | |
isFieldSortable ($field) | |
Return true if the named field should be sortable by the UI, false otherwise. | |
Protected Attributes | |
$mCurrentRow | |
$mSort |
Table-based display with a user-selectable sort order.
Definition at line 28 of file TablePager.php.
TablePager::__construct | ( | IContextSource $ | context = null | ) |
Reimplemented from IndexPager.
Definition at line 33 of file TablePager.php.
References ContextSource\$context, IndexPager\DIR_ASCENDING, IndexPager\DIR_DESCENDING, getDefaultSort(), getFieldNames(), ContextSource\getRequest(), isFieldSortable(), and ContextSource\setContext().
TablePager::formatRow | ( | $ | row | ) |
stdClass | $row |
Reimplemented from IndexPager.
Reimplemented in AllMessagesTablePager.
Definition at line 185 of file TablePager.php.
References $name, $s, $value, as, Html\closeElement(), formatValue(), getCellAttrs(), getFieldNames(), getRowAttrs(), Html\openElement(), and Html\rawElement().
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.
string | $name | The database field name |
string | $value | The value retrieved from the database |
Reimplemented in ImageListPager, ProtectedPagesPager, AllMessagesTablePager, and BlockListPager.
Referenced by formatRow().
TablePager::getBody | ( | ) | [final] |
Get the formatted result list.
Calls getStartBody(), formatRow() and getEndBody(), concatenates the results and returns them.
Also adds the required styles to our OutputPage object (this means that if context wasn't passed to constructor or otherwise set up, you will get a pager with missing styles).
This method has been made 'final' in 1.24. There's no reason to override it, and if there exist any subclasses that do, the style loading hack is probably broken in them. Let's fail fast rather than mysteriously render things wrong.
Reimplemented from IndexPager.
Definition at line 67 of file TablePager.php.
References getModuleStyles(), and ContextSource\getOutput().
Referenced by getBodyOutput(), and getFullOutput().
Get the formatted result list.
Calls getBody() and getModuleStyles() and builds a ParserOutput object. (This is a bit hacky but works well.)
Definition at line 81 of file TablePager.php.
References getBody(), getModuleStyles(), and ParserOutput\setText().
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
string | $field | The column |
string | $value | The cell contents |
Reimplemented in AllMessagesTablePager.
Definition at line 247 of file TablePager.php.
References array().
Referenced by formatRow().
TablePager::getDefaultSort | ( | ) | [abstract] |
The database field name used as a default sort order.
Reimplemented in ProtectedPagesPager, AllMessagesTablePager, BlockListPager, and ImageListPager.
Referenced by __construct().
Reimplemented from IndexPager.
Definition at line 173 of file TablePager.php.
References array(), Html\element(), getFieldNames(), ContextSource\msg(), and Html\rawElement().
Reimplemented from IndexPager.
Definition at line 165 of file TablePager.php.
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, ProtectedPagesPager, BlockListPager, and ImageListPager.
Referenced by __construct(), formatRow(), getEmptyBody(), and getStartBody().
Get the formatted result list, with navigation bars.
Calls getBody(), getNavigationBar() and getModuleStyles() and builds a ParserOutput object. (This is a bit hacky but works well.)
Definition at line 99 of file TablePager.php.
References getBody(), getModuleStyles(), getNavigationBar(), and ParserOutput\setText().
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.
array | $blacklist | Parameters from the request query which should not be resubmitted |
Definition at line 386 of file TablePager.php.
References $name, $query, $s, $value, array(), as, ContextSource\getRequest(), and Html\hidden().
Referenced by getLimitDropdown().
Reimplemented from IndexPager.
Reimplemented in ProtectedPagesPager, and BlockListPager.
Definition at line 255 of file TablePager.php.
Gets a limit selection dropdown.
Definition at line 420 of file TablePager.php.
References array(), getHiddenFields(), getLimitSelect(), and ContextSource\msg().
Referenced by getLimitForm().
Get a form containing a limit selection dropdown.
Definition at line 404 of file TablePager.php.
References array(), getLimitDropdown(), Html\rawElement(), and wfScript().
TablePager::getLimitSelect | ( | $ | attribs = array() | ) |
Get a "<select>" element which has options for each of the allowed limits.
string | $attribs | Extra attributes to set |
Definition at line 338 of file TablePager.php.
References $attribs, $name, $value, as, and getLimitSelectList().
Referenced by getLimitDropdown().
Get a list of items to show in a "<select>" element of limits.
This can be passed directly to XmlSelect::addOptions().
Definition at line 354 of file TablePager.php.
References $key, $limit, $ret, $value, array(), as, and ContextSource\getLanguage().
Referenced by getLimitSelect().
ResourceLoader modules that must be loaded to provide correct styling for this pager.
Definition at line 328 of file TablePager.php.
References array().
Referenced by getBody(), getBodyOutput(), and getFullOutput().
Reimplemented in ImageListPager.
Definition at line 271 of file TablePager.php.
Referenced by getNavigationBar().
A navigation bar with images.
Implements Pager.
Definition at line 287 of file TablePager.php.
References $s, $type, array(), as, Html\closeElement(), getNavClass(), IndexPager\getPagingLinks(), IndexPager\isNavigationBarShown(), ContextSource\msg(), Html\openElement(), and Html\rawElement().
Referenced by getFullOutput().
TablePager::getRowAttrs | ( | $ | row | ) |
Get attributes to be applied to the given row.
object | $row | The database result row |
Definition at line 226 of file TablePager.php.
References array(), and getRowClass().
Referenced by formatRow().
TablePager::getRowClass | ( | $ | row | ) |
Get a class name to be applied to the given row.
object | $row | The database result row |
Definition at line 214 of file TablePager.php.
Referenced by getRowAttrs().
Reimplemented in ImageListPager.
Definition at line 279 of file TablePager.php.
Referenced by getStartBody().
Reimplemented from IndexPager.
Reimplemented in AllMessagesTablePager.
Definition at line 113 of file TablePager.php.
References $link, $name, $query, $ret, $s, array(), as, IndexPager\DIR_DESCENDING, Html\element(), getFieldNames(), getSortHeaderClass(), getTableClass(), isFieldSortable(), IndexPager\makeLink(), Html\openElement(), and Html\rawElement().
Reimplemented in ImageListPager, ProtectedPagesPager, and BlockListPager.
Definition at line 263 of file TablePager.php.
Referenced by getStartBody().
TablePager::isFieldSortable | ( | $ | field | ) | [abstract] |
Return true if the named field should be sortable by the UI, false otherwise.
string | $field |
Reimplemented in ProtectedPagesPager, AllMessagesTablePager, BlockListPager, and ImageListPager.
Referenced by __construct(), and getStartBody().
TablePager::$mCurrentRow [protected] |
Definition at line 31 of file TablePager.php.
TablePager::$mSort [protected] |
Definition at line 29 of file TablePager.php.