Merge "Added a separate error message for mkdir failures"
[lhc/web/wiklou.git] / includes / page / Article.php
index 16328bc..33f7d47 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,28 +1669,28 @@ 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' );
+
                $backlinkCache = $title->getBacklinkCache();
                if ( $backlinkCache->hasLinks( 'pagelinks' ) || $backlinkCache->hasLinks( 'templatelinks' ) ) {
                        $outputPage->wrapWikiMsg( "<div class='mw-warning plainlinks'>\n$1\n</div>\n",
                                'deleting-backlinks-warning' );
                }
+
+               $subpageQueryLimit = 51;
+               $subpages = $title->getSubpages( $subpageQueryLimit );
+               $subpageCount = count( $subpages );
+               if ( $subpageCount > 0 ) {
+                       $outputPage->wrapWikiMsg( "<div class='mw-warning plainlinks'>\n$1\n</div>\n",
+                               [ 'deleting-subpages-warning', Message::numParam( $subpageCount ) ] );
+               }
                $outputPage->addWikiMsg( 'confirmdeletetext' );
 
                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();
@@ -1761,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',