MediaWiki  master
DeleteAction.php
Go to the documentation of this file.
1 <?php
29 
36 
40  protected const MSG_REASON_DROPDOWN = 'reason-dropdown';
41  protected const MSG_REASON_DROPDOWN_SUPPRESS = 'reason-dropdown-suppress';
42  protected const MSG_REASON_DROPDOWN_OTHER = 'reason-dropdown-other';
43  protected const MSG_COMMENT = 'comment';
44  protected const MSG_REASON_OTHER = 'reason-other';
45  protected const MSG_SUBMIT = 'submit';
46  protected const MSG_LEGEND = 'legend';
47  protected const MSG_EDIT_REASONS = 'edit-reasons';
48  protected const MSG_EDIT_REASONS_SUPPRESS = 'edit-reasons-suppress';
49 
51  protected $watchlistManager;
52 
54  protected $linkRenderer;
55 
58 
60  protected $readOnlyMode;
61 
63  protected $userOptionsLookup;
64 
67 
71  public function __construct( Page $page, IContextSource $context = null ) {
72  parent::__construct( $page, $context );
73  $services = MediaWikiServices::getInstance();
74  $this->watchlistManager = $services->getWatchlistManager();
75  $this->linkRenderer = $services->getLinkRenderer();
76  $this->backlinkCacheFactory = $services->getBacklinkCacheFactory();
77  $this->readOnlyMode = $services->getReadOnlyMode();
78  $this->userOptionsLookup = $services->getUserOptionsLookup();
79  $this->deletePageFactory = $services->getDeletePageFactory();
80  }
81 
82  public function getName() {
83  return 'delete';
84  }
85 
86  public function onView() {
87  return null;
88  }
89 
90  public function show() {
92  $this->addHelpLink( 'Help:Sysop deleting and undeleting' );
93  $this->tempDelete();
94  }
95 
96  protected function tempDelete() {
97  $article = $this->getArticle();
98  $title = $this->getTitle();
99  $context = $this->getContext();
100  $user = $context->getUser();
101  $request = $context->getRequest();
102  $outputPage = $context->getOutput();
103 
104  $this->runExecuteChecks();
105  $this->prepareOutput( $context->msg( 'delete-confirm', $title->getPrefixedText() ) );
106 
107  # Better double-check that it hasn't been deleted yet!
108  $article->getPage()->loadPageData(
109  $request->wasPosted() ? WikiPage::READ_LATEST : WikiPage::READ_NORMAL
110  );
111  if ( !$article->getPage()->exists() ) {
112  $outputPage->setPageTitle( $context->msg( 'cannotdelete-title', $title->getPrefixedText() ) );
113  $outputPage->wrapWikiMsg( "<div class=\"error mw-error-cannotdelete\">\n$1\n</div>",
114  [ 'cannotdelete', wfEscapeWikiText( $title->getPrefixedText() ) ]
115  );
116  $this->showLogEntries();
117 
118  return;
119  }
120 
121  $token = $request->getVal( 'wpEditToken' );
122  if ( !$request->wasPosted() || !$user->matchEditToken( $token, [ 'delete', $title->getPrefixedText() ] ) ) {
123  $this->tempConfirmDelete();
124  return;
125  }
126 
127  # Flag to hide all contents of the archived revisions
128  $suppress = $request->getCheck( 'wpSuppress' ) &&
129  $context->getAuthority()->isAllowed( 'suppressrevision' );
130 
131  $context = $this->getContext();
132  $deletePage = $this->deletePageFactory->newDeletePage(
133  $this->getWikiPage(),
135  );
136  $status = $deletePage
137  ->setSuppress( $suppress )
138  ->deleteIfAllowed( $this->getDeleteReason() );
139 
140  if ( $status->isGood() ) {
141  $deleted = $this->getTitle()->getPrefixedText();
142 
143  $outputPage->setPageTitle( $this->msg( 'actioncomplete' ) );
144  $outputPage->setRobotPolicy( 'noindex,nofollow' );
145 
146  if ( !$deletePage->deletionWasScheduled() ) {
147  $loglink = '[[Special:Log/delete|' . $this->msg( 'deletionlog' )->text() . ']]';
148  $outputPage->addWikiMsg( 'deletedtext', wfEscapeWikiText( $deleted ), $loglink );
149  $this->getHookRunner()->onArticleDeleteAfterSuccess( $this->getTitle(), $outputPage );
150  } else {
151  $outputPage->addWikiMsg( 'delete-scheduled', wfEscapeWikiText( $deleted ) );
152  }
153 
154  $outputPage->returnToMain();
155  } else {
156  // This branch is also executed when the status is OK but not good, meaning the page couldn't be found (e.g.
157  // because it was deleted in another request)
158  $outputPage->setPageTitle( $this->msg( 'cannotdelete-title', $this->getTitle()->getPrefixedText() ) );
159 
160  $outputPage->wrapWikiTextAsInterface(
161  'error mw-error-cannotdelete',
162  Status::wrap( $status )->getWikiText( false, false, $context->getLanguage() )
163  );
164  $this->showLogEntries();
165  }
166 
167  $this->watchlistManager->setWatch( $request->getCheck( 'wpWatch' ), $context->getAuthority(), $title );
168  }
169 
170  private function showHistoryWarnings(): void {
171  $context = $this->getContext();
172  $title = $this->getTitle();
173 
174  // The following can use the real revision count as this is only being shown for users
175  // that can delete this page.
176  // This, as a side-effect, also makes sure that the following query isn't being run for
177  // pages with a larger history, unless the user has the 'bigdelete' right
178  // (and is about to delete this page).
179  $dbr = wfGetDB( DB_REPLICA );
180  $revisions = (int)$dbr->selectField(
181  'revision',
182  'COUNT(rev_page)',
183  [ 'rev_page' => $title->getArticleID() ],
184  __METHOD__
185  );
186 
187  // @todo i18n issue/patchwork message
188  $context->getOutput()->addHTML(
189  '<strong class="mw-delete-warning-revisions">' .
190  $context->msg( 'historywarning' )->numParams( $revisions )->parse() .
191  $context->msg( 'word-separator' )->escaped() . $this->linkRenderer->makeKnownLink(
192  $title,
193  $context->msg( 'history' )->text(),
194  [],
195  [ 'action' => 'history' ] ) .
196  '</strong>'
197  );
198 
199  if ( $title->isBigDeletion() ) {
201  $context->getOutput()->wrapWikiMsg( "<div class='error'>\n$1\n</div>\n",
202  [
203  'delete-warning-toobig',
205  ]
206  );
207  }
208  }
209 
210  protected function showFormWarnings(): void {
211  $title = $this->getTitle();
212  $outputPage = $this->getOutput();
213 
214  $backlinkCache = $this->backlinkCacheFactory->getBacklinkCache( $title );
215  if ( $backlinkCache->hasLinks( 'pagelinks' ) || $backlinkCache->hasLinks( 'templatelinks' ) ) {
216  $outputPage->addHtml(
218  $outputPage->msg( 'deleting-backlinks-warning' )->parse(),
219  'plainlinks'
220  )
221  );
222  }
223 
224  $subpageQueryLimit = 51;
225  $subpages = $title->getSubpages( $subpageQueryLimit );
226  $subpageCount = count( $subpages );
227  if ( $subpageCount > 0 ) {
228  $outputPage->addHtml(
230  $outputPage->msg( 'deleting-subpages-warning', Message::numParam( $subpageCount ) )->parse(),
231  'plainlinks'
232  )
233  );
234  }
235 
236  $outputPage->addWikiMsg( 'confirmdeletetext' );
237  }
238 
239  private function tempConfirmDelete(): void {
240  $this->prepareOutputForForm();
241  $ctx = $this->getContext();
242  $outputPage = $ctx->getOutput();
243 
244  $reason = $this->getDefaultReason();
245 
246  // If the page has a history, insert a warning
247  if ( $this->pageHasHistory() ) {
248  $this->showHistoryWarnings();
249  }
250  $this->showFormWarnings();
251 
252  // FIXME: Replace (or at least rename) this hook
253  $this->getHookRunner()->onArticleConfirmDelete( $this->getArticle(), $outputPage, $reason );
254 
255  $this->showForm( $reason );
256  $this->showEditReasonsLinks();
257  $this->showLogEntries();
258  }
259 
260  protected function showEditReasonsLinks(): void {
261  if ( $this->getContext()->getAuthority()->isAllowed( 'editinterface' ) ) {
262  $link = '';
263  if ( $this->isSuppressionAllowed() ) {
264  $link .= $this->linkRenderer->makeKnownLink(
265  $this->getFormMsg( self::MSG_REASON_DROPDOWN_SUPPRESS )->inContentLanguage()->getTitle(),
266  $this->getFormMsg( self::MSG_EDIT_REASONS_SUPPRESS )->text(),
267  [],
268  [ 'action' => 'edit' ]
269  );
270  $link .= $this->msg( 'pipe-separator' )->escaped();
271  }
272  $link .= $this->linkRenderer->makeKnownLink(
273  $this->getFormMsg( self::MSG_REASON_DROPDOWN )->inContentLanguage()->getTitle(),
274  $this->getFormMsg( self::MSG_EDIT_REASONS )->text(),
275  [],
276  [ 'action' => 'edit' ]
277  );
278  $this->getOutput()->addHTML( '<p class="mw-delete-editreasons">' . $link . '</p>' );
279  }
280  }
281 
285  protected function isSuppressionAllowed(): bool {
286  return $this->getContext()->getAuthority()->isAllowed( 'suppressrevision' );
287  }
288 
292  protected function showForm( string $reason ): void {
293  $outputPage = $this->getOutput();
294  $user = $this->getUser();
295  $title = $this->getTitle();
296 
297  $checkWatch = $this->userOptionsLookup->getBoolOption( $user, 'watchdeletion' ) ||
298  $this->watchlistManager->isWatched( $user, $title );
299 
300  $fields = [];
301 
302  $dropDownReason = $this->getFormMsg( self::MSG_REASON_DROPDOWN )->inContentLanguage()->text();
303  // Add additional specific reasons for suppress
304  if ( $this->isSuppressionAllowed() ) {
305  $dropDownReason .= "\n" . $this->getFormMsg( self::MSG_REASON_DROPDOWN_SUPPRESS )
306  ->inContentLanguage()->text();
307  }
308 
309  $options = Xml::listDropDownOptions(
310  $dropDownReason,
311  [ 'other' => $this->getFormMsg( self::MSG_REASON_DROPDOWN_OTHER )->inContentLanguage()->text() ]
312  );
313  $options = Xml::listDropDownOptionsOoui( $options );
314 
315  $fields[] = new OOUI\FieldLayout(
316  new OOUI\DropdownInputWidget( [
317  'name' => 'wpDeleteReasonList',
318  'inputId' => 'wpDeleteReasonList',
319  'tabIndex' => 1,
320  'infusable' => true,
321  'value' => '',
322  'options' => $options,
323  ] ),
324  [
325  'label' => $this->getFormMsg( self::MSG_COMMENT )->text(),
326  'align' => 'top',
327  ]
328  );
329 
330  // HTML maxlength uses "UTF-16 code units", which means that characters outside BMP
331  // (e.g. emojis) count for two each. This limit is overridden in JS to instead count
332  // Unicode codepoints.
333  $fields[] = new OOUI\FieldLayout(
334  new OOUI\TextInputWidget( [
335  'name' => 'wpReason',
336  'inputId' => 'wpReason',
337  'tabIndex' => 2,
339  'infusable' => true,
340  'value' => $reason,
341  'autofocus' => true,
342  ] ),
343  [
344  'label' => $this->getFormMsg( self::MSG_REASON_OTHER )->text(),
345  'align' => 'top',
346  ]
347  );
348 
349  if ( $user->isRegistered() ) {
350  $fields[] = new OOUI\FieldLayout(
351  new OOUI\CheckboxInputWidget( [
352  'name' => 'wpWatch',
353  'inputId' => 'wpWatch',
354  'tabIndex' => 3,
355  'selected' => $checkWatch,
356  ] ),
357  [
358  'label' => $this->msg( 'watchthis' )->text(),
359  'align' => 'inline',
360  'infusable' => true,
361  ]
362  );
363  }
364  if ( $this->isSuppressionAllowed() ) {
365  $fields[] = new OOUI\FieldLayout(
366  new OOUI\CheckboxInputWidget( [
367  'name' => 'wpSuppress',
368  'inputId' => 'wpSuppress',
369  'tabIndex' => 4,
370  'selected' => false,
371  ] ),
372  [
373  'label' => $this->msg( 'revdelete-suppress' )->text(),
374  'align' => 'inline',
375  'infusable' => true,
376  ]
377  );
378  }
379 
380  $fields[] = new OOUI\FieldLayout(
381  new OOUI\ButtonInputWidget( [
382  'name' => 'wpConfirmB',
383  'inputId' => 'wpConfirmB',
384  'tabIndex' => 5,
385  'value' => $this->getFormMsg( self::MSG_SUBMIT )->text(),
386  'label' => $this->getFormMsg( self::MSG_SUBMIT )->text(),
387  'flags' => [ 'primary', 'destructive' ],
388  'type' => 'submit',
389  ] ),
390  [
391  'align' => 'top',
392  ]
393  );
394 
395  $fieldset = new OOUI\FieldsetLayout( [
396  'label' => $this->getFormMsg( self::MSG_LEGEND )->text(),
397  'id' => 'mw-delete-table',
398  'items' => $fields,
399  ] );
400 
401  $form = new OOUI\FormLayout( [
402  'method' => 'post',
403  'action' => $this->getFormAction(),
404  'id' => 'deleteconfirm',
405  ] );
406  $form->appendContent(
407  $fieldset,
408  new OOUI\HtmlSnippet(
409  Html::hidden( 'wpEditToken', $user->getEditToken( [ 'delete', $title->getPrefixedText() ] ) )
410  )
411  );
412 
413  $outputPage->addHTML(
414  new OOUI\PanelLayout( [
415  'classes' => [ 'deletepage-wrapper' ],
416  'expanded' => false,
417  'padded' => true,
418  'framed' => true,
419  'content' => $form,
420  ] )
421  );
422  }
423 
427  protected function runExecuteChecks(): void {
428  $permissionStatus = PermissionStatus::newEmpty();
429  if ( !$this->getContext()->getAuthority()->definitelyCan( 'delete', $this->getTitle(), $permissionStatus ) ) {
430  throw new PermissionsError( 'delete', $permissionStatus );
431  }
432 
433  if ( $this->readOnlyMode->isReadOnly() ) {
434  throw new ReadOnlyError;
435  }
436  }
437 
441  protected function getDeleteReason(): string {
442  $deleteReasonList = $this->getRequest()->getText( 'wpDeleteReasonList', 'other' );
443  $deleteReason = $this->getRequest()->getText( 'wpReason' );
444 
445  if ( $deleteReasonList === 'other' ) {
446  return $deleteReason;
447  } elseif ( $deleteReason !== '' ) {
448  // Entry from drop down menu + additional comment
449  $colonseparator = $this->msg( 'colon-separator' )->inContentLanguage()->text();
450  return $deleteReasonList . $colonseparator . $deleteReason;
451  } else {
452  return $deleteReasonList;
453  }
454  }
455 
459  protected function showLogEntries(): void {
460  $deleteLogPage = new LogPage( 'delete' );
461  $outputPage = $this->getContext()->getOutput();
462  $outputPage->addHTML( Xml::element( 'h2', null, $deleteLogPage->getName()->text() ) );
463  LogEventsList::showLogExtract( $outputPage, 'delete', $this->getTitle() );
464  }
465 
469  protected function prepareOutput( Message $pageTitle ): void {
470  $outputPage = $this->getOutput();
471  $outputPage->setPageTitle( $pageTitle );
472  $outputPage->addBacklinkSubtitle( $this->getTitle() );
473  $outputPage->setRobotPolicy( 'noindex,nofollow' );
474  }
475 
476  protected function prepareOutputForForm(): void {
477  $outputPage = $this->getOutput();
478  $outputPage->addModules( 'mediawiki.action.delete' );
479  $outputPage->addModuleStyles( 'mediawiki.action.styles' );
480  $outputPage->enableOOUI();
481  }
482 
486  protected function getFormMessages(): array {
487  return [
488  self::MSG_REASON_DROPDOWN => 'deletereason-dropdown',
489  self::MSG_REASON_DROPDOWN_SUPPRESS => 'deletereason-dropdown-suppress',
490  self::MSG_REASON_DROPDOWN_OTHER => 'deletereasonotherlist',
491  self::MSG_COMMENT => 'deletecomment',
492  self::MSG_REASON_OTHER => 'deleteotherreason',
493  self::MSG_SUBMIT => 'deletepage-submit',
494  self::MSG_LEGEND => 'delete-legend',
495  self::MSG_EDIT_REASONS => 'delete-edit-reasonlist',
496  self::MSG_EDIT_REASONS_SUPPRESS => 'delete-edit-reasonlist-suppress',
497  ];
498  }
499 
504  protected function getFormMsg( string $field ): Message {
505  $messages = $this->getFormMessages();
506  if ( !isset( $messages[$field] ) ) {
507  throw new InvalidArgumentException( "Invalid field $field" );
508  }
509  return $this->msg( $messages[$field] );
510  }
511 
515  protected function getFormAction(): string {
516  return $this->getTitle()->getLocalURL( 'action=delete' );
517  }
518 
524  protected function getDefaultReason(): string {
525  $requestReason = $this->getRequest()->getText( 'wpReason' );
526  if ( $requestReason ) {
527  return $requestReason;
528  }
529 
530  try {
531  return $this->getArticle()->getPage()->getAutoDeleteReason();
532  } catch ( Exception $e ) {
533  # if a page is horribly broken, we still want to be able to
534  # delete it. So be lenient about errors here.
535  // TODO Find out when this can happen and narrow the type in the `catch` clause.
537  return '';
538  }
539  }
540 
546  private function pageHasHistory(): bool {
547  $dbr = wfGetDB( DB_REPLICA );
548  $res = $dbr->selectRowCount(
549  'revision',
550  '*',
551  [
552  'rev_page' => $this->getTitle()->getArticleID(),
553  $dbr->bitAnd( 'rev_deleted', RevisionRecord::DELETED_USER ) . ' = 0'
554  ],
555  __METHOD__,
556  [ 'LIMIT' => 2 ]
557  );
558  return $res > 1;
559  }
560 
561  public function doesWrites() {
562  return true;
563  }
564 }
ReadOnlyError
Show an error when the wiki is locked/read-only and the user tries to do something that requires writ...
Definition: ReadOnlyError.php:29
Message\numParam
static numParam( $num)
Definition: Message.php:1127
Page
Interface for type hinting (accepts WikiPage, Article, ImagePage, CategoryPage)
Definition: Page.php:29
DeleteAction\getDefaultReason
getDefaultReason()
Default reason to be used for the deletion form.
Definition: DeleteAction.php:524
DeleteAction\isSuppressionAllowed
isSuppressionAllowed()
Definition: DeleteAction.php:285
MediaWiki\Revision\RevisionRecord
Page revision base class.
Definition: RevisionRecord.php:47
DeleteAction\getFormMsg
getFormMsg(string $field)
Definition: DeleteAction.php:504
Xml\listDropDownOptionsOoui
static listDropDownOptionsOoui( $options)
Convert options for a drop-down box into a format accepted by OOUI\DropdownInputWidget etc.
Definition: Xml.php:595
FormlessAction
An action which just does something, without showing a form first.
Definition: FormlessAction.php:30
MediaWiki\MediaWikiServices
MediaWikiServices is the service locator for the application scope of MediaWiki.
Definition: MediaWikiServices.php:200
Action\getRequest
getRequest()
Get the WebRequest being used for this instance.
Definition: Action.php:146
MediaWiki\Linker\LinkRenderer
Class that generates HTML links for pages.
Definition: LinkRenderer.php:43
ReadOnlyMode
A service class for fetching the wiki's current read-only mode.
Definition: ReadOnlyMode.php:11
DeleteAction\$watchlistManager
WatchlistManager $watchlistManager
Definition: DeleteAction.php:51
DeleteAction\onView
onView()
Show something on GET request.
Definition: DeleteAction.php:86
getAuthority
getAuthority()
DeleteAction\doesWrites
doesWrites()
Indicates whether this action may perform database writes.
Definition: DeleteAction.php:561
PermissionsError
Show an error when a user tries to do something they do not have the necessary permissions for.
Definition: PermissionsError.php:32
Html\warningBox
static warningBox( $html, $className='')
Return a warning box.
Definition: Html.php:755
DeleteAction\MSG_REASON_DROPDOWN_SUPPRESS
const MSG_REASON_DROPDOWN_SUPPRESS
Definition: DeleteAction.php:41
IContextSource\getAuthority
getAuthority()
$res
$res
Definition: testCompression.php:57
$dbr
$dbr
Definition: testCompression.php:54
DeleteAction\runExecuteChecks
runExecuteChecks()
Definition: DeleteAction.php:427
MWExceptionHandler\logException
static logException(Throwable $e, $catcher=self::CAUGHT_BY_OTHER, $extraData=[])
Log a throwable to the exception log (if enabled).
Definition: MWExceptionHandler.php:700
Action\getContext
getContext()
Get the IContextSource in use here.
Definition: Action.php:132
DeleteAction\showFormWarnings
showFormWarnings()
Definition: DeleteAction.php:210
DeleteAction\$userOptionsLookup
UserOptionsLookup $userOptionsLookup
Definition: DeleteAction.php:63
DeleteAction\MSG_REASON_DROPDOWN
const MSG_REASON_DROPDOWN
Constants used to localize form fields.
Definition: DeleteAction.php:40
DeleteAction\showLogEntries
showLogEntries()
Show deletion log fragments pertaining to the current page.
Definition: DeleteAction.php:459
MessageLocalizer\msg
msg( $key,... $params)
This is the method for getting translated interface messages.
MediaWiki\Watchlist\WatchlistManager
WatchlistManager service.
Definition: WatchlistManager.php:52
Action\getArticle
getArticle()
Get a Article object.
Definition: Action.php:206
DeleteAction\getName
getName()
Return the name of the action this object responds to.
Definition: DeleteAction.php:82
Status\wrap
static wrap( $sv)
Succinct helper method to wrap a StatusValue.
Definition: Status.php:62
wfGetDB
wfGetDB( $db, $groups=[], $wiki=false)
Get a Database object.
Definition: GlobalFunctions.php:2200
DeleteAction\prepareOutput
prepareOutput(Message $pageTitle)
Definition: DeleteAction.php:469
LogPage
Class to simplify the use of log pages.
Definition: LogPage.php:38
Xml\element
static element( $element, $attribs=null, $contents='', $allowShortTag=true)
Format an XML element with given attributes and, optionally, text content.
Definition: Xml.php:41
Article\getPage
getPage()
Get the WikiPage object of this instance.
Definition: Article.php:234
$title
$title
Definition: testCompression.php:38
DeleteAction\MSG_SUBMIT
const MSG_SUBMIT
Definition: DeleteAction.php:45
LogEventsList\showLogExtract
static showLogExtract(&$out, $types=[], $page='', $user='', $param=[])
Show log extract.
Definition: LogEventsList.php:597
DB_REPLICA
const DB_REPLICA
Definition: defines.php:25
DeleteAction\tempDelete
tempDelete()
Definition: DeleteAction.php:96
$wgDeleteRevisionsLimit
$wgDeleteRevisionsLimit
Optional to restrict deletion of pages with higher revision counts to users with the 'bigdelete' perm...
Definition: DefaultSettings.php:6369
Page\DeletePageFactory
Definition: DeletePageFactory.php:10
DeleteAction\showHistoryWarnings
showHistoryWarnings()
Definition: DeleteAction.php:170
DeleteAction\MSG_REASON_DROPDOWN_OTHER
const MSG_REASON_DROPDOWN_OTHER
Definition: DeleteAction.php:42
Action\getWikiPage
getWikiPage()
Get a WikiPage object.
Definition: Action.php:195
DeleteAction\getFormMessages
getFormMessages()
Definition: DeleteAction.php:486
Action\$article
Article $article
Definition: Action.php:59
Html\hidden
static hidden( $name, $value, array $attribs=[])
Convenience function to produce an input element with type=hidden.
Definition: Html.php:831
Action\getUser
getUser()
Shortcut to get the User being used for this instance.
Definition: Action.php:166
Action\$context
IContextSource $context
IContextSource if specified; otherwise we'll use the Context from the Page.
Definition: Action.php:66
DeleteAction\showEditReasonsLinks
showEditReasonsLinks()
Definition: DeleteAction.php:260
DeleteAction\prepareOutputForForm
prepareOutputForForm()
Definition: DeleteAction.php:476
Action\addHelpLink
addHelpLink( $to, $overrideBaseUrl=false)
Adds help link with an icon via page indicators.
Definition: Action.php:432
wfEscapeWikiText
wfEscapeWikiText( $text)
Escapes the given text so that it may be output using addWikiText() without any linking,...
Definition: GlobalFunctions.php:1456
DeleteAction\showForm
showForm(string $reason)
Definition: DeleteAction.php:292
DeleteAction\MSG_LEGEND
const MSG_LEGEND
Definition: DeleteAction.php:46
Action\getTitle
getTitle()
Shortcut to get the Title object from the page.
Definition: Action.php:216
IContextSource\getUser
getUser()
DeleteAction\getDeleteReason
getDeleteReason()
Definition: DeleteAction.php:441
DeleteAction\$readOnlyMode
ReadOnlyMode $readOnlyMode
Definition: DeleteAction.php:60
DeleteAction\MSG_COMMENT
const MSG_COMMENT
Definition: DeleteAction.php:43
MediaWiki\User\UserOptionsLookup
Provides access to user options.
Definition: UserOptionsLookup.php:29
DeleteAction\pageHasHistory
pageHasHistory()
Determines whether a page has a history of more than one revision.
Definition: DeleteAction.php:546
DeleteAction\getFormAction
getFormAction()
Definition: DeleteAction.php:515
IContextSource
Interface for objects which can provide a MediaWiki context on request.
Definition: IContextSource.php:58
MediaWiki\Permissions\PermissionStatus
A StatusValue for permission errors.
Definition: PermissionStatus.php:35
DeleteAction\__construct
__construct(Page $page, IContextSource $context=null)
Only public since 1.21.Stability: stableto callCalling with anything other then Article is deprecated...
Definition: DeleteAction.php:71
CommentStore\COMMENT_CHARACTER_LIMIT
const COMMENT_CHARACTER_LIMIT
Maximum length of a comment in UTF-8 characters.
Definition: CommentStore.php:48
Action\getHookRunner
getHookRunner()
Definition: Action.php:247
Action\$page
WikiPage Article ImagePage CategoryPage Page $page
Page on which we're performing the action.
Definition: Action.php:53
Action\msg
msg( $key,... $params)
Get a Message object with context set Parameters are the same as wfMessage()
Definition: Action.php:228
DeleteAction\$linkRenderer
LinkRenderer $linkRenderer
Definition: DeleteAction.php:54
MediaWiki\Cache\BacklinkCacheFactory
Definition: BacklinkCacheFactory.php:33
Message
The Message class deals with fetching and processing of interface message into a variety of formats.
Definition: Message.php:139
Action\$fields
array $fields
The fields used to create the HTMLForm.
Definition: Action.php:73
DeleteAction\tempConfirmDelete
tempConfirmDelete()
Definition: DeleteAction.php:239
Action\getOutput
getOutput()
Get the OutputPage being used for this instance.
Definition: Action.php:156
DeleteAction
Handle page deletion.
Definition: DeleteAction.php:35
IContextSource\getRequest
getRequest()
Action\useTransactionalTimeLimit
useTransactionalTimeLimit()
Call wfTransactionalTimeLimit() if this request was POSTed.
Definition: Action.php:461
DeleteAction\show
show()
Definition: DeleteAction.php:90
DeleteAction\MSG_EDIT_REASONS
const MSG_EDIT_REASONS
Definition: DeleteAction.php:47
IContextSource\getOutput
getOutput()
DeleteAction\$backlinkCacheFactory
BacklinkCacheFactory $backlinkCacheFactory
Definition: DeleteAction.php:57
DeleteAction\MSG_EDIT_REASONS_SUPPRESS
const MSG_EDIT_REASONS_SUPPRESS
Definition: DeleteAction.php:48
DeleteAction\$deletePageFactory
DeletePageFactory $deletePageFactory
Definition: DeleteAction.php:66
IContextSource\getLanguage
getLanguage()
Xml\listDropDownOptions
static listDropDownOptions( $list, $params=[])
Build options for a drop-down box from a textual list.
Definition: Xml.php:545
DeleteAction\MSG_REASON_OTHER
const MSG_REASON_OTHER
Definition: DeleteAction.php:44