X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FProtectionForm.php;h=53608e849a39eb720f3c155c09ca4682f81b73e8;hb=c2720d56865fb62e7044620b2d18ac71815c2dc2;hp=bcf4dda98ade783c1a1d24bfa58dbf636c8af57e;hpb=93222688610be9735eb53aef30683e1c231b2833;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/ProtectionForm.php b/includes/ProtectionForm.php index bcf4dda98a..53608e849a 100644 --- a/includes/ProtectionForm.php +++ b/includes/ProtectionForm.php @@ -22,6 +22,7 @@ * * @file */ +use MediaWiki\MediaWikiServices; /** * Handles the page protection UI and backend @@ -182,21 +183,10 @@ class ProtectionForm { throw new ErrorPageError( 'protect-badnamespace-title', 'protect-badnamespace-text' ); } - $out = $this->mContext->getOutput(); - if ( !wfMessage( 'protect-dropdown' )->inContentLanguage()->isDisabled() ) { - $reasonsList = Xml::getArrayFromWikiTextList( - wfMessage( 'protect-dropdown' )->inContentLanguage()->text() - ); - $out->addModules( 'mediawiki.reasonSuggest' ); - $out->addJsConfigVars( [ - 'reasons' => $reasonsList - ] ); - } - if ( $this->mContext->getRequest()->wasPosted() ) { if ( $this->save() ) { $q = $this->mArticle->isRedirect() ? 'redirect=no' : ''; - $out->redirect( $this->mTitle->getFullURL( $q ) ); + $this->mContext->getOutput()->redirect( $this->mTitle->getFullURL( $q ) ); } } else { $this->show(); @@ -554,9 +544,10 @@ class ProtectionForm { $out .= Xml::closeElement( 'fieldset' ); if ( $user->isAllowed( 'editinterface' ) ) { - $link = Linker::linkKnown( + $linkRenderer = MediaWikiServices::getInstance()->getLinkRenderer(); + $link = $linkRenderer->makeKnownLink( $context->msg( 'protect-dropdown' )->inContentLanguage()->getTitle(), - $context->msg( 'protect-edit-reasonlist' )->escaped(), + $context->msg( 'protect-edit-reasonlist' )->text(), [], [ 'action' => 'edit' ] ); @@ -625,7 +616,7 @@ class ProtectionForm { /** * Show protection long extracts for this page * - * @param OutputPage $out + * @param OutputPage &$out * @access private */ function showLogExtract( &$out ) {