Merge "maintenance: Script to rename titles for Unicode uppercasing changes"
[lhc/web/wiklou.git] / includes / specials / pagers / AllMessagesTablePager.php
index f045333..76e2ab7 100644 (file)
@@ -167,29 +167,30 @@ class AllMessagesTablePager extends TablePager {
        }
 
        /**
-        *  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 ) {
-               $result = new FakeResultWrapper( [] );
+       function reallyDoQuery( $offset, $limit, $order ) {
+               $asc = ( $order === self::QUERY_ASCENDING );
 
-               $messageNames = $this->getAllMessages( $descending );
+               $messageNames = $this->getAllMessages( $order );
                $statuses = self::getCustomisedStatuses( $messageNames, $this->langcode, $this->foreign );
 
+               $rows = [];
                $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->lang )->plain();
-                               $default = wfMessage( $key )->inLanguage( $this->lang )->useDatabase( false )->plain();
-                               $result->result[] = [
+                               $actual = $this->msg( $key )->inLanguage( $this->lang )->plain();
+                               $default = $this->msg( $key )->inLanguage( $this->lang )->useDatabase( false )->plain();
+                               $rows[] = [
                                        'am_title' => $key,
                                        'am_actual' => $actual,
                                        'am_default' => $default,
@@ -204,7 +205,7 @@ class AllMessagesTablePager extends TablePager {
                        }
                }
 
-               return $result;
+               return new FakeResultWrapper( $rows );
        }
 
        protected function getStartBody() {