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 ) ==
'' ) {
122 $s .= Html::rawElement(
'th', [],
' ' ) .
"\n";
128 if ( $this->mSort == $field ) {
133 $class =
"$sortClass TablePager_sort-descending";
138 $class =
"$sortClass TablePager_sort-ascending";
145 $s .= Html::rawElement(
'th', [
'class' => $class ],
$link ) .
"\n";
147 $s .= Html::element(
'th', [], $name ) .
"\n";
152 $ret = Html::openElement(
'table', [
153 'class' =>
"mw-datatable $tableClass" ]
155 $ret .= Html::rawElement(
'thead', [], Html::rawElement(
'tr', [],
"\n" .
$s .
"\n" ) );
156 $ret .= Html::openElement(
'tbody' ) .
"\n";
166 return "</tbody></table>\n";
175 $msgEmpty = $this->
msg(
'table_pager_empty' )->text();
176 return Html::rawElement(
'tr', [],
177 Html::element(
'td', [
'colspan' => $colspan ], $msgEmpty ) );
186 $this->mCurrentRow = $row;
187 $s = Html::openElement(
'tr', $this->
getRowAttrs( $row ) ) .
"\n";
190 foreach ( $fieldNames as $field => $name ) {
191 $value = isset( $row->$field ) ? $row->$field :
null;
194 if ( $formatted ==
'' ) {
195 $formatted =
' ';
201 $s .= Html::closeElement(
'tr' ) .
"\n";
228 if ( $class ===
'' ) {
255 return [
'class' =>
'TablePager_col_' . $field ];
277 return 'TablePager_nav';
284 return 'TablePager_sort';
298 $types = [
'first',
'prev',
'next',
'last' ];
307 foreach ( $types as
$type ) {
308 $buttons[] = new \OOUI\ButtonWidget( [
314 'label' => $this->
msg(
'table_pager_' . $type )->
text(),
316 $title->getLinkURL(
$queries[
$type ] + $this->getDefaultQuery() ) :
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 );
347 $select->setAttribute( $name,
$value );
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 ) {
399 $s .= Html::hidden( $name,
$value ) .
"\n";
410 return Html::rawElement(
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" .
wfScript( $script='index')
Get the path to a specified script file, respecting file extensions; this is a wrapper around $wgScri...
msg( $key)
Get a Message object with context set Parameters are the same as wfMessage()
getRequest()
Get the WebRequest object.
getTitle()
Get the Title object.
getOutput()
Get the OutputPage object.
getLanguage()
Get the Language object.
setContext(IContextSource $context)
Set the IContextSource object.
Class for generating HTML <select> or <datalist> elements.
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
the array() calling protocol came about after MediaWiki 1.4rc1.
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
usually copyright or history_copyright This message must be in HTML not wikitext & $link
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
null for the local 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
processing should stop and the error should be shown to the user * false
Interface for objects which can provide a MediaWiki context on request.