* 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();
* 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' );
}
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()
);
/**
* Show protection long extracts for this page
*
- * @param OutputPage &$out
- * @private
+ * @param OutputPage $out
*/
- function showLogExtract( &$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() ) );