$this->table = new AllMessagesTablePager(
$this,
- array(),
+ [],
wfGetLangObj( $request->getVal( 'lang', $par ) )
);
$this->mConds = $conds;
// FIXME: Why does this need to be set to DIR_DESCENDING to produce ascending ordering?
$this->mDefaultDirection = IndexPager::DIR_DESCENDING;
- $this->mLimitsShown = array( 20, 50, 100, 250, 500, 5000 );
+ $this->mLimitsShown = [ 20, 50, 100, 250, 500, 5000 ];
global $wgContLang;
}
function buildForm() {
- $attrs = array( 'id' => 'mw-allmessages-form-lang', 'name' => 'lang' );
+ $attrs = [ 'id' => 'mw-allmessages-form-lang', 'name' => 'lang' ];
$msg = wfMessage( 'allmessages-language' );
$langSelect = Xml::languageSelector( $this->langcode, false, null, $attrs, $msg );
- $out = Xml::openElement( 'form', array(
+ $out = Xml::openElement( 'form', [
'method' => 'get',
'action' => $this->getConfig()->get( 'Script' ),
'id' => 'mw-allmessages-form'
- ) ) .
+ ] ) .
Xml::fieldset( $this->msg( 'allmessages-filter-legend' )->text() ) .
Html::hidden( 'title', $this->getTitle()->getPrefixedText() ) .
- Xml::openElement( 'table', array( 'class' => 'mw-allmessages-table' ) ) . "\n" .
+ Xml::openElement( 'table', [ 'class' => 'mw-allmessages-table' ] ) . "\n" .
'<tr>
<td class="mw-label">' .
Xml::label( $this->msg( 'allmessages-prefix' )->text(), 'mw-allmessages-form-prefix' ) .
'prefix',
20,
str_replace( '_', ' ', $this->displayPrefix ),
- array( 'id' => 'mw-allmessages-form-prefix' )
+ [ 'id' => 'mw-allmessages-form-prefix' ]
) .
"</td>\n
</tr>
Xml::label( $this->msg( 'table_pager_limit_label' )->text(), 'mw-table_pager_limit_label' ) .
'</td>
<td class="mw-input">' .
- $this->getLimitSelect( array( 'id' => 'mw-table_pager_limit_label' ) ) .
+ $this->getLimitSelect( [ 'id' => 'mw-table_pager_limit_label' ] ) .
'</td>
<tr>
<td></td>
</tr>" .
Xml::closeElement( 'table' ) .
- $this->getHiddenFields( array( 'title', 'prefix', 'filter', 'lang', 'limit' ) ) .
+ $this->getHiddenFields( [ 'title', 'prefix', 'filter', 'lang', 'limit' ] ) .
Xml::closeElement( 'fieldset' ) .
Xml::closeElement( 'form' );
$messageNames = Language::getLocalisationCache()->getSubitemList( 'en', 'messages' );
// Normalise message names so they look like page titles and sort correctly - T86139
- $messageNames = array_map( array( $this->lang, 'ucfirst' ), $messageNames );
+ $messageNames = array_map( [ $this->lang, 'ucfirst' ], $messageNames );
if ( $descending ) {
rsort( $messageNames );
$dbr = wfGetDB( DB_SLAVE );
$res = $dbr->select( 'page',
- array( 'page_namespace', 'page_title' ),
- array( 'page_namespace' => array( NS_MEDIAWIKI, NS_MEDIAWIKI_TALK ) ),
+ [ 'page_namespace', 'page_title' ],
+ [ 'page_namespace' => [ NS_MEDIAWIKI, NS_MEDIAWIKI_TALK ] ],
__METHOD__,
- array( 'USE INDEX' => 'name_title' )
+ [ 'USE INDEX' => 'name_title' ]
);
$xNames = array_flip( $messageNames );
- $pageFlags = $talkFlags = array();
+ $pageFlags = $talkFlags = [];
foreach ( $res as $s ) {
$exists = false;
}
}
- return array( 'pages' => $pageFlags, 'talks' => $talkFlags );
+ return [ 'pages' => $pageFlags, 'talks' => $talkFlags ];
}
/**
* @return FakeResultWrapper
*/
function reallyDoQuery( $offset, $limit, $descending ) {
- $result = new FakeResultWrapper( array() );
+ $result = new FakeResultWrapper( [] );
$messageNames = $this->getAllMessages( $descending );
$statuses = self::getCustomisedStatuses( $messageNames, $this->langcode, $this->foreign );
) {
$actual = wfMessage( $key )->inLanguage( $this->langcode )->plain();
$default = wfMessage( $key )->inLanguage( $this->langcode )->useDatabase( false )->plain();
- $result->result[] = array(
+ $result->result[] = [
'am_title' => $key,
'am_actual' => $actual,
'am_default' => $default,
'am_customised' => $customised,
'am_talk_exists' => isset( $statuses['talks'][$key] )
- );
+ ];
$count++;
}
function getStartBody() {
$tableClass = $this->getTableClass();
- return Xml::openElement( 'table', array(
+ return Xml::openElement( 'table', [
'class' => "mw-datatable $tableClass",
'id' => 'mw-allmessagestable'
- ) ) .
+ ] ) .
"\n" .
"<thead><tr>
<th rowspan=\"2\">" .
$title = Title::makeTitle( NS_MEDIAWIKI, $value . $this->suffix );
$talk = Title::makeTitle( NS_MEDIAWIKI_TALK, $value . $this->suffix );
$translation = Linker::makeExternalLink(
- 'https://translatewiki.net/w/i.php?' . wfArrayToCgi( array(
+ 'https://translatewiki.net/w/i.php?' . wfArrayToCgi( [
'title' => 'Special:SearchTranslations',
'group' => 'mediawiki',
'grouppath' => 'mediawiki',
'query' => 'language:' . $this->getLanguage()->getCode() . '^25 ' .
'messageid:"MediaWiki:' . $value . '"^10 "' .
$this->msg( $value )->inLanguage( 'en' )->plain() . '"'
- ) ),
+ ] ),
$this->msg( 'allmessages-filter-translate' )->text()
);
$title = Linker::link(
$title,
$this->getLanguage()->lcfirst( $value ),
- array(),
- array(),
- array( 'broken' )
+ [],
+ [],
+ [ 'broken' ]
);
}
if ( $this->mCurrentRow->am_talk_exists ) {
$talk = Linker::link(
$talk,
$this->talk,
- array(),
- array(),
- array( 'broken' )
+ [],
+ [],
+ [ 'broken' ]
);
}
case 'am_default' :
case 'am_actual' :
- return Sanitizer::escapeHtmlAllowEntities( $value, ENT_QUOTES );
+ return Sanitizer::escapeHtmlAllowEntities( $value );
}
return '';
}
function getRowAttrs( $row, $isSecond = false ) {
- $arr = array();
+ $arr = [];
if ( $row->am_customised ) {
$arr['class'] = 'allmessages-customised';
function getCellAttrs( $field, $value ) {
if ( $this->mCurrentRow->am_customised && $field === 'am_title' ) {
- return array( 'rowspan' => '2', 'class' => $field );
+ return [ 'rowspan' => '2', 'class' => $field ];
} elseif ( $field === 'am_title' ) {
- return array( 'class' => $field );
+ return [ 'class' => $field ];
} else {
- return array(
- 'lang' => wfBCP47( $this->langcode ),
+ return [
+ 'lang' => $this->lang->getHtmlCode(),
'dir' => $this->lang->getDir(),
'class' => $field
- );
+ ];
}
}
// This is not actually used, as getStartBody is overridden above
function getFieldNames() {
- return array(
+ return [
'am_title' => $this->msg( 'allmessagesname' )->text(),
'am_default' => $this->msg( 'allmessagesdefault' )->text()
- );
+ ];
}
function getTitle() {