$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 );
[ '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 );
$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();
);
}
+ 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',
/**
* 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 ) {
/**
* @param array $limit
* @param array $expiry
- * @param bool $cascade
+ * @param bool &$cascade
* @param string $reason
* @param User $user
* @return Status
/**
* @param array $limit
* @param string $reason
- * @param int $cascade
+ * @param int &$cascade
* @param array $expiry
* @return bool
*/
* @param bool $suppress
* @param int $u1 Unused
* @param bool $u2 Unused
- * @param string $error
+ * @param string &$error
* @return bool
*/
public function doDeleteArticle(
* @param string $summary
* @param string $token
* @param bool $bot
- * @param array $resultDetails
+ * @param array &$resultDetails
* @param User|null $user
* @return array
*/
* @param string $fromP
* @param string $summary
* @param bool $bot
- * @param array $resultDetails
+ * @param array &$resultDetails
* @param User|null $guser
* @return array
*/
}
/**
- * @param bool $hasHistory
+ * @param bool &$hasHistory
* @return mixed
*/
public function generateReason( &$hasHistory ) {