70 private $localisationCache;
94 parent::__construct( $context, $linkRenderer );
95 $this->localisationCache = $localisationCache;
97 $this->mIndexField =
'am_title';
106 $this->langcode = $this->lang->
getCode();
107 $this->foreign = !$this->lang->equals( $contentLanguage );
109 $filter = $opts->
getValue(
'filter' );
110 if ( $filter ===
'all' ) {
111 $this->custom =
null;
113 $this->custom = ( $filter ===
'unmodified' );
122 $displayPrefix =
$prefix->getDBkey();
123 $this->prefix =
'/^' . preg_quote( $displayPrefix,
'/' ) .
'/i';
125 $this->prefix =
false;
130 if ( $this->foreign ) {
137 private function getAllMessages( $descending ) {
138 $messageNames = $this->localisationCache->getSubitemList(
'en',
'messages' );
141 $messageNames = array_map( [ $this->lang,
'ucfirst' ], $messageNames );
144 rsort( $messageNames );
146 asort( $messageNames );
149 return $messageNames;
176 [
'page_namespace',
'page_title' ],
179 [
'USE INDEX' =>
'page_name_title' ]
181 $xNames = array_fill_keys( $messageNames,
true );
183 $pageFlags = $talkFlags = [];
189 $titleParts = explode(
'/',
$s->page_title );
190 if ( count( $titleParts ) === 2 &&
192 isset( $xNames[$titleParts[0]] )
194 $exists = $titleParts[0];
196 } elseif ( isset( $xNames[
$s->page_title] ) ) {
197 $exists =
$s->page_title;
202 $pageFlags[$exists] =
true;
204 $talkFlags[$exists] =
true;
208 return [
'pages' => $pageFlags,
'talks' => $talkFlags ];
222 $messageNames = $this->getAllMessages( $order );
232 foreach ( $messageNames as $key ) {
233 $customised = isset( $statuses[
'pages'][$key] );
234 if ( $customised !== $this->custom &&
235 ( $asc && ( $key < $offset || !$offset ) || !$asc && $key > $offset ) &&
236 ( ( $this->prefix && preg_match( $this->prefix, $key ) ) || $this->prefix ===
false )
238 $actual = $this->
msg( $key )->inLanguage( $this->lang )->plain();
239 $default = $this->
msg( $key )->inLanguage( $this->lang )->useDatabase(
false )->plain();
242 'am_actual' => $actual,
243 'am_default' => $default,
244 'am_customised' => $customised,
245 'am_talk_exists' => isset( $statuses[
'talks'][$key] )
250 if ( $count === $limit ) {
261 'id' =>
'mw-allmessagestable'
265 <th rowspan=\"2\">" .
266 $this->
msg(
'allmessagesname' )->escaped() .
"
269 $this->
msg(
'allmessagesdefault' )->escaped() .
274 $this->
msg(
'allmessagescurrent' )->escaped() .
294 $translation = Linker::makeExternalLink(
296 'title' =>
'Special:SearchTranslations',
297 'group' =>
'mediawiki',
298 'grouppath' =>
'mediawiki',
300 'query' => $value .
' ' . $this->
msg( $value )->plain()
302 $this->
msg(
'allmessages-filter-translate' )->text()
304 $talkLink = $this->
msg(
'talkpagelinktext' )->text();
306 if ( $this->mCurrentRow->am_customised ) {
309 $title = $linkRenderer->makeBrokenLink(
313 if ( $this->mCurrentRow->am_talk_exists ) {
314 $talk = $linkRenderer->makeKnownLink( $talk, $talkLink );
316 $talk = $linkRenderer->makeBrokenLink(
323 $this->
msg(
'parentheses' )->rawParams( $talk )->escaped() .
325 $this->
msg(
'parentheses' )->rawParams( $translation )->escaped();
341 $s = parent::formatRow( $row );
344 if ( $row->am_customised ) {
346 $formatted = strval( $this->
formatValue(
'am_actual', $row->am_actual ) );
348 if ( $formatted ===
'' ) {
349 $formatted =
"\u{00A0}";
370 if ( $field ===
'am_title' ) {
371 if ( $this->mCurrentRow->am_customised ) {
372 $attr += [
'rowspan' =>
'2' ];
376 'lang' => $this->lang->getHtmlCode(),
377 'dir' => $this->lang->getDir(),
379 if ( $this->mCurrentRow->am_customised ) {
381 $attr += [
'class' => $field ];
390 'am_title' => $this->
msg(
'allmessagesname' )->text(),
391 'am_default' => $this->
msg(
'allmessagesdefault' )->text()
wfGetDB( $db, $groups=[], $wiki=false)
Get a Database object.
wfArrayToCgi( $array1, $array2=null, $prefix='')
This function takes one or two arrays as input, and returns a CGI-style string, e....
msg( $key,... $params)
Get a Message object with context set Parameters are the same as wfMessage()
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>".
Base class for language-specific code.
getCode()
Get the internal language code for this language object.
Caching for the contents of localisation files.
static escapeHtmlAllowEntities( $html)
Given HTML input, escape with htmlspecialchars but un-escape entities.
static getTitleFor( $name, $subpage=false, $fragment='')
Get a localised Title object for a specified special page name If you don't need a full Title object,...
static makeTitleSafe( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
static makeTitle( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
static newFromRow( $row)
Make a Title object from a DB row.
static openElement( $element, $attribs=null)
This opens an XML element.
Interface for objects which can provide a MediaWiki context on request.
foreach( $mmfl['setupFiles'] as $fileName) if( $queue) if(empty( $mmfl['quiet'])) $s