X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Fspecials%2FSpecialNewpages.php;h=493f6dbf0845683274276345816fdd8a14d42509;hp=04db7040dc3d2c6dd045622e68101407526c85ca;hb=54c93f1d384cd5accd2db2ebbb911e4d627c2980;hpb=31634739695493e929eeb6c8c1b7fd9c3f5bf826 diff --git a/includes/specials/SpecialNewpages.php b/includes/specials/SpecialNewpages.php index 04db7040dc..493f6dbf08 100644 --- a/includes/specials/SpecialNewpages.php +++ b/includes/specials/SpecialNewpages.php @@ -21,6 +21,8 @@ * @ingroup SpecialPage */ +use MediaWiki\MediaWikiServices; + /** * A special page that list newly created pages * @@ -56,6 +58,7 @@ class SpecialNewpages extends IncludableSpecialPage { $opts->add( 'feed', '' ); $opts->add( 'tagfilter', '' ); $opts->add( 'invert', false ); + $opts->add( 'associated', false ); $opts->add( 'size-mode', 'max' ); $opts->add( 'size', 0 ); @@ -183,7 +186,9 @@ class SpecialNewpages extends IncludableSpecialPage { } // Disable some if needed - if ( !User::groupHasPermission( '*', 'createpage' ) ) { + if ( !MediaWikiServices::getInstance()->getPermissionManager() + ->groupHasPermission( '*', 'createpage' ) + ) { unset( $filters['hideliu'] ); } if ( !$this->getUser()->useNPPatrol() ) { @@ -229,6 +234,7 @@ class SpecialNewpages extends IncludableSpecialPage { $username = $this->opts->consumeValue( 'username' ); $tagFilterVal = $this->opts->consumeValue( 'tagfilter' ); $nsinvert = $this->opts->consumeValue( 'invert' ); + $nsassociated = $this->opts->consumeValue( 'associated' ); $size = $this->opts->consumeValue( 'size' ); $max = $this->opts->consumeValue( 'size-mode' ) === 'max'; @@ -251,6 +257,13 @@ class SpecialNewpages extends IncludableSpecialPage { 'default' => $nsinvert, 'tooltip' => 'invert', ], + 'nsassociated' => [ + 'type' => 'check', + 'name' => 'associated', + 'label-message' => 'namespace_association', + 'default' => $nsassociated, + 'tooltip' => 'namespace_association', + ], 'tagFilter' => [ 'type' => 'tagfilter', 'name' => 'tagfilter',