Remove tabindex from the drop-down in Special:RevisionDelete
[lhc/web/wiklou.git] / includes / specials / SpecialRevisiondelete.php
1 <?php
2 /**
3 * Implements Special:Revisiondelete
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 * http://www.gnu.org/copyleft/gpl.html
19 *
20 * @file
21 * @ingroup SpecialPage
22 */
23
24 /**
25 * Special page allowing users with the appropriate permissions to view
26 * and hide revisions. Log items can also be hidden.
27 *
28 * @ingroup SpecialPage
29 */
30 class SpecialRevisionDelete extends UnlistedSpecialPage {
31 /** @var bool Was the DB modified in this request */
32 protected $wasSaved = false;
33
34 /** @var bool True if the submit button was clicked, and the form was posted */
35 private $submitClicked;
36
37 /** @var array Target ID list */
38 private $ids;
39
40 /** @var string Archive name, for reviewing deleted files */
41 private $archiveName;
42
43 /** @var string Edit token for securing image views against XSS */
44 private $token;
45
46 /** @var Title Title object for target parameter */
47 private $targetObj;
48
49 /** @var string Deletion type, may be revision, archive, oldimage, filearchive, logging. */
50 private $typeName;
51
52 /** @var array Array of checkbox specs (message, name, deletion bits) */
53 private $checks;
54
55 /** @var array UI Labels about the current type */
56 private $typeLabels;
57
58 /** @var RevDelList RevDelList object, storing the list of items to be deleted/undeleted */
59 private $revDelList;
60
61 /** @var bool Whether user is allowed to perform the action */
62 private $mIsAllowed;
63
64 /** @var string */
65 private $otherReason;
66
67 /**
68 * UI labels for each type.
69 */
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'
136 || $request->getVal( 'action' ) == 'revisiondelete'
137 ) {
138 // For show/hide form submission from history page
139 // Since we are access through index.php?title=XXX&action=historysubmit
140 // getFullTitle() will contain the target title and not our title
141 $this->targetObj = $this->getFullTitle();
142 $this->typeName = 'revision';
143 } else {
144 $this->typeName = $request->getVal( 'type' );
145 $this->targetObj = Title::newFromText( $request->getText( 'target' ) );
146 }
147
148 # For reviewing deleted files...
149 $this->archiveName = $request->getVal( 'file' );
150 $this->token = $request->getVal( 'token' );
151 if ( $this->archiveName && $this->targetObj ) {
152 $this->tryShowFile( $this->archiveName );
153
154 return;
155 }
156
157 $this->typeName = RevisionDeleter::getCanonicalTypeName( $this->typeName );
158
159 # No targets?
160 if ( !$this->typeName || count( $this->ids ) == 0 ) {
161 throw new ErrorPageError( 'revdelete-nooldid-title', 'revdelete-nooldid-text' );
162 }
163 $this->typeLabels = self::$UILabels[$this->typeName];
164 $this->mIsAllowed = $user->isAllowed( RevisionDeleter::getRestriction( $this->typeName ) );
165
166 # Allow the list type to adjust the passed target
167 $this->targetObj = RevisionDeleter::suggestTarget(
168 $this->typeName,
169 $this->targetObj,
170 $this->ids
171 );
172
173 $this->otherReason = $request->getVal( 'wpReason' );
174 # We need a target page!
175 if ( is_null( $this->targetObj ) ) {
176 $output->addWikiMsg( 'undelete-header' );
177
178 return;
179 }
180 # Give a link to the logs/hist for this page
181 $this->showConvenienceLinks();
182
183 # Initialise checkboxes
184 $this->checks = array(
185 # Messages: revdelete-hide-text, revdelete-hide-image, revdelete-hide-name
186 array( $this->typeLabels['check-label'], 'wpHidePrimary',
187 RevisionDeleter::getRevdelConstant( $this->typeName )
188 ),
189 array( 'revdelete-hide-comment', 'wpHideComment', Revision::DELETED_COMMENT ),
190 array( 'revdelete-hide-user', 'wpHideUser', Revision::DELETED_USER )
191 );
192 if ( $user->isAllowed( 'suppressrevision' ) ) {
193 $this->checks[] = array( 'revdelete-hide-restricted',
194 'wpHideRestricted', Revision::DELETED_RESTRICTED );
195 }
196
197 # Either submit or create our form
198 if ( $this->mIsAllowed && $this->submitClicked ) {
199 $this->submit( $request );
200 } else {
201 $this->showForm();
202 }
203
204 $qc = $this->getLogQueryCond();
205 # Show relevant lines from the deletion log
206 $deleteLogPage = new LogPage( 'delete' );
207 $output->addHTML( "<h2>" . $deleteLogPage->getName()->escaped() . "</h2>\n" );
208 LogEventsList::showLogExtract(
209 $output,
210 'delete',
211 $this->targetObj,
212 '', /* user */
213 array( 'lim' => 25, 'conds' => $qc, 'useMaster' => $this->wasSaved )
214 );
215 # Show relevant lines from the suppression log
216 if ( $user->isAllowed( 'suppressionlog' ) ) {
217 $suppressLogPage = new LogPage( 'suppress' );
218 $output->addHTML( "<h2>" . $suppressLogPage->getName()->escaped() . "</h2>\n" );
219 LogEventsList::showLogExtract(
220 $output,
221 'suppress',
222 $this->targetObj,
223 '',
224 array( 'lim' => 25, 'conds' => $qc, 'useMaster' => $this->wasSaved )
225 );
226 }
227 }
228
229 /**
230 * Show some useful links in the subtitle
231 */
232 protected function showConvenienceLinks() {
233 # Give a link to the logs/hist for this page
234 if ( $this->targetObj ) {
235 // Also set header tabs to be for the target.
236 $this->getSkin()->setRelevantTitle( $this->targetObj );
237
238 $links = array();
239 $links[] = Linker::linkKnown(
240 SpecialPage::getTitleFor( 'Log' ),
241 $this->msg( 'viewpagelogs' )->escaped(),
242 array(),
243 array( 'page' => $this->targetObj->getPrefixedText() )
244 );
245 if ( !$this->targetObj->isSpecialPage() ) {
246 # Give a link to the page history
247 $links[] = Linker::linkKnown(
248 $this->targetObj,
249 $this->msg( 'pagehist' )->escaped(),
250 array(),
251 array( 'action' => 'history' )
252 );
253 # Link to deleted edits
254 if ( $this->getUser()->isAllowed( 'undelete' ) ) {
255 $undelete = SpecialPage::getTitleFor( 'Undelete' );
256 $links[] = Linker::linkKnown(
257 $undelete,
258 $this->msg( 'deletedhist' )->escaped(),
259 array(),
260 array( 'target' => $this->targetObj->getPrefixedDBkey() )
261 );
262 }
263 }
264 # Logs themselves don't have histories or archived revisions
265 $this->getOutput()->addSubtitle( $this->getLanguage()->pipeList( $links ) );
266 }
267 }
268
269 /**
270 * Get the condition used for fetching log snippets
271 * @return array
272 */
273 protected function getLogQueryCond() {
274 $conds = array();
275 // Revision delete logs for these item
276 $conds['log_type'] = array( 'delete', 'suppress' );
277 $conds['log_action'] = $this->getList()->getLogAction();
278 $conds['ls_field'] = RevisionDeleter::getRelationType( $this->typeName );
279 $conds['ls_value'] = $this->ids;
280
281 return $conds;
282 }
283
284 /**
285 * Show a deleted file version requested by the visitor.
286 * @todo Mostly copied from Special:Undelete. Refactor.
287 * @param string $archiveName
288 */
289 protected function tryShowFile( $archiveName ) {
290 $repo = RepoGroup::singleton()->getLocalRepo();
291 $oimage = $repo->newFromArchiveName( $this->targetObj, $archiveName );
292 $oimage->load();
293 // Check if user is allowed to see this file
294 if ( !$oimage->exists() ) {
295 $this->getOutput()->addWikiMsg( 'revdelete-no-file' );
296
297 return;
298 }
299 $user = $this->getUser();
300 if ( !$oimage->userCan( File::DELETED_FILE, $user ) ) {
301 if ( $oimage->isDeleted( File::DELETED_RESTRICTED ) ) {
302 throw new PermissionsError( 'suppressrevision' );
303 } else {
304 throw new PermissionsError( 'deletedtext' );
305 }
306 }
307 if ( !$user->matchEditToken( $this->token, $archiveName ) ) {
308 $lang = $this->getLanguage();
309 $this->getOutput()->addWikiMsg( 'revdelete-show-file-confirm',
310 $this->targetObj->getText(),
311 $lang->userDate( $oimage->getTimestamp(), $user ),
312 $lang->userTime( $oimage->getTimestamp(), $user ) );
313 $this->getOutput()->addHTML(
314 Xml::openElement( 'form', array(
315 'method' => 'POST',
316 'action' => $this->getPageTitle()->getLocalURL( array(
317 'target' => $this->targetObj->getPrefixedDBkey(),
318 'file' => $archiveName,
319 'token' => $user->getEditToken( $archiveName ),
320 ) )
321 )
322 ) .
323 Xml::submitButton( $this->msg( 'revdelete-show-file-submit' )->text() ) .
324 '</form>'
325 );
326
327 return;
328 }
329 $this->getOutput()->disable();
330 # We mustn't allow the output to be Squid cached, otherwise
331 # if an admin previews a deleted image, and it's cached, then
332 # a user without appropriate permissions can toddle off and
333 # nab the image, and Squid will serve it
334 $this->getRequest()->response()->header( 'Expires: ' . gmdate( 'D, d M Y H:i:s', 0 ) . ' GMT' );
335 $this->getRequest()->response()->header(
336 'Cache-Control: no-cache, no-store, max-age=0, must-revalidate'
337 );
338 $this->getRequest()->response()->header( 'Pragma: no-cache' );
339
340 $key = $oimage->getStorageKey();
341 $path = $repo->getZonePath( 'deleted' ) . '/' . $repo->getDeletedHashPath( $key ) . $key;
342 $repo->streamFile( $path );
343 }
344
345 /**
346 * Get the list object for this request
347 * @return RevDelList
348 */
349 protected function getList() {
350 if ( is_null( $this->revDelList ) ) {
351 $this->revDelList = RevisionDeleter::createList(
352 $this->typeName, $this->getContext(), $this->targetObj, $this->ids
353 );
354 }
355
356 return $this->revDelList;
357 }
358
359 /**
360 * Show a list of items that we will operate on, and show a form with checkboxes
361 * which will allow the user to choose new visibility settings.
362 */
363 protected function showForm() {
364 $userAllowed = true;
365
366 // Messages: revdelete-selected-text, revdelete-selected-file, logdelete-selected
367 $this->getOutput()->wrapWikiMsg( "<strong>$1</strong>", array( $this->typeLabels['selected'],
368 $this->getLanguage()->formatNum( count( $this->ids ) ), $this->targetObj->getPrefixedText() ) );
369
370 $this->getOutput()->addHTML( "<ul>" );
371
372 $numRevisions = 0;
373 // Live revisions...
374 $list = $this->getList();
375 // @codingStandardsIgnoreStart Generic.CodeAnalysis.ForLoopWithTestFunctionCall.NotAllowed
376 for ( $list->reset(); $list->current(); $list->next() ) {
377 // @codingStandardsIgnoreEnd
378 $item = $list->current();
379
380 if ( !$item->canView() ) {
381 if ( !$this->submitClicked ) {
382 throw new PermissionsError( 'suppressrevision' );
383 }
384 $userAllowed = false;
385 }
386
387 $numRevisions++;
388 $this->getOutput()->addHTML( $item->getHTML() );
389 }
390
391 if ( !$numRevisions ) {
392 throw new ErrorPageError( 'revdelete-nooldid-title', 'revdelete-nooldid-text' );
393 }
394
395 $this->getOutput()->addHTML( "</ul>" );
396 // Explanation text
397 $this->addUsageText();
398
399 // Normal sysops can always see what they did, but can't always change it
400 if ( !$userAllowed ) {
401 return;
402 }
403
404 // Show form if the user can submit
405 if ( $this->mIsAllowed ) {
406 $out = Xml::openElement( 'form', array( 'method' => 'post',
407 'action' => $this->getPageTitle()->getLocalURL( array( 'action' => 'submit' ) ),
408 'id' => 'mw-revdel-form-revisions' ) ) .
409 Xml::fieldset( $this->msg( 'revdelete-legend' )->text() ) .
410 $this->buildCheckBoxes() .
411 Xml::openElement( 'table' ) .
412 "<tr>\n" .
413 '<td class="mw-label">' .
414 Xml::label( $this->msg( 'revdelete-log' )->text(), 'wpRevDeleteReasonList' ) .
415 '</td>' .
416 '<td class="mw-input">' .
417 Xml::listDropDown( 'wpRevDeleteReasonList',
418 $this->msg( 'revdelete-reason-dropdown' )->inContentLanguage()->text(),
419 $this->msg( 'revdelete-reasonotherlist' )->inContentLanguage()->text(),
420 $this->getRequest()->getText( 'wpRevDeleteReasonList', 'other' ), 'wpReasonDropDown'
421 ) .
422 '</td>' .
423 "</tr><tr>\n" .
424 '<td class="mw-label">' .
425 Xml::label( $this->msg( 'revdelete-otherreason' )->text(), 'wpReason' ) .
426 '</td>' .
427 '<td class="mw-input">' .
428 Xml::input(
429 'wpReason',
430 60,
431 $this->otherReason,
432 array( 'id' => 'wpReason', 'maxlength' => 100 )
433 ) .
434 '</td>' .
435 "</tr><tr>\n" .
436 '<td></td>' .
437 '<td class="mw-submit">' .
438 Xml::submitButton( $this->msg( 'revdelete-submit', $numRevisions )->text(),
439 array( 'name' => 'wpSubmit' ) ) .
440 '</td>' .
441 "</tr>\n" .
442 Xml::closeElement( 'table' ) .
443 Html::hidden( 'wpEditToken', $this->getUser()->getEditToken() ) .
444 Html::hidden( 'target', $this->targetObj->getPrefixedText() ) .
445 Html::hidden( 'type', $this->typeName ) .
446 Html::hidden( 'ids', implode( ',', $this->ids ) ) .
447 Xml::closeElement( 'fieldset' ) . "\n";
448 } else {
449 $out = '';
450 }
451 if ( $this->mIsAllowed ) {
452 $out .= Xml::closeElement( 'form' ) . "\n";
453 // Show link to edit the dropdown reasons
454 if ( $this->getUser()->isAllowed( 'editinterface' ) ) {
455 $title = Title::makeTitle( NS_MEDIAWIKI, 'Revdelete-reason-dropdown' );
456 $link = Linker::link(
457 $title,
458 $this->msg( 'revdelete-edit-reasonlist' )->escaped(),
459 array(),
460 array( 'action' => 'edit' )
461 );
462 $out .= Xml::tags( 'p', array( 'class' => 'mw-revdel-editreasons' ), $link ) . "\n";
463 }
464 }
465 $this->getOutput()->addHTML( $out );
466 }
467
468 /**
469 * Show some introductory text
470 * @todo FIXME: Wikimedia-specific policy text
471 */
472 protected function addUsageText() {
473 // Messages: revdelete-text-text, revdelete-text-file, logdelete-text
474 $this->getOutput()->wrapWikiMsg(
475 "<strong>$1</strong>\n$2", $this->typeLabels['text'],
476 'revdelete-text-others'
477 );
478
479 if ( $this->getUser()->isAllowed( 'suppressrevision' ) ) {
480 $this->getOutput()->addWikiMsg( 'revdelete-suppress-text' );
481 }
482
483 if ( $this->mIsAllowed ) {
484 $this->getOutput()->addWikiMsg( 'revdelete-confirm' );
485 }
486 }
487
488 /**
489 * @return string HTML
490 */
491 protected function buildCheckBoxes() {
492 $html = '<table>';
493 // If there is just one item, use checkboxes
494 $list = $this->getList();
495 if ( $list->length() == 1 ) {
496 $list->reset();
497 $bitfield = $list->current()->getBits(); // existing field
498
499 if ( $this->submitClicked ) {
500 $bitfield = RevisionDeleter::extractBitfield( $this->extractBitParams(), $bitfield );
501 }
502
503 foreach ( $this->checks as $item ) {
504 // Messages: revdelete-hide-text, revdelete-hide-image, revdelete-hide-name,
505 // revdelete-hide-comment, revdelete-hide-user, revdelete-hide-restricted
506 list( $message, $name, $field ) = $item;
507 $innerHTML = Xml::checkLabel(
508 $this->msg( $message )->text(),
509 $name,
510 $name,
511 $bitfield & $field
512 );
513
514 if ( $field == Revision::DELETED_RESTRICTED ) {
515 $innerHTML = "<b>$innerHTML</b>";
516 }
517
518 $line = Xml::tags( 'td', array( 'class' => 'mw-input' ), $innerHTML );
519 $html .= "<tr>$line</tr>\n";
520 }
521 } else {
522 // Otherwise, use tri-state radios
523 $html .= '<tr>';
524 $html .= '<th class="mw-revdel-checkbox">'
525 . $this->msg( 'revdelete-radio-same' )->escaped() . '</th>';
526 $html .= '<th class="mw-revdel-checkbox">'
527 . $this->msg( 'revdelete-radio-unset' )->escaped() . '</th>';
528 $html .= '<th class="mw-revdel-checkbox">'
529 . $this->msg( 'revdelete-radio-set' )->escaped() . '</th>';
530 $html .= "<th></th></tr>\n";
531 foreach ( $this->checks as $item ) {
532 // Messages: revdelete-hide-text, revdelete-hide-image, revdelete-hide-name,
533 // revdelete-hide-comment, revdelete-hide-user, revdelete-hide-restricted
534 list( $message, $name, $field ) = $item;
535 // If there are several items, use third state by default...
536 if ( $this->submitClicked ) {
537 $selected = $this->getRequest()->getInt( $name, 0 /* unchecked */ );
538 } else {
539 $selected = -1; // use existing field
540 }
541 $line = '<td class="mw-revdel-checkbox">' . Xml::radio( $name, -1, $selected == -1 ) . '</td>';
542 $line .= '<td class="mw-revdel-checkbox">' . Xml::radio( $name, 0, $selected == 0 ) . '</td>';
543 $line .= '<td class="mw-revdel-checkbox">' . Xml::radio( $name, 1, $selected == 1 ) . '</td>';
544 $label = $this->msg( $message )->escaped();
545 if ( $field == Revision::DELETED_RESTRICTED ) {
546 $label = "<b>$label</b>";
547 }
548 $line .= "<td>$label</td>";
549 $html .= "<tr>$line</tr>\n";
550 }
551 }
552
553 $html .= '</table>';
554
555 return $html;
556 }
557
558 /**
559 * UI entry point for form submission.
560 * @throws PermissionsError
561 * @return bool
562 */
563 protected function submit() {
564 # Check edit token on submission
565 $token = $this->getRequest()->getVal( 'wpEditToken' );
566 if ( $this->submitClicked && !$this->getUser()->matchEditToken( $token ) ) {
567 $this->getOutput()->addWikiMsg( 'sessionfailure' );
568
569 return false;
570 }
571 $bitParams = $this->extractBitParams();
572 // from dropdown
573 $listReason = $this->getRequest()->getText( 'wpRevDeleteReasonList', 'other' );
574 $comment = $listReason;
575 if ( $comment === 'other' ) {
576 $comment = $this->otherReason;
577 } elseif ( $this->otherReason !== '' ) {
578 // Entry from drop down menu + additional comment
579 $comment .= $this->msg( 'colon-separator' )->inContentLanguage()->text()
580 . $this->otherReason;
581 }
582 # Can the user set this field?
583 if ( $bitParams[Revision::DELETED_RESTRICTED] == 1
584 && !$this->getUser()->isAllowed( 'suppressrevision' )
585 ) {
586 throw new PermissionsError( 'suppressrevision' );
587 }
588 # If the save went through, go to success message...
589 $status = $this->save( $bitParams, $comment, $this->targetObj );
590 if ( $status->isGood() ) {
591 $this->success();
592
593 return true;
594 } else {
595 # ...otherwise, bounce back to form...
596 $this->failure( $status );
597 }
598
599 return false;
600 }
601
602 /**
603 * Report that the submit operation succeeded
604 */
605 protected function success() {
606 // Messages: revdelete-success, logdelete-success
607 $this->getOutput()->setPageTitle( $this->msg( 'actioncomplete' ) );
608 $this->getOutput()->wrapWikiMsg(
609 "<span class=\"success\">\n$1\n</span>",
610 $this->typeLabels['success']
611 );
612 $this->wasSaved = true;
613 $this->revDelList->reloadFromMaster();
614 $this->showForm();
615 }
616
617 /**
618 * Report that the submit operation failed
619 */
620 protected function failure( $status ) {
621 // Messages: revdelete-failure, logdelete-failure
622 $this->getOutput()->setPageTitle( $this->msg( 'actionfailed' ) );
623 $this->getOutput()->addWikiText( $status->getWikiText( $this->typeLabels['failure'] ) );
624 $this->showForm();
625 }
626
627 /**
628 * Put together an array that contains -1, 0, or the *_deleted const for each bit
629 *
630 * @return array
631 */
632 protected function extractBitParams() {
633 $bitfield = array();
634 foreach ( $this->checks as $item ) {
635 list( /* message */, $name, $field ) = $item;
636 $val = $this->getRequest()->getInt( $name, 0 /* unchecked */ );
637 if ( $val < -1 || $val > 1 ) {
638 $val = -1; // -1 for existing value
639 }
640 $bitfield[$field] = $val;
641 }
642 if ( !isset( $bitfield[Revision::DELETED_RESTRICTED] ) ) {
643 $bitfield[Revision::DELETED_RESTRICTED] = 0;
644 }
645
646 return $bitfield;
647 }
648
649 /**
650 * Do the write operations. Simple wrapper for RevDel*List::setVisibility().
651 * @param int $bitfield
652 * @param string $reason
653 * @param Title $title
654 * @return Status
655 */
656 protected function save( $bitfield, $reason, $title ) {
657 return $this->getList()->setVisibility(
658 array( 'value' => $bitfield, 'comment' => $reason )
659 );
660 }
661
662 protected function getGroupName() {
663 return 'pagetools';
664 }
665 }