MediaWiki  1.23.0
SpecialRevisiondelete.php
Go to the documentation of this file.
1 <?php
32  protected $wasSaved = false;
33 
35  private $submitClicked;
36 
38  private $ids;
39 
41  private $archiveName;
42 
44  private $token;
45 
47  private $targetObj;
48 
50  private $typeName;
51 
53  private $checks;
54 
56  private $typeLabels;
57 
59  private $revDelList;
60 
62  private $mIsAllowed;
63 
65  private $otherReason;
66 
70  private static $UILabels = array(
71  'revision' => array(
72  'check-label' => 'revdelete-hide-text',
73  'success' => 'revdelete-success',
74  'failure' => 'revdelete-failure',
75  'text' => 'revdelete-text-text',
76  'selected'=> 'revdelete-selected-text',
77  ),
78  'archive' => array(
79  'check-label' => 'revdelete-hide-text',
80  'success' => 'revdelete-success',
81  'failure' => 'revdelete-failure',
82  'text' => 'revdelete-text-text',
83  'selected'=> 'revdelete-selected-text',
84  ),
85  'oldimage' => array(
86  'check-label' => 'revdelete-hide-image',
87  'success' => 'revdelete-success',
88  'failure' => 'revdelete-failure',
89  'text' => 'revdelete-text-file',
90  'selected'=> 'revdelete-selected-file',
91  ),
92  'filearchive' => array(
93  'check-label' => 'revdelete-hide-image',
94  'success' => 'revdelete-success',
95  'failure' => 'revdelete-failure',
96  'text' => 'revdelete-text-file',
97  'selected'=> 'revdelete-selected-file',
98  ),
99  'logging' => array(
100  'check-label' => 'revdelete-hide-name',
101  'success' => 'logdelete-success',
102  'failure' => 'logdelete-failure',
103  'text' => 'logdelete-text',
104  'selected' => 'logdelete-selected',
105  ),
106  );
107 
108  public function __construct() {
109  parent::__construct( 'Revisiondelete', 'deletedhistory' );
110  }
111 
112  public function execute( $par ) {
113  $this->checkPermissions();
114  $this->checkReadOnly();
115 
116  $output = $this->getOutput();
117  $user = $this->getUser();
118 
119  $this->setHeaders();
120  $this->outputHeader();
121  $request = $this->getRequest();
122  $this->submitClicked = $request->wasPosted() && $request->getBool( 'wpSubmit' );
123  # Handle our many different possible input types.
124  $ids = $request->getVal( 'ids' );
125  if ( !is_null( $ids ) ) {
126  # Allow CSV, for backwards compatibility, or a single ID for show/hide links
127  $this->ids = explode( ',', $ids );
128  } else {
129  # Array input
130  $this->ids = array_keys( $request->getArray( 'ids', array() ) );
131  }
132  // $this->ids = array_map( 'intval', $this->ids );
133  $this->ids = array_unique( array_filter( $this->ids ) );
134 
135  if ( $request->getVal( 'action' ) == 'historysubmit' || $request->getVal( 'action' ) == 'revisiondelete' ) {
136  // For show/hide form submission from history page
137  // Since we are access through index.php?title=XXX&action=historysubmit
138  // getFullTitle() will contain the target title and not our title
139  $this->targetObj = $this->getFullTitle();
140  $this->typeName = 'revision';
141  } else {
142  $this->typeName = $request->getVal( 'type' );
143  $this->targetObj = Title::newFromText( $request->getText( 'target' ) );
144  }
145 
146  # For reviewing deleted files...
147  $this->archiveName = $request->getVal( 'file' );
148  $this->token = $request->getVal( 'token' );
149  if ( $this->archiveName && $this->targetObj ) {
150  $this->tryShowFile( $this->archiveName );
151 
152  return;
153  }
154 
155  $this->typeName = RevisionDeleter::getCanonicalTypeName( $this->typeName );
156 
157  # No targets?
158  if ( !$this->typeName || count( $this->ids ) == 0 ) {
159  throw new ErrorPageError( 'revdelete-nooldid-title', 'revdelete-nooldid-text' );
160  }
161  $this->typeLabels = self::$UILabels[$this->typeName];
162  $this->mIsAllowed = $user->isAllowed( RevisionDeleter::getRestriction( $this->typeName ) );
163 
164  # Allow the list type to adjust the passed target
165  $this->targetObj = RevisionDeleter::suggestTarget( $this->typeName, $this->targetObj, $this->ids );
166 
167  $this->otherReason = $request->getVal( 'wpReason' );
168  # We need a target page!
169  if ( is_null( $this->targetObj ) ) {
170  $output->addWikiMsg( 'undelete-header' );
171 
172  return;
173  }
174  # Give a link to the logs/hist for this page
175  $this->showConvenienceLinks();
176 
177  # Initialise checkboxes
178  $this->checks = array(
179  # Messages: revdelete-hide-text, revdelete-hide-image, revdelete-hide-name
180  array( $this->typeLabels['check-label'], 'wpHidePrimary',
181  RevisionDeleter::getRevdelConstant( $this->typeName )
182  ),
183  array( 'revdelete-hide-comment', 'wpHideComment', Revision::DELETED_COMMENT ),
184  array( 'revdelete-hide-user', 'wpHideUser', Revision::DELETED_USER )
185  );
186  if ( $user->isAllowed( 'suppressrevision' ) ) {
187  $this->checks[] = array( 'revdelete-hide-restricted',
188  'wpHideRestricted', Revision::DELETED_RESTRICTED );
189  }
190 
191  # Either submit or create our form
192  if ( $this->mIsAllowed && $this->submitClicked ) {
193  $this->submit( $request );
194  } else {
195  $this->showForm();
196  }
197 
198  $qc = $this->getLogQueryCond();
199  # Show relevant lines from the deletion log
200  $deleteLogPage = new LogPage( 'delete' );
201  $output->addHTML( "<h2>" . $deleteLogPage->getName()->escaped() . "</h2>\n" );
203  $output,
204  'delete',
205  $this->targetObj,
206  '', /* user */
207  array( 'lim' => 25, 'conds' => $qc, 'useMaster' => $this->wasSaved )
208  );
209  # Show relevant lines from the suppression log
210  if ( $user->isAllowed( 'suppressionlog' ) ) {
211  $suppressLogPage = new LogPage( 'suppress' );
212  $output->addHTML( "<h2>" . $suppressLogPage->getName()->escaped() . "</h2>\n" );
214  $output,
215  'suppress',
216  $this->targetObj,
217  '',
218  array( 'lim' => 25, 'conds' => $qc, 'useMaster' => $this->wasSaved )
219  );
220  }
221  }
222 
226  protected function showConvenienceLinks() {
227  # Give a link to the logs/hist for this page
228  if ( $this->targetObj ) {
229  // Also set header tabs to be for the target.
230  $this->getSkin()->setRelevantTitle( $this->targetObj );
231 
232  $links = array();
233  $links[] = Linker::linkKnown(
234  SpecialPage::getTitleFor( 'Log' ),
235  $this->msg( 'viewpagelogs' )->escaped(),
236  array(),
237  array( 'page' => $this->targetObj->getPrefixedText() )
238  );
239  if ( !$this->targetObj->isSpecialPage() ) {
240  # Give a link to the page history
241  $links[] = Linker::linkKnown(
242  $this->targetObj,
243  $this->msg( 'pagehist' )->escaped(),
244  array(),
245  array( 'action' => 'history' )
246  );
247  # Link to deleted edits
248  if ( $this->getUser()->isAllowed( 'undelete' ) ) {
249  $undelete = SpecialPage::getTitleFor( 'Undelete' );
250  $links[] = Linker::linkKnown(
251  $undelete,
252  $this->msg( 'deletedhist' )->escaped(),
253  array(),
254  array( 'target' => $this->targetObj->getPrefixedDBkey() )
255  );
256  }
257  }
258  # Logs themselves don't have histories or archived revisions
259  $this->getOutput()->addSubtitle( $this->getLanguage()->pipeList( $links ) );
260  }
261  }
262 
267  protected function getLogQueryCond() {
268  $conds = array();
269  // Revision delete logs for these item
270  $conds['log_type'] = array( 'delete', 'suppress' );
271  $conds['log_action'] = $this->getList()->getLogAction();
272  $conds['ls_field'] = RevisionDeleter::getRelationType( $this->typeName );
273  $conds['ls_value'] = $this->ids;
274 
275  return $conds;
276  }
277 
282  protected function tryShowFile( $archiveName ) {
283  $repo = RepoGroup::singleton()->getLocalRepo();
284  $oimage = $repo->newFromArchiveName( $this->targetObj, $archiveName );
285  $oimage->load();
286  // Check if user is allowed to see this file
287  if ( !$oimage->exists() ) {
288  $this->getOutput()->addWikiMsg( 'revdelete-no-file' );
289 
290  return;
291  }
292  $user = $this->getUser();
293  if ( !$oimage->userCan( File::DELETED_FILE, $user ) ) {
294  if ( $oimage->isDeleted( File::DELETED_RESTRICTED ) ) {
295  throw new PermissionsError( 'suppressrevision' );
296  } else {
297  throw new PermissionsError( 'deletedtext' );
298  }
299  }
300  if ( !$user->matchEditToken( $this->token, $archiveName ) ) {
301  $lang = $this->getLanguage();
302  $this->getOutput()->addWikiMsg( 'revdelete-show-file-confirm',
303  $this->targetObj->getText(),
304  $lang->userDate( $oimage->getTimestamp(), $user ),
305  $lang->userTime( $oimage->getTimestamp(), $user ) );
306  $this->getOutput()->addHTML(
307  Xml::openElement( 'form', array(
308  'method' => 'POST',
309  'action' => $this->getPageTitle()->getLocalURL( array(
310  'target' => $this->targetObj->getPrefixedDBkey(),
311  'file' => $archiveName,
312  'token' => $user->getEditToken( $archiveName ),
313  ) )
314  )
315  ) .
316  Xml::submitButton( $this->msg( 'revdelete-show-file-submit' )->text() ) .
317  '</form>'
318  );
319 
320  return;
321  }
322  $this->getOutput()->disable();
323  # We mustn't allow the output to be Squid cached, otherwise
324  # if an admin previews a deleted image, and it's cached, then
325  # a user without appropriate permissions can toddle off and
326  # nab the image, and Squid will serve it
327  $this->getRequest()->response()->header( 'Expires: ' . gmdate( 'D, d M Y H:i:s', 0 ) . ' GMT' );
328  $this->getRequest()->response()->header( 'Cache-Control: no-cache, no-store, max-age=0, must-revalidate' );
329  $this->getRequest()->response()->header( 'Pragma: no-cache' );
330 
331  $key = $oimage->getStorageKey();
332  $path = $repo->getZonePath( 'deleted' ) . '/' . $repo->getDeletedHashPath( $key ) . $key;
333  $repo->streamFile( $path );
334  }
335 
339  protected function getList() {
340  if ( is_null( $this->revDelList ) ) {
341  $this->revDelList = RevisionDeleter::createList(
342  $this->typeName, $this->getContext(), $this->targetObj, $this->ids
343  );
344  }
345 
346  return $this->revDelList;
347  }
348 
353  protected function showForm() {
354  $userAllowed = true;
355 
356  // Messages: revdelete-selected-text, revdelete-selected-file, logdelete-selected
357  $this->getOutput()->wrapWikiMsg( "<strong>$1</strong>", array( $this->typeLabels['selected'],
358  $this->getLanguage()->formatNum( count( $this->ids ) ), $this->targetObj->getPrefixedText() ) );
359 
360  $this->getOutput()->addHTML( "<ul>" );
361 
362  $numRevisions = 0;
363  // Live revisions...
364  $list = $this->getList();
365  for ( $list->reset(); $list->current(); $list->next() ) {
366  $item = $list->current();
367  if ( !$item->canView() ) {
368  if ( !$this->submitClicked ) {
369  throw new PermissionsError( 'suppressrevision' );
370  }
371  $userAllowed = false;
372  }
373  $numRevisions++;
374  $this->getOutput()->addHTML( $item->getHTML() );
375  }
376 
377  if ( !$numRevisions ) {
378  throw new ErrorPageError( 'revdelete-nooldid-title', 'revdelete-nooldid-text' );
379  }
380 
381  $this->getOutput()->addHTML( "</ul>" );
382  // Explanation text
383  $this->addUsageText();
384 
385  // Normal sysops can always see what they did, but can't always change it
386  if ( !$userAllowed ) {
387  return;
388  }
389 
390  // Show form if the user can submit
391  if ( $this->mIsAllowed ) {
392  $out = Xml::openElement( 'form', array( 'method' => 'post',
393  'action' => $this->getPageTitle()->getLocalURL( array( 'action' => 'submit' ) ),
394  'id' => 'mw-revdel-form-revisions' ) ) .
395  Xml::fieldset( $this->msg( 'revdelete-legend' )->text() ) .
396  $this->buildCheckBoxes() .
397  Xml::openElement( 'table' ) .
398  "<tr>\n" .
399  '<td class="mw-label">' .
400  Xml::label( $this->msg( 'revdelete-log' )->text(), 'wpRevDeleteReasonList' ) .
401  '</td>' .
402  '<td class="mw-input">' .
403  Xml::listDropDown( 'wpRevDeleteReasonList',
404  $this->msg( 'revdelete-reason-dropdown' )->inContentLanguage()->text(),
405  $this->msg( 'revdelete-reasonotherlist' )->inContentLanguage()->text(),
406  $this->getRequest()->getText( 'wpRevDeleteReasonList', 'other' ), 'wpReasonDropDown', 1
407  ) .
408  '</td>' .
409  "</tr><tr>\n" .
410  '<td class="mw-label">' .
411  Xml::label( $this->msg( 'revdelete-otherreason' )->text(), 'wpReason' ) .
412  '</td>' .
413  '<td class="mw-input">' .
414  Xml::input( 'wpReason', 60, $this->otherReason, array( 'id' => 'wpReason', 'maxlength' => 100 ) ) .
415  '</td>' .
416  "</tr><tr>\n" .
417  '<td></td>' .
418  '<td class="mw-submit">' .
419  Xml::submitButton( $this->msg( 'revdelete-submit', $numRevisions )->text(),
420  array( 'name' => 'wpSubmit' ) ) .
421  '</td>' .
422  "</tr>\n" .
423  Xml::closeElement( 'table' ) .
424  Html::hidden( 'wpEditToken', $this->getUser()->getEditToken() ) .
425  Html::hidden( 'target', $this->targetObj->getPrefixedText() ) .
426  Html::hidden( 'type', $this->typeName ) .
427  Html::hidden( 'ids', implode( ',', $this->ids ) ) .
428  Xml::closeElement( 'fieldset' ) . "\n";
429  } else {
430  $out = '';
431  }
432  if ( $this->mIsAllowed ) {
433  $out .= Xml::closeElement( 'form' ) . "\n";
434  // Show link to edit the dropdown reasons
435  if ( $this->getUser()->isAllowed( 'editinterface' ) ) {
436  $title = Title::makeTitle( NS_MEDIAWIKI, 'Revdelete-reason-dropdown' );
438  $title,
439  $this->msg( 'revdelete-edit-reasonlist' )->escaped(),
440  array(),
441  array( 'action' => 'edit' )
442  );
443  $out .= Xml::tags( 'p', array( 'class' => 'mw-revdel-editreasons' ), $link ) . "\n";
444  }
445  }
446  $this->getOutput()->addHTML( $out );
447  }
448 
453  protected function addUsageText() {
454  // Messages: revdelete-text-text, revdelete-text-file, logdelete-text
455  $this->getOutput()->wrapWikiMsg( "<strong>$1</strong>\n$2", $this->typeLabels['text'], 'revdelete-text-others' );
456  if ( $this->getUser()->isAllowed( 'suppressrevision' ) ) {
457  $this->getOutput()->addWikiMsg( 'revdelete-suppress-text' );
458  }
459  if ( $this->mIsAllowed ) {
460  $this->getOutput()->addWikiMsg( 'revdelete-confirm' );
461  }
462  }
463 
467  protected function buildCheckBoxes() {
468  $html = '<table>';
469  // If there is just one item, use checkboxes
470  $list = $this->getList();
471  if ( $list->length() == 1 ) {
472  $list->reset();
473  $bitfield = $list->current()->getBits(); // existing field
474  if ( $this->submitClicked ) {
475  $bitfield = RevisionDeleter::extractBitfield( $this->extractBitParams(), $bitfield );
476  }
477  foreach ( $this->checks as $item ) {
478  // Messages: revdelete-hide-text, revdelete-hide-image, revdelete-hide-name,
479  // revdelete-hide-comment, revdelete-hide-user, revdelete-hide-restricted
480  list( $message, $name, $field ) = $item;
481  $innerHTML = Xml::checkLabel( $this->msg( $message )->text(), $name, $name, $bitfield & $field );
482  if ( $field == Revision::DELETED_RESTRICTED ) {
483  $innerHTML = "<b>$innerHTML</b>";
484  }
485  $line = Xml::tags( 'td', array( 'class' => 'mw-input' ), $innerHTML );
486  $html .= "<tr>$line</tr>\n";
487  }
488  } else {
489  // Otherwise, use tri-state radios
490  $html .= '<tr>';
491  $html .= '<th class="mw-revdel-checkbox">' . $this->msg( 'revdelete-radio-same' )->escaped() . '</th>';
492  $html .= '<th class="mw-revdel-checkbox">' . $this->msg( 'revdelete-radio-unset' )->escaped() . '</th>';
493  $html .= '<th class="mw-revdel-checkbox">' . $this->msg( 'revdelete-radio-set' )->escaped() . '</th>';
494  $html .= "<th></th></tr>\n";
495  foreach ( $this->checks as $item ) {
496  // Messages: revdelete-hide-text, revdelete-hide-image, revdelete-hide-name,
497  // revdelete-hide-comment, revdelete-hide-user, revdelete-hide-restricted
498  list( $message, $name, $field ) = $item;
499  // If there are several items, use third state by default...
500  if ( $this->submitClicked ) {
501  $selected = $this->getRequest()->getInt( $name, 0 /* unchecked */ );
502  } else {
503  $selected = -1; // use existing field
504  }
505  $line = '<td class="mw-revdel-checkbox">' . Xml::radio( $name, -1, $selected == -1 ) . '</td>';
506  $line .= '<td class="mw-revdel-checkbox">' . Xml::radio( $name, 0, $selected == 0 ) . '</td>';
507  $line .= '<td class="mw-revdel-checkbox">' . Xml::radio( $name, 1, $selected == 1 ) . '</td>';
508  $label = $this->msg( $message )->escaped();
509  if ( $field == Revision::DELETED_RESTRICTED ) {
510  $label = "<b>$label</b>";
511  }
512  $line .= "<td>$label</td>";
513  $html .= "<tr>$line</tr>\n";
514  }
515  }
516 
517  $html .= '</table>';
518 
519  return $html;
520  }
521 
527  protected function submit() {
528  # Check edit token on submission
529  $token = $this->getRequest()->getVal( 'wpEditToken' );
530  if ( $this->submitClicked && !$this->getUser()->matchEditToken( $token ) ) {
531  $this->getOutput()->addWikiMsg( 'sessionfailure' );
532 
533  return false;
534  }
535  $bitParams = $this->extractBitParams();
536  $listReason = $this->getRequest()->getText( 'wpRevDeleteReasonList', 'other' ); // from dropdown
537  $comment = $listReason;
538  if ( $comment != 'other' && $this->otherReason != '' ) {
539  // Entry from drop down menu + additional comment
540  $comment .= $this->msg( 'colon-separator' )->inContentLanguage()->text() . $this->otherReason;
541  } elseif ( $comment == 'other' ) {
543  }
544  # Can the user set this field?
545  if ( $bitParams[Revision::DELETED_RESTRICTED] == 1 && !$this->getUser()->isAllowed( 'suppressrevision' ) ) {
546  throw new PermissionsError( 'suppressrevision' );
547  }
548  # If the save went through, go to success message...
549  $status = $this->save( $bitParams, $comment, $this->targetObj );
550  if ( $status->isGood() ) {
551  $this->success();
552 
553  return true;
554  } else {
555  # ...otherwise, bounce back to form...
556  $this->failure( $status );
557  }
558 
559  return false;
560  }
561 
565  protected function success() {
566  // Messages: revdelete-success, logdelete-success
567  $this->getOutput()->setPageTitle( $this->msg( 'actioncomplete' ) );
568  $this->getOutput()->wrapWikiMsg( "<span class=\"success\">\n$1\n</span>", $this->typeLabels['success'] );
569  $this->wasSaved = true;
570  $this->revDelList->reloadFromMaster();
571  $this->showForm();
572  }
573 
577  protected function failure( $status ) {
578  // Messages: revdelete-failure, logdelete-failure
579  $this->getOutput()->setPageTitle( $this->msg( 'actionfailed' ) );
580  $this->getOutput()->addWikiText( $status->getWikiText( $this->typeLabels['failure'] ) );
581  $this->showForm();
582  }
583 
589  protected function extractBitParams() {
590  $bitfield = array();
591  foreach ( $this->checks as $item ) {
592  list( /* message */, $name, $field ) = $item;
593  $val = $this->getRequest()->getInt( $name, 0 /* unchecked */ );
594  if ( $val < -1 || $val > 1 ) {
595  $val = -1; // -1 for existing value
596  }
597  $bitfield[$field] = $val;
598  }
599  if ( !isset( $bitfield[Revision::DELETED_RESTRICTED] ) ) {
600  $bitfield[Revision::DELETED_RESTRICTED] = 0;
601  }
602 
603  return $bitfield;
604  }
605 
613  protected function save( $bitfield, $reason, $title ) {
614  return $this->getList()->setVisibility(
615  array( 'value' => $bitfield, 'comment' => $reason )
616  );
617  }
618 
619  protected function getGroupName() {
620  return 'pagetools';
621  }
622 }
Xml\checkLabel
static checkLabel( $label, $name, $id, $checked=false, $attribs=array())
Convenience function to build an HTML checkbox with a label.
Definition: Xml.php:433
Revision\DELETED_USER
const DELETED_USER
Definition: Revision.php:67
SpecialPage\getPageTitle
getPageTitle( $subpage=false)
Get a self-referential title object.
Definition: SpecialPage.php:488
Title\makeTitle
static & makeTitle( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
Definition: Title.php:398
Revision\DELETED_RESTRICTED
const DELETED_RESTRICTED
Definition: Revision.php:68
Title\newFromText
static newFromText( $text, $defaultNamespace=NS_MAIN)
Create a new Title from text, such as what one would find in a link.
Definition: Title.php:189
RepoGroup\singleton
static singleton()
Get a RepoGroup instance.
Definition: RepoGroup.php:53
Revision\DELETED_COMMENT
const DELETED_COMMENT
Definition: Revision.php:66
php
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
Definition: skin.txt:62
$html
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return an< a > element with HTML attributes $attribs and contents $html will be returned If you return $ret will be returned and may include noclasses & $html
Definition: hooks.txt:1530
Xml\tags
static tags( $element, $attribs=null, $contents)
Same as Xml::element(), but does not escape contents.
Definition: Xml.php:131
SpecialPage\getOutput
getOutput()
Get the OutputPage being used for this instance.
Definition: SpecialPage.php:535
File\DELETED_RESTRICTED
const DELETED_RESTRICTED
Definition: File.php:55
SpecialRevisionDelete\$wasSaved
bool $wasSaved
Was the DB modified in this request *.
Definition: SpecialRevisiondelete.php:31
UnlistedSpecialPage
Shortcut to construct a special page which is unlisted by default.
Definition: UnlistedSpecialPage.php:29
text
design txt This is a brief overview of the new design More thorough and up to date information is available on the documentation wiki at etc Handles the details of getting and saving to the user table of the and dealing with sessions and cookies OutputPage Encapsulates the entire HTML page that will be sent in response to any server request It is used by calling its functions to add text
Definition: design.txt:12
token
as a message key or array as accepted by ApiBase::dieUsageMsg after processing request parameters Return false to let the request returning an error message or an< edit result="Failure"> tag if $resultArr was filled which will be used in the intoken parameter and in the and a callback function which should return the token
Definition: hooks.txt:421
SpecialRevisionDelete\$typeLabels
array $typeLabels
UI Labels about the current type *.
Definition: SpecialRevisiondelete.php:47
SpecialRevisionDelete\__construct
__construct()
Definition: SpecialRevisiondelete.php:97
SpecialPage\checkPermissions
checkPermissions()
Checks if userCanExecute, and if not throws a PermissionsError.
Definition: SpecialPage.php:287
SpecialRevisionDelete
Special page allowing users with the appropriate permissions to view and hide revisions.
Definition: SpecialRevisiondelete.php:30
SpecialPage\getTitleFor
static getTitleFor( $name, $subpage=false, $fragment='')
Get a localised Title object for a specified special page name.
Definition: SpecialPage.php:74
SpecialPage\getSkin
getSkin()
Shortcut to get the skin being used for this instance.
Definition: SpecialPage.php:555
Html\hidden
static hidden( $name, $value, $attribs=array())
Convenience function to produce an input element with type=hidden.
Definition: Html.php:662
PermissionsError
Show an error when a user tries to do something they do not have the necessary permissions for.
Definition: PermissionsError.php:28
SpecialPage\getLanguage
getLanguage()
Shortcut to get user's language.
Definition: SpecialPage.php:578
$link
set to $title object and return false for a match for latest after cache objects are set use the ContentHandler facility to handle CSS and JavaScript for highlighting & $link
Definition: hooks.txt:2149
Xml\openElement
static openElement( $element, $attribs=null)
This opens an XML element.
Definition: Xml.php:109
SpecialRevisionDelete\getList
getList()
Get the list object for this request.
Definition: SpecialRevisiondelete.php:328
Linker\linkKnown
static linkKnown( $target, $html=null, $customAttribs=array(), $query=array(), $options=array( 'known', 'noclasses'))
Identical to link(), except $options defaults to 'known'.
Definition: Linker.php:264
SpecialRevisionDelete\$submitClicked
bool $submitClicked
True if the submit button was clicked, and the form was posted *.
Definition: SpecialRevisiondelete.php:33
SpecialRevisionDelete\showConvenienceLinks
showConvenienceLinks()
Show some useful links in the subtitle.
Definition: SpecialRevisiondelete.php:215
Linker\link
static link( $target, $html=null, $customAttribs=array(), $query=array(), $options=array())
This function returns an HTML link to the given target.
Definition: Linker.php:192
SpecialRevisionDelete\getLogQueryCond
getLogQueryCond()
Get the condition used for fetching log snippets.
Definition: SpecialRevisiondelete.php:256
SpecialRevisionDelete\getGroupName
getGroupName()
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-gro...
Definition: SpecialRevisiondelete.php:608
SpecialRevisionDelete\$typeName
string $typeName
Deletion type, may be revision, archive, oldimage, filearchive, logging.
Definition: SpecialRevisiondelete.php:43
$out
$out
Definition: UtfNormalGenerate.php:167
SpecialRevisionDelete\failure
failure( $status)
Report that the submit operation failed.
Definition: SpecialRevisiondelete.php:566
SpecialPage\getFullTitle
getFullTitle()
Return the full title, including $par.
Definition: SpecialPage.php:588
LogPage
Class to simplify the use of log pages.
Definition: LogPage.php:32
RevisionDeleter\extractBitfield
static extractBitfield( $bitPars, $oldfield)
Put together a rev_deleted bitfield.
Definition: RevisionDeleter.php:237
array
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
SpecialPage\setHeaders
setHeaders()
Sets headers - this should be called from the execute() method of all derived classes!
Definition: SpecialPage.php:352
SpecialPage\getUser
getUser()
Shortcut to get the User executing this instance.
Definition: SpecialPage.php:545
SpecialRevisionDelete\$archiveName
string $archiveName
Archive name, for reviewing deleted files *.
Definition: SpecialRevisiondelete.php:37
$comment
$comment
Definition: importImages.php:107
SpecialRevisionDelete\$checks
array $checks
of checkbox specs (message, name, deletion bits) *
Definition: SpecialRevisiondelete.php:45
SpecialRevisionDelete\extractBitParams
extractBitParams()
Put together an array that contains -1, 0, or the *_deleted const for each bit.
Definition: SpecialRevisiondelete.php:578
RevisionDeleter\createList
static createList( $typeName, IContextSource $context, Title $title, array $ids)
Instantiate the appropriate list class for a given list of IDs.
Definition: RevisionDeleter.php:82
list
deferred txt A few of the database updates required by various functions here can be deferred until after the result page is displayed to the user For updating the view updating the linked to tables after a etc PHP does not yet have any way to tell the server to actually return and disconnect while still running these but it might have such a feature in the future We handle these by creating a deferred update object and putting those objects on a global list
Definition: deferred.txt:11
SpecialPage\getContext
getContext()
Gets the context this SpecialPage is executed in.
Definition: SpecialPage.php:508
SpecialRevisionDelete\$targetObj
Title $targetObj
object for target parameter *
Definition: SpecialRevisiondelete.php:41
SpecialRevisionDelete\showForm
showForm()
Show a list of items that we will operate on, and show a form with checkboxes which will allow the us...
Definition: SpecialRevisiondelete.php:342
$line
$line
Definition: cdb.php:57
RevisionDeleter\getRevdelConstant
static getRevdelConstant( $typeName)
Get the revision deletion constant for the RevDel type.
Definition: RevisionDeleter.php:180
$title
presenting them properly to the user as errors is done by the caller $title
Definition: hooks.txt:1324
$name
Allows to change the fields on the form that will be generated $name
Definition: hooks.txt:336
SpecialPage\msg
msg()
Wrapper around wfMessage that sets the current context.
Definition: SpecialPage.php:609
SpecialRevisionDelete\success
success()
Report that the submit operation succeeded.
Definition: SpecialRevisiondelete.php:554
SpecialRevisionDelete\$otherReason
string $otherReason
Definition: SpecialRevisiondelete.php:54
SpecialRevisionDelete\$revDelList
$revDelList
Definition: SpecialRevisiondelete.php:50
SpecialRevisionDelete\tryShowFile
tryShowFile( $archiveName)
Show a deleted file version requested by the visitor.
Definition: SpecialRevisiondelete.php:271
SpecialPage\getRequest
getRequest()
Get the WebRequest being used for this instance.
Definition: SpecialPage.php:525
SpecialRevisionDelete\addUsageText
addUsageText()
Show some introductory text.
Definition: SpecialRevisiondelete.php:442
SpecialRevisionDelete\$UILabels
static $UILabels
UI labels for each type.
Definition: SpecialRevisiondelete.php:59
$user
please add to it if you re going to add events to the MediaWiki code where normally authentication against an external auth plugin would be creating a account $user
Definition: hooks.txt:237
Title
Represents a title within MediaWiki.
Definition: Title.php:35
Xml\closeElement
static closeElement( $element)
Shortcut to close an XML element.
Definition: Xml.php:118
Xml\listDropDown
static listDropDown( $name='', $list='', $other='', $selected='', $class='', $tabindex=null)
Build a drop-down box from a textual list.
Definition: Xml.php:497
SpecialRevisionDelete\$token
string $token
Edit token for securing image views against XSS *.
Definition: SpecialRevisiondelete.php:39
SpecialRevisionDelete\$ids
array $ids
Target ID list *.
Definition: SpecialRevisiondelete.php:35
Xml\radio
static radio( $name, $value, $checked=false, $attribs=array())
Convenience function to build an HTML radio button.
Definition: Xml.php:357
$output
& $output
Definition: hooks.txt:375
$path
$path
Definition: NoLocalSettings.php:35
RevisionDeleter\getRelationType
static getRelationType( $typeName)
Get DB field name for URL param...
Definition: RevisionDeleter.php:152
as
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
Definition: distributors.txt:9
Xml\submitButton
static submitButton( $value, $attribs=array())
Convenience function to build an HTML submit button.
Definition: Xml.php:463
RevisionDeleter\getCanonicalTypeName
static getCanonicalTypeName( $typeName)
Gets the canonical type name, if any.
Definition: RevisionDeleter.php:65
File\DELETED_FILE
const DELETED_FILE
Definition: File.php:52
NS_MEDIAWIKI
const NS_MEDIAWIKI
Definition: Defines.php:87
name
design txt This is a brief overview of the new design More thorough and up to date information is available on the documentation wiki at name
Definition: design.txt:12
SpecialPage\checkReadOnly
checkReadOnly()
If the wiki is currently in readonly mode, throws a ReadOnlyError.
Definition: SpecialPage.php:300
SpecialRevisionDelete\buildCheckBoxes
buildCheckBoxes()
Definition: SpecialRevisiondelete.php:456
SpecialRevisionDelete\execute
execute( $par)
Default execute method Checks user permissions, calls the function given in mFunction.
Definition: SpecialRevisiondelete.php:101
Xml\input
static input( $name, $size=false, $value=false, $attribs=array())
Convenience function to build an HTML text input field.
Definition: Xml.php:294
Xml\label
static label( $label, $id, $attribs=array())
Convenience function to build an HTML form label.
Definition: Xml.php:374
ErrorPageError
An error page which can definitely be safely rendered using the OutputPage.
Definition: ErrorPageError.php:27
RevisionDeleter\suggestTarget
static suggestTarget( $typeName, $target, array $ids)
Suggest a target for the revision deletion.
Definition: RevisionDeleter.php:196
SpecialRevisionDelete\submit
submit()
UI entry point for form submission.
Definition: SpecialRevisiondelete.php:516
RevisionDeleter\getRestriction
static getRestriction( $typeName)
Get the user right required for the RevDel type.
Definition: RevisionDeleter.php:166
SpecialPage\outputHeader
outputHeader( $summaryMessageKey='')
Outputs a summary message on top of special pages Per default the message key is the canonical name o...
Definition: SpecialPage.php:443
SpecialRevisionDelete\save
save( $bitfield, $reason, $title)
Do the write operations.
Definition: SpecialRevisiondelete.php:602
SpecialRevisionDelete\$mIsAllowed
bool $mIsAllowed
Whether user is allowed to perform the action *.
Definition: SpecialRevisiondelete.php:52
Xml\fieldset
static fieldset( $legend=false, $content=false, $attribs=array())
Shortcut for creating fieldsets.
Definition: Xml.php:563
LogEventsList\showLogExtract
static showLogExtract(&$out, $types=array(), $page='', $user='', $param=array())
Show log extract.
Definition: LogEventsList.php:507