X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialFewestrevisions.php;h=b86a95e8aaa6d994f9498206cbe73a7e2b2fb84c;hb=858183e87a86aabbaa165c1d8b3665a9a7d6d688;hp=5366e3b4c6a2fa008bd951089c57e3dd2d4aa9f8;hpb=073a675adfc984835fd0cab406b9ca9f5d45355c;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialFewestrevisions.php b/includes/specials/SpecialFewestrevisions.php index 5366e3b4c6..b86a95e8aa 100644 --- a/includes/specials/SpecialFewestrevisions.php +++ b/includes/specials/SpecialFewestrevisions.php @@ -28,12 +28,11 @@ * @author Martin Drashkov */ class FewestrevisionsPage extends QueryPage { - function __construct( $name = 'Fewestrevisions' ) { parent::__construct( $name ); } - function isExpensive() { + public function isExpensive() { return true; } @@ -41,23 +40,28 @@ class FewestrevisionsPage extends QueryPage { return false; } - function getQueryInfo() { - return array ( - 'tables' => array ( 'revision', 'page' ), - 'fields' => array ( 'namespace' => 'page_namespace', - 'title' => 'page_title', - 'value' => 'COUNT(*)', - 'redirect' => 'page_is_redirect' ), - 'conds' => array ( 'page_namespace' => MWNamespace::getContentNamespaces(), - 'page_id = rev_page' ), - 'options' => array ( 'HAVING' => 'COUNT(*) > 1', - // ^^^ This was probably here to weed out redirects. - // Since we mark them as such now, it might be - // useful to remove this. People _do_ create pages - // and never revise them, they aren't necessarily - // redirects. - 'GROUP BY' => array( 'page_namespace', 'page_title', 'page_is_redirect' ) ) - ); + public function getQueryInfo() { + return [ + 'tables' => [ 'revision', 'page' ], + 'fields' => [ + 'namespace' => 'page_namespace', + 'title' => 'page_title', + 'value' => 'COUNT(*)', + 'redirect' => 'page_is_redirect' + ], + 'conds' => [ + 'page_namespace' => MWNamespace::getContentNamespaces(), + 'page_id = rev_page' ], + 'options' => [ + 'HAVING' => 'COUNT(*) > 1', + // ^^^ This was probably here to weed out redirects. + // Since we mark them as such now, it might be + // useful to remove this. People _do_ create pages + // and never revise them, they aren't necessarily + // redirects. + 'GROUP BY' => [ 'page_namespace', 'page_title', 'page_is_redirect' ] + ] + ]; } function sortDescending() { @@ -65,17 +69,24 @@ class FewestrevisionsPage extends QueryPage { } /** - * @param $skin Skin object - * @param $result Object: database row - * @return String + * @param Skin $skin + * @param object $result Database row + * @return string */ function formatResult( $skin, $result ) { global $wgContLang; $nt = Title::makeTitleSafe( $result->namespace, $result->title ); - if( !$nt ) { - return Html::element( 'span', array( 'class' => 'mw-invalidtitle' ), - Linker::getInvalidTitleDescription( $this->getContext(), $result->namespace, $result->title ) ); + if ( !$nt ) { + return Html::element( + 'span', + [ 'class' => 'mw-invalidtitle' ], + Linker::getInvalidTitleDescription( + $this->getContext(), + $result->namespace, + $result->title + ) + ); } $text = htmlspecialchars( $wgContLang->convert( $nt->getPrefixedText() ) ); @@ -87,10 +98,14 @@ class FewestrevisionsPage extends QueryPage { $nlink = Linker::linkKnown( $nt, $nl, - array(), - array( 'action' => 'history' ) + [], + [ 'action' => 'history' ] ) . $redirect; return $this->getLanguage()->specialList( $plink, $nlink ); } + + protected function getGroupName() { + return 'maintenance'; + } }