49 $this->mSort = $this->
getRequest()->getText(
'sort' );
50 if ( !array_key_exists( $this->mSort, $this->
getFieldNames() )
57 } elseif ( $this->
getRequest()->getBool(
'desc' ) ) {
80 return parent::getBody();
93 $body = parent::getBody();
111 $body = parent::getBody();
114 $pout->
setText( $navigation . $body . $navigation );
130 foreach ( $fields as $field => $name ) {
131 if ( strval( $name ) ==
'' ) {
138 if ( $this->mSort == $field ) {
143 $class =
"$sortClass mw-datatable-is-sorted mw-datatable-is-descending";
148 $class =
"$sortClass mw-datatable-is-sorted mw-datatable-is-ascending";
150 $query[
'desc'] =
'1';
154 $link = $this->
makeLink( htmlspecialchars( $name ), $query, $linkType );
175 return "</tbody></table>\n";
183 $msgEmpty = $this->
msg(
'table_pager_empty' )->text();
185 Html::element(
'td', [
'colspan' => $colspan ], $msgEmpty ) );
194 $this->mCurrentRow = $row;
198 foreach ( $fieldNames as $field => $name ) {
199 $value = $row->$field ??
null;
200 $formatted = strval( $this->
formatValue( $field, $value ) );
202 if ( $formatted ==
'' ) {
203 $formatted =
"\u{00A0}";
257 return [
'class' =>
'TablePager_col_' . $field ];
275 return 'mw-datatable';
283 return 'TablePager_nav';
291 return 'TablePager_sort';
307 $types = [
'first',
'prev',
'next',
'last' ];
315 foreach ( $types as
$type ) {
316 $buttons[] = new \OOUI\ButtonWidget( [
322 'classes' => [
'TablePager-button-' .
$type ],
323 'flags' => [
'progressive' ],
325 'label' => $this->
msg(
'table_pager_' . $type )->text(),
326 'href' => $queries[
$type ] ?
327 $title->getLinkURL( $queries[
$type ] + $this->getDefaultQuery() ) :
329 'icon' =>
$type ===
'prev' ?
'previous' :
$type,
330 'disabled' => $queries[
$type ] ===
false
333 return new \OOUI\ButtonGroupWidget( [
344 parent::getModuleStyles(), [
'oojs-ui.styles.icons-movement' ]
355 $select =
new XmlSelect(
'limit',
false, $this->mLimit );
357 foreach ( $attribs as $name => $value ) {
358 $select->setAttribute( $name, $value );
360 return $select->getHTML();
371 # Add the current limit from the query string
372 # to avoid that the limit is lost after clicking Go next time
373 if ( !in_array( $this->mLimit, $this->mLimitsShown ) ) {
375 sort( $this->mLimitsShown );
378 foreach ( $this->mLimitsShown as $key => $value ) {
379 # The pair is either $index => $limit, in which case the $value
380 # will be numeric, or $limit => $text, in which case the $value
382 if ( is_int( $value ) ) {
389 $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 ) {
437 # Make the select with some explanatory text
438 $msgSubmit = $this->
msg(
'table_pager_limit_submit' )->escaped();
440 return $this->
msg(
'table_pager_limit' )
442 "\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)
static element( $element, $attribs=[], $contents='')
Identical to rawElement(), but HTML-escapes $contents (like Xml::element()).
static rawElement( $element, $attribs=[], $contents='')
Returns an HTML element in a string.
static openElement( $element, $attribs=[])
Identical to rawElement(), but has no third parameter and omits the end tag (and the self-closing '/'...
static closeElement( $element)
Returns "</$element>".
static hidden( $name, $value, array $attribs=[])
Convenience function to produce an input element with type=hidden.
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