X-Git-Url: http://git.cyclocoop.org/%27%20.%20%24prefix%20.%20Wiki::transformTitleToURI%28%24matches%5B1%5D%29%20.%20%27?a=blobdiff_plain;f=includes%2FProtectionForm.php;h=4bead3464c52e3f0a81cb9953e281f54657f315c;hb=49c618d833d727fbc9dbcc5279d5f7f3b98f2a34;hp=7972a1ebe45a0c7ec23157ad588b503480858ccd;hpb=f5e45bb6d75d6df49fc2285877487ad74d095bf1;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/ProtectionForm.php b/includes/ProtectionForm.php index 7972a1ebe4..4bead3464c 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' ); } @@ -196,7 +200,7 @@ class ProtectionForm { /** * Show the input form with optional error message * - * @param string|null $err Error message or null if there's no error + * @param string|string[]|null $err Error message or null if there's no error */ function show( $err = null ) { $out = $this->mContext->getOutput(); @@ -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() );