Merge "Remove unused imports from test classes"
[lhc/web/wiklou.git] / includes / page / Article.php
index 4bcb655..a493854 100644 (file)
@@ -1673,6 +1673,15 @@ class Article implements Page {
                $title = $this->getTitle();
                $ctx = $this->getContext();
                $outputPage = $ctx->getOutput();
+               if ( !wfMessage( 'deletereason-dropdown' )->inContentLanguage()->isDisabled() ) {
+                       $reasonsList = Xml::getArrayFromWikiTextList(
+                               wfMessage( 'deletereason-dropdown' )->inContentLanguage()->text()
+                       );
+                       $outputPage->addModules( 'mediawiki.reasonSuggest' );
+                       $outputPage->addJsConfigVars( [
+                               'reasons' => $reasonsList
+                       ] );
+               }
                $useMediaWikiUIEverywhere = $ctx->getConfig()->get( 'UseMediaWikiUIEverywhere' );
                $outputPage->setPageTitle( wfMessage( 'delete-confirm', $title->getPrefixedText() ) );
                $outputPage->addBacklinkSubtitle( $title );
@@ -1687,7 +1696,6 @@ class Article implements Page {
                Hooks::run( 'ArticleConfirmDelete', [ $this, $outputPage, &$reason ] );
 
                $user = $this->getContext()->getUser();
-
                if ( $user->isAllowed( 'suppressrevision' ) ) {
                        $suppress = Html::openElement( 'div', [ 'id' => 'wpDeleteSuppressRow' ] ) .
                                Xml::checkLabel( wfMessage( 'revdelete-suppress' )->text(),
@@ -1697,7 +1705,6 @@ class Article implements Page {
                        $suppress = '';
                }
                $checkWatch = $user->getBoolOption( 'watchdeletion' ) || $user->isWatched( $title );
-
                $form = Html::openElement( 'form', [ 'method' => 'post',
                        'action' => $title->getLocalURL( 'action=delete' ), 'id' => 'deleteconfirm' ] ) .
                        Html::openElement( 'fieldset', [ 'id' => 'mw-delete-table' ] ) .