MediaWiki  REL1_19
TablePager Class Reference

Table-based display with a user-selectable sort order. More...

Inheritance diagram for TablePager:
Collaboration diagram for TablePager:

List of all members.

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

Detailed Description

Table-based display with a user-selectable sort order.

Definition at line 836 of file Pager.php.


Constructor & Destructor Documentation

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().

Here is the call graph for this function:


Member Function Documentation

Parameters:
$rowArray
Returns:
String HTML

Reimplemented from IndexPager.

Reimplemented in AllmessagesTablePager.

Definition at line 918 of file Pager.php.

References formatValue(), getCellAttrs(), getFieldNames(), getRowAttrs(), Xml\openElement(), and Xml\tags().

Here is the call graph for this function:

TablePager::formatValue ( name,
value 
) [abstract]

Format a table cell.

The return value should be HTML, but use an empty string not &#160; for empty cells. Do not include the

and .

The current result row is available as $this->mCurrentRow, in case you need more context.

Parameters:
$nameString: the database field name
$valueString: the value retrieved from the database

Reimplemented in AllmessagesTablePager, BlockListPager, and ImageListPager.

Referenced by formatRow().

Here is the caller graph for this function:

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

Parameters:
$fieldString The column
$valueString The cell contents
Returns:
Array of attr => value

Reimplemented in AllmessagesTablePager.

Definition at line 969 of file Pager.php.

Referenced by formatRow().

Here is the caller graph for this function:

The database field name used as a default sort order.

Reimplemented in AllmessagesTablePager, BlockListPager, and ImageListPager.

Referenced by __construct().

Here is the caller graph for this function:

Hook into getBody(), for the bit between the start and the end when there are no rows.

Returns:
String

Reimplemented from IndexPager.

Definition at line 908 of file Pager.php.

References getFieldNames(), and wfMsgHtml().

Here is the call graph for this function:

Hook into getBody() for the end of the list.

Returns:
String

Reimplemented from IndexPager.

Definition at line 904 of file Pager.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.

Returns:
Array

Reimplemented in AllmessagesTablePager, BlockListPager, and ImageListPager.

Referenced by __construct(), formatRow(), getEmptyBody(), and getStartBody().

Here is the caller graph for this function:

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.

Parameters:
$blacklistArray parameters from the request query which should not be resubmitted
Returns:
String: HTML fragment

Definition at line 1082 of file Pager.php.

References ContextSource\getRequest().

Referenced by AllmessagesTablePager\buildForm(), ImageListPager\getForm(), and getLimitDropdown().

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Returns:
string|Array

Reimplemented from IndexPager.

Reimplemented in BlockListPager.

Definition at line 973 of file Pager.php.

Gets a limit selection dropdown.

Returns:
string

Definition at line 1118 of file Pager.php.

References getHiddenFields(), getLimitSelect(), and wfMsgHtml().

Referenced by getLimitForm().

Here is the call graph for this function:

Here is the caller graph for this function:

Get a form containing a limit selection dropdown.

Returns:
String: HTML fragment

Definition at line 1102 of file Pager.php.

References $wgScript, getLimitDropdown(), and Xml\openElement().

Here is the call graph for this function:

Get a <select> element which has options for each of the allowed limits.

Returns:
String: HTML fragment

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().

Here is the call graph for this function:

Here is the caller graph for this function:

Reimplemented in ImageListPager.

Definition at line 981 of file Pager.php.

Referenced by getNavigationBar().

Here is the caller graph for this function:

A navigation bar with images.

Returns:
String HTML

Implements Pager.

Definition at line 993 of file Pager.php.

References $keys, $path, $wgStylePath, ContextSource\getLanguage(), getNavClass(), IndexPager\getPagingLinks(), IndexPager\isNavigationBarShown(), and wfMsgHtml().

Here is the call graph for this function:

Get attributes to be applied to the given row.

Parameters:
$rowObject: the database result row
Returns:
Array of <attr> =>

Definition at line 950 of file Pager.php.

References getRowClass().

Referenced by formatRow().

Here is the call graph for this function:

Here is the caller graph for this function:

Get a class name to be applied to the given row.

Parameters:
$rowObject: the database result row
Returns:
String

Definition at line 940 of file Pager.php.

Referenced by getRowAttrs().

Here is the caller graph for this function:

Reimplemented in ImageListPager.

Definition at line 985 of file Pager.php.

Referenced by getStartBody().

Here is the caller graph for this function:

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.

Returns:
String

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().

Here is the call graph for this function:

Reimplemented in BlockListPager, and ImageListPager.

Definition at line 977 of file Pager.php.

Referenced by getStartBody().

Here is the caller graph for this function:

TablePager::isFieldSortable ( field) [abstract]

Return true if the named field should be sortable by the UI, false otherwise.

Parameters:
$fieldString

Reimplemented in AllmessagesTablePager, BlockListPager, and ImageListPager.

Referenced by getStartBody().

Here is the caller graph for this function:


Member Data Documentation

TablePager::$mCurrentRow

Definition at line 838 of file Pager.php.

TablePager::$mSort

Definition at line 837 of file Pager.php.


The documentation for this class was generated from the following file: