Go to the documentation of this file.
38 $this->mSort = $this->
getRequest()->getText(
'sort' );
39 if ( !array_key_exists( $this->mSort, $this->
getFieldNames() )
46 } elseif ( $this->
getRequest()->getBool(
'desc' ) ) {
50 parent::__construct();
69 return parent::getBody();
82 $body = parent::getBody();
101 $body = parent::getBody();
104 $pout->
setText( $navigation . $body . $navigation );
120 foreach ( $fields
as $field =>
$name ) {
121 if ( strval(
$name ) ==
'' ) {
128 if ( $this->mSort == $field ) {
133 $class =
"$sortClass TablePager_sort-descending";
138 $class =
"$sortClass TablePager_sort-ascending";
153 'class' =>
"mw-datatable $tableClass" ]
166 return "</tbody></table>\n";
175 $msgEmpty = $this->
msg(
'table_pager_empty' )->text();
177 Html::element(
'td', [
'colspan' => $colspan ], $msgEmpty ) );
186 $this->mCurrentRow = $row;
190 foreach ( $fieldNames
as $field =>
$name ) {
191 $value = isset( $row->$field ) ? $row->$field :
null;
194 if ( $formatted ==
'' ) {
195 $formatted =
' ';
228 if ( $class ===
'' ) {
255 return [
'class' =>
'TablePager_col_' . $field ];
277 return 'TablePager_nav';
284 return 'TablePager_sort';
298 $types = [
'first',
'prev',
'next',
'last' ];
308 $buttons[] = new \OOUI\ButtonWidget( [
314 'label' => $this->
msg(
'table_pager_' . $type )->
text(),
318 'icon' =>
$type ===
'prev' ?
'previous' :
$type,
322 return new \OOUI\ButtonGroupWidget( [
334 return [
'mediawiki.pager.tablePager',
'oojs-ui.styles.icons-movement' ];
344 $select =
new XmlSelect(
'limit',
false, $this->mLimit );
349 return $select->getHTML();
360 # Add the current limit from the query string
361 # to avoid that the limit is lost after clicking Go next time
362 if ( !in_array( $this->mLimit, $this->mLimitsShown ) ) {
364 sort( $this->mLimitsShown );
367 foreach ( $this->mLimitsShown
as $key =>
$value ) {
368 # The pair is either $index => $limit, in which case the $value
369 # will be numeric, or $limit => $text, in which case the $value
378 $ret[$text] = $limit;
392 $blacklist = (
array)$blacklist;
394 foreach ( $blacklist
as $name ) {
426 # Make the select with some explanatory text
427 $msgSubmit = $this->
msg(
'table_pager_limit_submit' )->escaped();
429 return $this->
msg(
'table_pager_limit' )
431 "\n<input type=\"submit\" value=\"$msgSubmit\"/>\n" .
design txt This is a brief overview of the new design More thorough and up to date information is available on the documentation wiki at etc Handles the details of getting and saving to the user table of the and dealing with sessions and cookies OutputPage Encapsulates the entire HTML page that will be sent in response to any server request It is used by calling its functions to add text
msg( $key)
Get a Message object with context set Parameters are the same as wfMessage()
Allows to change the fields on the form that will be generated $name
getRequest()
Get the WebRequest object.
getTitle()
Get the Title object.
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
Class for generating HTML <select> or <datalist> elements.
getLanguage()
Get the Language object.
static closeElement( $element)
Returns "</$element>".
null for the wiki Added should default to null in handler for backwards compatibility add a value to it if you want to add a cookie that have to vary cache options can modify $query
namespace and then decline to actually register it file or subcat img or subcat $title
wfScript( $script='index')
Get the path to a specified script file, respecting file extensions; this is a wrapper around $wgScri...
getOutput()
Get the OutputPage object.
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return an< a > element with HTML attributes $attribs and contents $html will be returned If you return $ret will be returned and may include noclasses after processing & $attribs
setContext(IContextSource $context)
Set the IContextSource object.
static hidden( $name, $value, array $attribs=[])
Convenience function to produce an input element with type=hidden.
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses & $ret
Interface for objects which can provide a MediaWiki context on request.
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
static openElement( $element, $attribs=[])
Identical to rawElement(), but has no third parameter and omits the end tag (and the self-closing '/'...
static rawElement( $element, $attribs=[], $contents='')
Returns an HTML element in a string.
usually copyright or history_copyright This message must be in HTML not wikitext & $link
static element( $element, $attribs=[], $contents='')
Identical to rawElement(), but HTML-escapes $contents (like Xml::element()).
the array() calling protocol came about after MediaWiki 1.4rc1.