X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2FProtectionForm.php;h=2f1059886d4378c9133b1f16704f8c75b6948c62;hp=0e18e46a3b2a21d76e3f8cf4ad6970fc07010508;hb=a9164f143a59a8d957a1d7f205715ac57fff3c8c;hpb=787da207a297714551fec2e518d67fbe3e957d60 diff --git a/includes/ProtectionForm.php b/includes/ProtectionForm.php index 0e18e46a3b..2f1059886d 100644 --- a/includes/ProtectionForm.php +++ b/includes/ProtectionForm.php @@ -90,7 +90,7 @@ class ProtectionForm { * Loads the current state of protection into the object. */ function loadData() { - $levels = MWNamespace::getRestrictionLevels( + $levels = MediaWikiServices::getInstance()->getNamespaceInfo()->getRestrictionLevels( $this->mTitle->getNamespace(), $this->mContext->getUser() ); $this->mCascade = $this->mTitle->areRestrictionsCascading(); @@ -179,7 +179,11 @@ class ProtectionForm { * Main entry point for action=protect and action=unprotect */ function execute() { - if ( MWNamespace::getRestrictionLevels( $this->mTitle->getNamespace() ) === [ '' ] ) { + if ( + MediaWikiServices::getInstance()->getNamespaceInfo()->getRestrictionLevels( + $this->mTitle->getNamespace() + ) === [ '' ] + ) { throw new ErrorPageError( 'protect-badnamespace-title', 'protect-badnamespace-text' ); } @@ -581,7 +585,8 @@ class ProtectionForm { function buildSelector( $action, $selected ) { // If the form is disabled, display all relevant levels. Otherwise, // just show the ones this user can use. - $levels = MWNamespace::getRestrictionLevels( $this->mTitle->getNamespace(), + $levels = MediaWikiServices::getInstance()->getNamespaceInfo()->getRestrictionLevels( + $this->mTitle->getNamespace(), $this->disabled ? null : $this->mContext->getUser() ); @@ -623,9 +628,8 @@ class ProtectionForm { * Show protection long extracts for this page * * @param OutputPage $out - * @private */ - function showLogExtract( OutputPage $out ) { + private function showLogExtract( OutputPage $out ) { # Show relevant lines from the protection log: $protectLogPage = new LogPage( 'protect' ); $out->addHTML( Xml::element( 'h2', null, $protectLogPage->getName()->text() ) );