// FIXME: Why does this need to be set to DIR_DESCENDING to produce ascending ordering?
$this->mDefaultDirection = IndexPager::DIR_DESCENDING;
- $langObj = wfGetLangObj( $opts->getValue( 'lang' ) );
$contLang = MediaWikiServices::getInstance()->getContentLanguage();
- $this->lang = $langObj ?? $contLang;
+ $this->lang = wfGetLangObj( $opts->getValue( 'lang' ) );
$this->langcode = $this->lang->getCode();
$this->foreign = !$this->lang->equals( $contLang );
}
/**
- * This function normally does a database query to get the results; we need
+ * This function normally does a database query to get the results; we need
* to make a pretend result using a FakeResultWrapper.
* @param string $offset
* @param int $limit
- * @param bool $descending
+ * @param bool $order
* @return FakeResultWrapper
*/
- function reallyDoQuery( $offset, $limit, $descending ) {
+ function reallyDoQuery( $offset, $limit, $order ) {
+ $asc = ( $order === self::QUERY_ASCENDING );
$result = new FakeResultWrapper( [] );
- $messageNames = $this->getAllMessages( $descending );
+ $messageNames = $this->getAllMessages( $order );
$statuses = self::getCustomisedStatuses( $messageNames, $this->langcode, $this->foreign );
$count = 0;
foreach ( $messageNames as $key ) {
$customised = isset( $statuses['pages'][$key] );
if ( $customised !== $this->custom &&
- ( $descending && ( $key < $offset || !$offset ) || !$descending && $key > $offset ) &&
+ ( $asc && ( $key < $offset || !$offset ) || !$asc && $key > $offset ) &&
( ( $this->prefix && preg_match( $this->prefix, $key ) ) || $this->prefix === false )
) {
- $actual = wfMessage( $key )->inLanguage( $this->langcode )->plain();
- $default = wfMessage( $key )->inLanguage( $this->langcode )->useDatabase( false )->plain();
+ $actual = $this->msg( $key )->inLanguage( $this->lang )->plain();
+ $default = $this->msg( $key )->inLanguage( $this->lang )->useDatabase( false )->plain();
$result->result[] = [
'am_title' => $key,
'am_actual' => $actual,
return '';
}
- /** @return string HTML */
+ /**
+ * @param stdClass $row
+ * @return string HTML
+ */
function formatRow( $row ) {
// Do all the normal stuff
$s = parent::formatRow( $row );
return [];
}
- /** @return array HTML attributes */
+ /**
+ * @param string $field
+ * @param string $value
+ * @return array HTML attributes
+ */
function getCellAttrs( $field, $value ) {
$attr = [];
if ( $field === 'am_title' ) {