X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialUnusedimages.php;h=2cc1a7b0e86017080b4b3b65ceefca543af95fe2;hb=8b220cb5b6c5d3779b20a1d59de97291ece80282;hp=743c5878f1a9b106dd1092bf20179476d7923c66;hpb=3e326854f24c7f0bcc9a858523f2189799f53cbd;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialUnusedimages.php b/includes/specials/SpecialUnusedimages.php index 743c5878f1..bcb3b85e36 100644 --- a/includes/specials/SpecialUnusedimages.php +++ b/includes/specials/SpecialUnusedimages.php @@ -44,31 +44,28 @@ class UnusedimagesPage extends ImageQueryPage { } function getQueryInfo() { - global $wgCountCategorizedImagesAsUsed; - $retval = array( - 'tables' => array( 'image', 'imagelinks' ), - 'fields' => array( + $retval = [ + 'tables' => [ 'image', 'imagelinks' ], + 'fields' => [ 'namespace' => NS_FILE, 'title' => 'img_name', 'value' => 'img_timestamp', - 'img_user', 'img_user_text', - 'img_description' - ), - 'conds' => array( 'il_to IS NULL' ), - 'join_conds' => array( 'imagelinks' => array( 'LEFT JOIN', 'il_to = img_name' ) ) - ); + ], + '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; @@ -79,6 +76,11 @@ class UnusedimagesPage extends ImageQueryPage { } function getPageHeader() { + if ( $this->getConfig()->get( 'CountCategorizedImagesAsUsed' ) ) { + return $this->msg( + 'unusedimagestext-categorizedimgisused' + )->parseAsBlock(); + } return $this->msg( 'unusedimagestext' )->parseAsBlock(); }