Merge "Change 'editfont' default preference to 'monospace'"
[lhc/web/wiklou.git] / includes / page / Article.php
index d13fb3c..f52cd8d 100644 (file)
@@ -1180,7 +1180,7 @@ class Article implements Page {
                $key = $cache->makeKey( 'page-recent-delete', md5( $title->getPrefixedText() ) );
                $loggedIn = $this->getContext()->getUser()->isLoggedIn();
                if ( $loggedIn || $cache->get( $key ) ) {
-                       $logTypes = [ 'delete', 'move' ];
+                       $logTypes = [ 'delete', 'move', 'protect' ];
 
                        $dbr = wfGetDB( DB_REPLICA );
 
@@ -1594,7 +1594,7 @@ class Article implements Page {
                        [ 'delete', $this->getTitle()->getPrefixedText() ] )
                ) {
                        # Flag to hide all contents of the archived revisions
-                       $suppress = $request->getVal( 'wpSuppress' ) && $user->isAllowed( 'suppressrevision' );
+                       $suppress = $request->getCheck( 'wpSuppress' ) && $user->isAllowed( 'suppressrevision' );
 
                        $this->doDelete( $reason, $suppress );
 
@@ -1669,7 +1669,6 @@ class Article implements Page {
                $title = $this->getTitle();
                $ctx = $this->getContext();
                $outputPage = $ctx->getOutput();
-               $useMediaWikiUIEverywhere = $ctx->getConfig()->get( 'UseMediaWikiUIEverywhere' );
                $outputPage->setPageTitle( wfMessage( 'delete-confirm', $title->getPrefixedText() ) );
                $outputPage->addBacklinkSubtitle( $title );
                $outputPage->setRobotPolicy( 'noindex,nofollow' );
@@ -1692,14 +1691,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(),
-                                       'wpSuppress', 'wpSuppress', false, [ 'tabindex' => '4' ] ) .
-                               Html::closeElement( 'div' );
-               } else {
-                       $suppress = '';
-               }
                $checkWatch = $user->getBoolOption( 'watchdeletion' ) || $user->isWatched( $title );
 
                $outputPage->enableOOUI();
@@ -1770,6 +1761,21 @@ class Article implements Page {
                        );
                }
 
+               if ( $user->isAllowed( 'suppressrevision' ) ) {
+                       $fields[] = new OOUI\FieldLayout(
+                               new OOUI\CheckboxInputWidget( [
+                                       'name' => 'wpSuppress',
+                                       'inputId' => 'wpSuppress',
+                                       'tabIndex' => 4,
+                               ] ),
+                               [
+                                       'label' => $ctx->msg( 'revdelete-suppress' )->text(),
+                                       'align' => 'inline',
+                                       'infusable' => true,
+                               ]
+                       );
+               }
+
                $fields[] = new OOUI\FieldLayout(
                        new OOUI\ButtonInputWidget( [
                                'name' => 'wpConfirmB',
@@ -1914,7 +1920,7 @@ class Article implements Page {
 
        /**
         * Check if the page can be cached
-        * @param integer $mode One of the HTMLFileCache::MODE_* constants (since 1.28)
+        * @param int $mode One of the HTMLFileCache::MODE_* constants (since 1.28)
         * @return bool
         */
        public function isFileCacheable( $mode = HTMLFileCache::MODE_NORMAL ) {
@@ -2574,7 +2580,7 @@ class Article implements Page {
        /**
         * @param array $limit
         * @param array $expiry
-        * @param bool $cascade
+        * @param bool &$cascade
         * @param string $reason
         * @param User $user
         * @return Status
@@ -2588,7 +2594,7 @@ class Article implements Page {
        /**
         * @param array $limit
         * @param string $reason
-        * @param int $cascade
+        * @param int &$cascade
         * @param array $expiry
         * @return bool
         */
@@ -2609,7 +2615,7 @@ class Article implements Page {
         * @param bool $suppress
         * @param int $u1 Unused
         * @param bool $u2 Unused
-        * @param string $error
+        * @param string &$error
         * @return bool
         */
        public function doDeleteArticle(
@@ -2623,7 +2629,7 @@ class Article implements Page {
         * @param string $summary
         * @param string $token
         * @param bool $bot
-        * @param array $resultDetails
+        * @param array &$resultDetails
         * @param User|null $user
         * @return array
         */
@@ -2636,7 +2642,7 @@ class Article implements Page {
         * @param string $fromP
         * @param string $summary
         * @param bool $bot
-        * @param array $resultDetails
+        * @param array &$resultDetails
         * @param User|null $guser
         * @return array
         */
@@ -2646,7 +2652,7 @@ class Article implements Page {
        }
 
        /**
-        * @param bool $hasHistory
+        * @param bool &$hasHistory
         * @return mixed
         */
        public function generateReason( &$hasHistory ) {