Merge "mediawiki.api.messages: Fix typo in comments"
[lhc/web/wiklou.git] / includes / specials / SpecialUnusedimages.php
index 6c8f6c5..2cc1a7b 100644 (file)
@@ -30,45 +30,46 @@ class UnusedimagesPage extends ImageQueryPage {
        function __construct( $name = 'Unusedimages' ) {
                parent::__construct( $name );
        }
-       
+
        function isExpensive() {
                return true;
        }
-       
+
        function sortDescending() {
                return false;
        }
-       
+
        function isSyndicated() {
                return false;
        }
 
        function getQueryInfo() {
-               global $wgCountCategorizedImagesAsUsed;
-               $retval = array (
-                       'tables' => array ( 'image', 'imagelinks' ),
-                       'fields' => array ( "'" . NS_FILE . "' AS namespace",
-                                       'img_name AS title',
-                                       'img_timestamp AS value',
-                                       'img_user', 'img_user_text',
-                                       'img_description' ),
-                       'conds' => array ( 'il_to IS NULL' ),
-                       'join_conds' => array ( 'imagelinks' => array (
-                                       'LEFT JOIN', 'il_to = img_name' ) )
-               );
+               $retval = [
+                       'tables' => [ 'image', 'imagelinks' ],
+                       'fields' => [
+                               'namespace' => NS_FILE,
+                               'title' => 'img_name',
+                               'value' => 'img_timestamp',
+                               'img_user', 'img_user_text',
+                               'img_description'
+                       ],
+                       'conds' => [ 'il_to IS NULL' ],
+                       'join_conds' => [ 'imagelinks' => [ 'LEFT JOIN', 'il_to = img_name' ] ]
+               ];
 
-               if ( $wgCountCategorizedImagesAsUsed ) {
+               if ( $this->getConfig()->get( 'CountCategorizedImagesAsUsed' ) ) {
                        // Order is significant
-                       $retval['tables'] = array ( 'image', 'page', 'categorylinks',
-                                       'imagelinks' );
+                       $retval['tables'] = [ 'image', 'page', 'categorylinks',
+                               'imagelinks' ];
                        $retval['conds']['page_namespace'] = NS_FILE;
                        $retval['conds'][] = 'cl_from IS NULL';
                        $retval['conds'][] = 'img_name = page_title';
-                       $retval['join_conds']['categorylinks'] = array (
-                                       'LEFT JOIN', 'cl_from = page_id' );
-                       $retval['join_conds']['imagelinks'] = array (
-                                       'LEFT JOIN', 'il_to = page_title' );
+                       $retval['join_conds']['categorylinks'] = [
+                               'LEFT JOIN', 'cl_from = page_id' ];
+                       $retval['join_conds']['imagelinks'] = [
+                               'LEFT JOIN', 'il_to = page_title' ];
                }
+
                return $retval;
        }
 
@@ -77,7 +78,10 @@ class UnusedimagesPage extends ImageQueryPage {
        }
 
        function getPageHeader() {
-               return wfMsgExt( 'unusedimagestext', array( 'parse' ) );
+               return $this->msg( 'unusedimagestext' )->parseAsBlock();
        }
 
+       protected function getGroupName() {
+               return 'maintenance';
+       }
 }