48 $this->mSort = $this->
getRequest()->getText(
'sort' );
49 if ( !array_key_exists( $this->mSort, $this->
getFieldNames() )
56 } elseif ( $this->
getRequest()->getBool(
'desc' ) ) {
61 parent::__construct(
null, $linkRenderer );
79 return parent::getBody();
92 $body = parent::getBody();
110 $body = parent::getBody();
113 $pout->
setText( $navigation . $body . $navigation );
129 foreach ( $fields as $field => $name ) {
130 if ( strval( $name ) ==
'' ) {
131 $s .= Html::rawElement(
'th', [],
"\u{00A0}" ) .
"\n";
137 if ( $this->mSort == $field ) {
142 $class =
"$sortClass mw-datatable-is-sorted mw-datatable-is-descending";
147 $class =
"$sortClass mw-datatable-is-sorted mw-datatable-is-ascending";
149 $query[
'desc'] =
'1';
153 $link = $this->
makeLink( htmlspecialchars( $name ), $query, $linkType );
154 $s .= Html::rawElement(
'th', [
'class' => $class ], $link ) .
"\n";
156 $s .= Html::element(
'th', [], $name ) .
"\n";
160 $ret = Html::openElement(
'table', [
163 $ret .= Html::rawElement(
'thead', [], Html::rawElement(
'tr', [],
"\n" .
$s .
"\n" ) );
164 $ret .= Html::openElement(
'tbody' ) .
"\n";
174 return "</tbody></table>\n";
182 $msgEmpty = $this->
msg(
'table_pager_empty' )->text();
183 return Html::rawElement(
'tr', [],
184 Html::element(
'td', [
'colspan' => $colspan ], $msgEmpty ) );
193 $this->mCurrentRow = $row;
194 $s = Html::openElement(
'tr', $this->
getRowAttrs( $row ) ) .
"\n";
197 foreach ( $fieldNames as $field => $name ) {
198 $value = $row->$field ??
null;
199 $formatted = strval( $this->
formatValue( $field, $value ) );
201 if ( $formatted ==
'' ) {
202 $formatted =
"\u{00A0}";
205 $s .= Html::rawElement(
'td', $this->
getCellAttrs( $field, $value ), $formatted ) .
"\n";
208 $s .= Html::closeElement(
'tr' ) .
"\n";
256 return [
'class' =>
'TablePager_col_' . $field ];
274 return 'mw-datatable';
282 return 'TablePager_nav';
290 return 'TablePager_sort';
306 $types = [
'first',
'prev',
'next',
'last' ];
314 foreach ( $types as
$type ) {
315 $buttons[] = new \OOUI\ButtonWidget( [
321 'classes' => [
'TablePager-button-' .
$type ],
322 'flags' => [
'progressive' ],
324 'label' => $this->
msg(
'table_pager_' . $type )->text(),
325 'href' => $queries[
$type ] ?
326 $title->getLinkURL( $queries[
$type ] + $this->getDefaultQuery() ) :
328 'icon' =>
$type ===
'prev' ?
'previous' :
$type,
329 'disabled' => $queries[
$type ] ===
false
332 return new \OOUI\ButtonGroupWidget( [
343 parent::getModuleStyles(), [
'oojs-ui.styles.icons-movement' ]
354 $select =
new XmlSelect(
'limit',
false, $this->mLimit );
356 foreach ( $attribs as $name => $value ) {
357 $select->setAttribute( $name, $value );
359 return $select->getHTML();
370 # Add the current limit from the query string
371 # to avoid that the limit is lost after clicking Go next time
372 if ( !in_array( $this->mLimit, $this->mLimitsShown ) ) {
374 sort( $this->mLimitsShown );
377 foreach ( $this->mLimitsShown as $key => $value ) {
378 # The pair is either $index => $limit, in which case the $value
379 # will be numeric, or $limit => $text, in which case the $value
381 if ( is_int( $value ) ) {
388 $ret[$text] = $limit;
403 $noResubmit = (array)$noResubmit;
404 $query = $this->
getRequest()->getQueryValues();
405 foreach ( $noResubmit as $name ) {
406 unset( $query[$name] );
409 foreach ( $query as $name => $value ) {
410 if ( is_array( $value ) ) {
414 $s .= Html::hidden( $name, $value ) .
"\n";
425 return Html::rawElement(
431 "\n" . $this->getLimitDropdown()
440 private function getLimitDropdown() {
441 # Make the select with some explanatory text
442 $msgSubmit = $this->
msg(
'table_pager_limit_submit' )->escaped();
444 return $this->
msg(
'table_pager_limit' )
446 "\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,... $params)
Get a Message object with context set Parameters are the same as wfMessage()
setContext(IContextSource $context)
setText( $text)
Set the text of the ParserOutput.
Class for generating HTML <select> or <datalist> elements.
Interface for objects which can provide a MediaWiki context on request.
foreach( $mmfl['setupFiles'] as $fileName) if( $queue) if(empty( $mmfl['quiet'])) $s