MediaWiki  1.23.0
RevisionDelete.php
Go to the documentation of this file.
1 <?php
35 
36  public function getType() {
37  return 'revision';
38  }
39 
40  public static function getRelationType() {
41  return 'rev_id';
42  }
43 
44  public static function getRestriction() {
45  return 'deleterevision';
46  }
47 
48  public static function getRevdelConstant() {
50  }
51 
52  public static function suggestTarget( $target, array $ids ) {
54  return $rev ? $rev->getTitle() : $target;
55  }
56 
61  public function doQuery( $db ) {
62  $ids = array_map( 'intval', $this->ids );
63  $live = $db->select(
64  array( 'revision', 'page', 'user' ),
66  array(
67  'rev_page' => $this->title->getArticleID(),
68  'rev_id' => $ids,
69  ),
70  __METHOD__,
71  array( 'ORDER BY' => 'rev_id DESC' ),
72  array(
73  'page' => Revision::pageJoinCond(),
74  'user' => Revision::userJoinCond() )
75  );
76 
77  if ( $live->numRows() >= count( $ids ) ) {
78  // All requested revisions are live, keeps things simple!
79  return $live;
80  }
81 
82  // Check if any requested revisions are available fully deleted.
83  $archived = $db->select( array( 'archive' ), '*',
84  array(
85  'ar_rev_id' => $ids
86  ),
87  __METHOD__,
88  array( 'ORDER BY' => 'ar_rev_id DESC' )
89  );
90 
91  if ( $archived->numRows() == 0 ) {
92  return $live;
93  } elseif ( $live->numRows() == 0 ) {
94  return $archived;
95  } else {
96  // Combine the two! Whee
97  $rows = array();
98  foreach ( $live as $row ) {
99  $rows[$row->rev_id] = $row;
100  }
101  foreach ( $archived as $row ) {
102  $rows[$row->ar_rev_id] = $row;
103  }
104  krsort( $rows );
105  return new FakeResultWrapper( array_values( $rows ) );
106  }
107  }
108 
109  public function newItem( $row ) {
110  if ( isset( $row->rev_id ) ) {
111  return new RevDel_RevisionItem( $this, $row );
112  } elseif ( isset( $row->ar_rev_id ) ) {
113  return new RevDel_ArchivedRevisionItem( $this, $row );
114  } else {
115  // This shouldn't happen. :)
116  throw new MWException( 'Invalid row type in RevDel_RevisionList' );
117  }
118  }
119 
120  public function getCurrent() {
121  if ( is_null( $this->currentRevId ) ) {
122  $dbw = wfGetDB( DB_MASTER );
123  $this->currentRevId = $dbw->selectField(
124  'page', 'page_latest', $this->title->pageCond(), __METHOD__ );
125  }
126  return $this->currentRevId;
127  }
128 
129  public function getSuppressBit() {
131  }
132 
133  public function doPreCommitUpdates() {
134  $this->title->invalidateCache();
135  return Status::newGood();
136  }
137 
138  public function doPostCommitUpdates() {
139  $this->title->purgeSquid();
140  // Extensions that require referencing previous revisions may need this
141  wfRunHooks( 'ArticleRevisionVisibilitySet', array( &$this->title ) );
142  return Status::newGood();
143  }
144 }
145 
151 
152  public function __construct( $list, $row ) {
153  parent::__construct( $list, $row );
154  $this->revision = new Revision( $row );
155  }
156 
157  public function getIdField() {
158  return 'rev_id';
159  }
160 
161  public function getTimestampField() {
162  return 'rev_timestamp';
163  }
164 
165  public function getAuthorIdField() {
166  return 'rev_user';
167  }
168 
169  public function getAuthorNameField() {
170  return 'user_name'; // see Revision::selectUserFields()
171  }
172 
173  public function canView() {
174  return $this->revision->userCan( Revision::DELETED_RESTRICTED, $this->list->getUser() );
175  }
176 
177  public function canViewContent() {
178  return $this->revision->userCan( Revision::DELETED_TEXT, $this->list->getUser() );
179  }
180 
181  public function getBits() {
182  return $this->revision->getVisibility();
183  }
184 
185  public function setBits( $bits ) {
186  $dbw = wfGetDB( DB_MASTER );
187  // Update revision table
188  $dbw->update( 'revision',
189  array( 'rev_deleted' => $bits ),
190  array(
191  'rev_id' => $this->revision->getId(),
192  'rev_page' => $this->revision->getPage(),
193  'rev_deleted' => $this->getBits()
194  ),
195  __METHOD__
196  );
197  if ( !$dbw->affectedRows() ) {
198  // Concurrent fail!
199  return false;
200  }
201  // Update recentchanges table
202  $dbw->update( 'recentchanges',
203  array(
204  'rc_deleted' => $bits,
205  'rc_patrolled' => 1
206  ),
207  array(
208  'rc_this_oldid' => $this->revision->getId(), // condition
209  // non-unique timestamp index
210  'rc_timestamp' => $dbw->timestamp( $this->revision->getTimestamp() ),
211  ),
212  __METHOD__
213  );
214  return true;
215  }
216 
217  public function isDeleted() {
218  return $this->revision->isDeleted( Revision::DELETED_TEXT );
219  }
220 
221  public function isHideCurrentOp( $newBits ) {
222  return ( $newBits & Revision::DELETED_TEXT )
223  && $this->list->getCurrent() == $this->getId();
224  }
225 
231  protected function getRevisionLink() {
232  $date = htmlspecialchars( $this->list->getLanguage()->userTimeAndDate(
233  $this->revision->getTimestamp(), $this->list->getUser() ) );
234 
235  if ( $this->isDeleted() && !$this->canViewContent() ) {
236  return $date;
237  }
238  return Linker::linkKnown(
239  $this->list->title,
240  $date,
241  array(),
242  array(
243  'oldid' => $this->revision->getId(),
244  'unhide' => 1
245  )
246  );
247  }
248 
254  protected function getDiffLink() {
255  if ( $this->isDeleted() && !$this->canViewContent() ) {
256  return $this->list->msg( 'diff' )->escaped();
257  } else {
258  return Linker::linkKnown(
259  $this->list->title,
260  $this->list->msg( 'diff' )->escaped(),
261  array(),
262  array(
263  'diff' => $this->revision->getId(),
264  'oldid' => 'prev',
265  'unhide' => 1
266  )
267  );
268  }
269  }
270 
271  public function getHTML() {
272  $difflink = $this->list->msg( 'parentheses' )
273  ->rawParams( $this->getDiffLink() )->escaped();
274  $revlink = $this->getRevisionLink();
275  $userlink = Linker::revUserLink( $this->revision );
276  $comment = Linker::revComment( $this->revision );
277  if ( $this->isDeleted() ) {
278  $revlink = "<span class=\"history-deleted\">$revlink</span>";
279  }
280  return "<li>$difflink $revlink $userlink $comment</li>";
281  }
282 
283  public function getApiData( ApiResult $result ) {
285  $user = $this->list->getUser();
286  $ret = array(
287  'id' => $rev->getId(),
288  'timestamp' => wfTimestamp( TS_ISO_8601, $rev->getTimestamp() ),
289  );
290  $ret += $rev->isDeleted( Revision::DELETED_USER ) ? array( 'userhidden' => '' ) : array();
291  $ret += $rev->isDeleted( Revision::DELETED_COMMENT ) ? array( 'commenthidden' => '' ) : array();
292  $ret += $rev->isDeleted( Revision::DELETED_TEXT ) ? array( 'texthidden' => '' ) : array();
293  if ( $rev->userCan( Revision::DELETED_USER, $user ) ) {
294  $ret += array(
295  'userid' => $rev->getUser( Revision::FOR_THIS_USER ),
296  'user' => $rev->getUserText( Revision::FOR_THIS_USER ),
297  );
298  }
299  if ( $rev->userCan( Revision::DELETED_COMMENT, $user ) ) {
300  $ret += array(
301  'comment' => $rev->getComment( Revision::FOR_THIS_USER ),
302  );
303  }
304  return $ret;
305  }
306 }
307 
312  public function getType() {
313  return 'archive';
314  }
315 
316  public static function getRelationType() {
317  return 'ar_timestamp';
318  }
319 
324  public function doQuery( $db ) {
325  $timestamps = array();
326  foreach ( $this->ids as $id ) {
327  $timestamps[] = $db->timestamp( $id );
328  }
329  return $db->select( 'archive', '*',
330  array(
331  'ar_namespace' => $this->title->getNamespace(),
332  'ar_title' => $this->title->getDBkey(),
333  'ar_timestamp' => $timestamps
334  ),
335  __METHOD__,
336  array( 'ORDER BY' => 'ar_timestamp DESC' )
337  );
338  }
339 
340  public function newItem( $row ) {
341  return new RevDel_ArchiveItem( $this, $row );
342  }
343 
344  public function doPreCommitUpdates() {
345  return Status::newGood();
346  }
347 
348  public function doPostCommitUpdates() {
349  return Status::newGood();
350  }
351 }
352 
357  public function __construct( $list, $row ) {
359  $this->revision = Revision::newFromArchiveRow( $row,
360  array( 'page' => $this->list->title->getArticleID() ) );
361  }
362 
363  public function getIdField() {
364  return 'ar_timestamp';
365  }
366 
367  public function getTimestampField() {
368  return 'ar_timestamp';
369  }
370 
371  public function getAuthorIdField() {
372  return 'ar_user';
373  }
374 
375  public function getAuthorNameField() {
376  return 'ar_user_text';
377  }
378 
379  public function getId() {
380  # Convert DB timestamp to MW timestamp
381  return $this->revision->getTimestamp();
382  }
383 
384  public function setBits( $bits ) {
385  $dbw = wfGetDB( DB_MASTER );
386  $dbw->update( 'archive',
387  array( 'ar_deleted' => $bits ),
388  array(
389  'ar_namespace' => $this->list->title->getNamespace(),
390  'ar_title' => $this->list->title->getDBkey(),
391  // use timestamp for index
392  'ar_timestamp' => $this->row->ar_timestamp,
393  'ar_rev_id' => $this->row->ar_rev_id,
394  'ar_deleted' => $this->getBits()
395  ),
396  __METHOD__ );
397  return (bool)$dbw->affectedRows();
398  }
399 
400  protected function getRevisionLink() {
401  $date = htmlspecialchars( $this->list->getLanguage()->userTimeAndDate(
402  $this->revision->getTimestamp(), $this->list->getUser() ) );
403 
404  if ( $this->isDeleted() && !$this->canViewContent() ) {
405  return $date;
406  }
407 
408  return Linker::link(
409  SpecialPage::getTitleFor( 'Undelete' ),
410  $date,
411  array(),
412  array(
413  'target' => $this->list->title->getPrefixedText(),
414  'timestamp' => $this->revision->getTimestamp()
415  )
416  );
417  }
418 
419  protected function getDiffLink() {
420  if ( $this->isDeleted() && !$this->canViewContent() ) {
421  return $this->list->msg( 'diff' )->escaped();
422  }
423 
424  return Linker::link(
425  SpecialPage::getTitleFor( 'Undelete' ),
426  $this->list->msg( 'diff' )->escaped(),
427  array(),
428  array(
429  'target' => $this->list->title->getPrefixedText(),
430  'diff' => 'prev',
431  'timestamp' => $this->revision->getTimestamp()
432  )
433  );
434  }
435 }
436 
442  public function __construct( $list, $row ) {
444 
445  $this->revision = Revision::newFromArchiveRow( $row,
446  array( 'page' => $this->list->title->getArticleID() ) );
447  }
448 
449  public function getIdField() {
450  return 'ar_rev_id';
451  }
452 
453  public function getId() {
454  return $this->revision->getId();
455  }
456 
457  public function setBits( $bits ) {
458  $dbw = wfGetDB( DB_MASTER );
459  $dbw->update( 'archive',
460  array( 'ar_deleted' => $bits ),
461  array( 'ar_rev_id' => $this->row->ar_rev_id,
462  'ar_deleted' => $this->getBits()
463  ),
464  __METHOD__ );
465  return (bool)$dbw->affectedRows();
466  }
467 }
468 
473  public function getType() {
474  return 'oldimage';
475  }
476 
477  public static function getRelationType() {
478  return 'oi_archive_name';
479  }
480 
481  public static function getRestriction() {
482  return 'deleterevision';
483  }
484 
485  public static function getRevdelConstant() {
486  return File::DELETED_FILE;
487  }
488 
490 
495  public function doQuery( $db ) {
496  $archiveNames = array();
497  foreach ( $this->ids as $timestamp ) {
498  $archiveNames[] = $timestamp . '!' . $this->title->getDBkey();
499  }
500  return $db->select(
501  'oldimage',
503  array(
504  'oi_name' => $this->title->getDBkey(),
505  'oi_archive_name' => $archiveNames
506  ),
507  __METHOD__,
508  array( 'ORDER BY' => 'oi_timestamp DESC' )
509  );
510  }
511 
512  public function newItem( $row ) {
513  return new RevDel_FileItem( $this, $row );
514  }
515 
516  public function clearFileOps() {
517  $this->deleteBatch = array();
518  $this->storeBatch = array();
519  $this->cleanupBatch = array();
520  }
521 
522  public function doPreCommitUpdates() {
523  $status = Status::newGood();
524  $repo = RepoGroup::singleton()->getLocalRepo();
525  if ( $this->storeBatch ) {
526  $status->merge( $repo->storeBatch( $this->storeBatch, FileRepo::OVERWRITE_SAME ) );
527  }
528  if ( !$status->isOK() ) {
529  return $status;
530  }
531  if ( $this->deleteBatch ) {
532  $status->merge( $repo->deleteBatch( $this->deleteBatch ) );
533  }
534  if ( !$status->isOK() ) {
535  // Running cleanupDeletedBatch() after a failed storeBatch() with the DB already
536  // modified (but destined for rollback) causes data loss
537  return $status;
538  }
539  if ( $this->cleanupBatch ) {
540  $status->merge( $repo->cleanupDeletedBatch( $this->cleanupBatch ) );
541  }
542  return $status;
543  }
544 
545  public function doPostCommitUpdates() {
546  global $wgUseSquid;
547  $file = wfLocalFile( $this->title );
548  $file->purgeCache();
549  $file->purgeDescription();
550  $purgeUrls = array();
551  foreach ( $this->ids as $timestamp ) {
552  $archiveName = $timestamp . '!' . $this->title->getDBkey();
553  $file->purgeOldThumbnails( $archiveName );
554  $purgeUrls[] = $file->getArchiveUrl( $archiveName );
555  }
556  if ( $wgUseSquid ) {
557  // purge full images from cache
558  SquidUpdate::purge( $purgeUrls );
559  }
560  return Status::newGood();
561  }
562 
563  public function getSuppressBit() {
565  }
566 }
567 
572 
576  var $file;
577 
578  public function __construct( $list, $row ) {
579  parent::__construct( $list, $row );
580  $this->file = RepoGroup::singleton()->getLocalRepo()->newFileFromRow( $row );
581  }
582 
583  public function getIdField() {
584  return 'oi_archive_name';
585  }
586 
587  public function getTimestampField() {
588  return 'oi_timestamp';
589  }
590 
591  public function getAuthorIdField() {
592  return 'oi_user';
593  }
594 
595  public function getAuthorNameField() {
596  return 'oi_user_text';
597  }
598 
599  public function getId() {
600  $parts = explode( '!', $this->row->oi_archive_name );
601  return $parts[0];
602  }
603 
604  public function canView() {
605  return $this->file->userCan( File::DELETED_RESTRICTED, $this->list->getUser() );
606  }
607 
608  public function canViewContent() {
609  return $this->file->userCan( File::DELETED_FILE, $this->list->getUser() );
610  }
611 
612  public function getBits() {
613  return $this->file->getVisibility();
614  }
615 
616  public function setBits( $bits ) {
617  # Queue the file op
618  # @todo FIXME: Move to LocalFile.php
619  if ( $this->isDeleted() ) {
620  if ( $bits & File::DELETED_FILE ) {
621  # Still deleted
622  } else {
623  # Newly undeleted
624  $key = $this->file->getStorageKey();
625  $srcRel = $this->file->repo->getDeletedHashPath( $key ) . $key;
626  $this->list->storeBatch[] = array(
627  $this->file->repo->getVirtualUrl( 'deleted' ) . '/' . $srcRel,
628  'public',
629  $this->file->getRel()
630  );
631  $this->list->cleanupBatch[] = $key;
632  }
633  } elseif ( $bits & File::DELETED_FILE ) {
634  # Newly deleted
635  $key = $this->file->getStorageKey();
636  $dstRel = $this->file->repo->getDeletedHashPath( $key ) . $key;
637  $this->list->deleteBatch[] = array( $this->file->getRel(), $dstRel );
638  }
639 
640  # Do the database operations
641  $dbw = wfGetDB( DB_MASTER );
642  $dbw->update( 'oldimage',
643  array( 'oi_deleted' => $bits ),
644  array(
645  'oi_name' => $this->row->oi_name,
646  'oi_timestamp' => $this->row->oi_timestamp,
647  'oi_deleted' => $this->getBits()
648  ),
649  __METHOD__
650  );
651  return (bool)$dbw->affectedRows();
652  }
653 
654  public function isDeleted() {
655  return $this->file->isDeleted( File::DELETED_FILE );
656  }
657 
663  protected function getLink() {
664  $date = htmlspecialchars( $this->list->getLanguage()->userTimeAndDate(
665  $this->file->getTimestamp(), $this->list->getUser() ) );
666 
667  if ( !$this->isDeleted() ) {
668  # Regular files...
669  return Html::rawElement( 'a', array( 'href' => $this->file->getUrl() ), $date );
670  }
671 
672  # Hidden files...
673  if ( !$this->canViewContent() ) {
674  $link = $date;
675  } else {
677  SpecialPage::getTitleFor( 'Revisiondelete' ),
678  $date,
679  array(),
680  array(
681  'target' => $this->list->title->getPrefixedText(),
682  'file' => $this->file->getArchiveName(),
683  'token' => $this->list->getUser()->getEditToken(
684  $this->file->getArchiveName() )
685  )
686  );
687  }
688  return '<span class="history-deleted">' . $link . '</span>';
689  }
690 
695  protected function getUserTools() {
696  if ( $this->file->userCan( Revision::DELETED_USER, $this->list->getUser() ) ) {
697  $uid = $this->file->getUser( 'id' );
698  $name = $this->file->getUser( 'text' );
700  } else {
701  $link = $this->list->msg( 'rev-deleted-user' )->escaped();
702  }
703  if ( $this->file->isDeleted( Revision::DELETED_USER ) ) {
704  return '<span class="history-deleted">' . $link . '</span>';
705  }
706  return $link;
707  }
708 
715  protected function getComment() {
716  if ( $this->file->userCan( File::DELETED_COMMENT, $this->list->getUser() ) ) {
717  $block = Linker::commentBlock( $this->file->getDescription() );
718  } else {
719  $block = ' ' . $this->list->msg( 'rev-deleted-comment' )->escaped();
720  }
721  if ( $this->file->isDeleted( File::DELETED_COMMENT ) ) {
722  return "<span class=\"history-deleted\">$block</span>";
723  }
724  return $block;
725  }
726 
727  public function getHTML() {
728  $data =
729  $this->list->msg( 'widthheight' )->numParams(
730  $this->file->getWidth(), $this->file->getHeight() )->text() .
731  ' (' . $this->list->msg( 'nbytes' )->numParams( $this->file->getSize() )->text() . ')';
732 
733  return '<li>' . $this->getLink() . ' ' . $this->getUserTools() . ' ' .
734  $data . ' ' . $this->getComment() . '</li>';
735  }
736 
737  public function getApiData( ApiResult $result ) {
738  $file = $this->file;
739  $user = $this->list->getUser();
740  $ret = array(
741  'title' => $this->list->title->getPrefixedText(),
742  'archivename' => $file->getArchiveName(),
743  'timestamp' => wfTimestamp( TS_ISO_8601, $file->getTimestamp() ),
744  'width' => $file->getWidth(),
745  'height' => $file->getHeight(),
746  'size' => $file->getSize(),
747  );
748  $ret += $file->isDeleted( Revision::DELETED_USER ) ? array( 'userhidden' => '' ) : array();
749  $ret += $file->isDeleted( Revision::DELETED_COMMENT ) ? array( 'commenthidden' => '' ) : array();
750  $ret += $this->isDeleted() ? array( 'contenthidden' => '' ) : array();
751  if ( !$this->isDeleted() ) {
752  $ret += array(
753  'url' => $file->getUrl(),
754  );
755  } elseif ( $this->canViewContent() ) {
756  $ret += array(
757  'url' => SpecialPage::getTitleFor( 'Revisiondelete' )->getLinkURL(
758  array(
759  'target' => $this->list->title->getPrefixedText(),
760  'file' => $file->getArchiveName(),
761  'token' => $user->getEditToken( $file->getArchiveName() )
762  ),
763  false, PROTO_RELATIVE
764  ),
765  );
766  }
768  $ret += array(
769  'userid' => $file->user,
770  'user' => $file->user_text,
771  );
772  }
774  $ret += array(
775  'comment' => $file->description,
776  );
777  }
778  return $ret;
779  }
780 }
781 
786  public function getType() {
787  return 'filearchive';
788  }
789 
790  public static function getRelationType() {
791  return 'fa_id';
792  }
793 
798  public function doQuery( $db ) {
799  $ids = array_map( 'intval', $this->ids );
800  return $db->select(
801  'filearchive',
803  array(
804  'fa_name' => $this->title->getDBkey(),
805  'fa_id' => $ids
806  ),
807  __METHOD__,
808  array( 'ORDER BY' => 'fa_id DESC' )
809  );
810  }
811 
812  public function newItem( $row ) {
813  return new RevDel_ArchivedFileItem( $this, $row );
814  }
815 }
816 
821  public function __construct( $list, $row ) {
823  $this->file = ArchivedFile::newFromRow( $row );
824  }
825 
826  public function getIdField() {
827  return 'fa_id';
828  }
829 
830  public function getTimestampField() {
831  return 'fa_timestamp';
832  }
833 
834  public function getAuthorIdField() {
835  return 'fa_user';
836  }
837 
838  public function getAuthorNameField() {
839  return 'fa_user_text';
840  }
841 
842  public function getId() {
843  return $this->row->fa_id;
844  }
845 
846  public function setBits( $bits ) {
847  $dbw = wfGetDB( DB_MASTER );
848  $dbw->update( 'filearchive',
849  array( 'fa_deleted' => $bits ),
850  array(
851  'fa_id' => $this->row->fa_id,
852  'fa_deleted' => $this->getBits(),
853  ),
854  __METHOD__
855  );
856  return (bool)$dbw->affectedRows();
857  }
858 
859  protected function getLink() {
860  $date = htmlspecialchars( $this->list->getLanguage()->userTimeAndDate(
861  $this->file->getTimestamp(), $this->list->getUser() ) );
862 
863  # Hidden files...
864  if ( !$this->canViewContent() ) {
865  $link = $date;
866  } else {
867  $undelete = SpecialPage::getTitleFor( 'Undelete' );
868  $key = $this->file->getKey();
869  $link = Linker::link( $undelete, $date, array(),
870  array(
871  'target' => $this->list->title->getPrefixedText(),
872  'file' => $key,
873  'token' => $this->list->getUser()->getEditToken( $key )
874  )
875  );
876  }
877  if ( $this->isDeleted() ) {
878  $link = '<span class="history-deleted">' . $link . '</span>';
879  }
880  return $link;
881  }
882 }
883 
888  public function getType() {
889  return 'logging';
890  }
891 
892  public static function getRelationType() {
893  return 'log_id';
894  }
895 
896  public static function getRestriction() {
897  return 'deletelogentry';
898  }
899 
900  public static function getRevdelConstant() {
902  }
903 
904  public static function suggestTarget( $target, array $ids ) {
905  $result = wfGetDB( DB_SLAVE )->select( 'logging',
906  'log_type',
907  array( 'log_id' => $ids ),
908  __METHOD__,
909  array( 'DISTINCT' )
910  );
911  if ( $result->numRows() == 1 ) {
912  // If there's only one type, the target can be set to include it.
913  return SpecialPage::getTitleFor( 'Log', $result->current()->log_type );
914  }
915  return SpecialPage::getTitleFor( 'Log' );
916  }
917 
922  public function doQuery( $db ) {
923  $ids = array_map( 'intval', $this->ids );
924  return $db->select( 'logging', '*',
925  array( 'log_id' => $ids ),
926  __METHOD__,
927  array( 'ORDER BY' => 'log_id DESC' )
928  );
929  }
930 
931  public function newItem( $row ) {
932  return new RevDel_LogItem( $this, $row );
933  }
934 
935  public function getSuppressBit() {
937  }
938 
939  public function getLogAction() {
940  return 'event';
941  }
942 
943  public function getLogParams( $params ) {
944  return array(
945  implode( ',', $params['ids'] ),
946  "ofield={$params['oldBits']}",
947  "nfield={$params['newBits']}"
948  );
949  }
950 }
951 
956  public function getIdField() {
957  return 'log_id';
958  }
959 
960  public function getTimestampField() {
961  return 'log_timestamp';
962  }
963 
964  public function getAuthorIdField() {
965  return 'log_user';
966  }
967 
968  public function getAuthorNameField() {
969  return 'log_user_text';
970  }
971 
972  public function canView() {
973  return LogEventsList::userCan( $this->row, Revision::DELETED_RESTRICTED, $this->list->getUser() );
974  }
975 
976  public function canViewContent() {
977  return true; // none
978  }
979 
980  public function getBits() {
981  return $this->row->log_deleted;
982  }
983 
984  public function setBits( $bits ) {
985  $dbw = wfGetDB( DB_MASTER );
986  $dbw->update( 'recentchanges',
987  array(
988  'rc_deleted' => $bits,
989  'rc_patrolled' => 1
990  ),
991  array(
992  'rc_logid' => $this->row->log_id,
993  'rc_timestamp' => $this->row->log_timestamp // index
994  ),
995  __METHOD__
996  );
997  $dbw->update( 'logging',
998  array( 'log_deleted' => $bits ),
999  array(
1000  'log_id' => $this->row->log_id,
1001  'log_deleted' => $this->getBits()
1002  ),
1003  __METHOD__
1004  );
1005  return (bool)$dbw->affectedRows();
1006  }
1008  public function getHTML() {
1009  $date = htmlspecialchars( $this->list->getLanguage()->userTimeAndDate(
1010  $this->row->log_timestamp, $this->list->getUser() ) );
1011  $title = Title::makeTitle( $this->row->log_namespace, $this->row->log_title );
1012  $formatter = LogFormatter::newFromRow( $this->row );
1013  $formatter->setContext( $this->list->getContext() );
1014  $formatter->setAudience( LogFormatter::FOR_THIS_USER );
1015 
1016  // Log link for this page
1017  $loglink = Linker::link(
1018  SpecialPage::getTitleFor( 'Log' ),
1019  $this->list->msg( 'log' )->escaped(),
1020  array(),
1021  array( 'page' => $title->getPrefixedText() )
1022  );
1023  $loglink = $this->list->msg( 'parentheses' )->rawParams( $loglink )->escaped();
1024  // User links and action text
1025  $action = $formatter->getActionText();
1026  // Comment
1027  $comment = $this->list->getLanguage()->getDirMark() . Linker::commentBlock( $this->row->log_comment );
1028  if ( LogEventsList::isDeleted( $this->row, LogPage::DELETED_COMMENT ) ) {
1029  $comment = '<span class="history-deleted">' . $comment . '</span>';
1030  }
1031 
1032  return "<li>$loglink $date $action $comment</li>";
1033  }
1035  public function getApiData( ApiResult $result ) {
1036  $logEntry = DatabaseLogEntry::newFromRow( $this->row );
1037  $user = $this->list->getUser();
1038  $ret = array(
1039  'id' => $logEntry->getId(),
1040  'type' => $logEntry->getType(),
1041  'action' => $logEntry->getSubtype(),
1042  );
1043  $ret += $logEntry->isDeleted( LogPage::DELETED_USER ) ? array( 'userhidden' => '' ) : array();
1044  $ret += $logEntry->isDeleted( LogPage::DELETED_COMMENT ) ? array( 'commenthidden' => '' ) : array();
1045  $ret += $logEntry->isDeleted( LogPage::DELETED_ACTION ) ? array( 'actionhidden' => '' ) : array();
1046 
1047  if ( LogEventsList::userCan( $this->row, LogPage::DELETED_ACTION, $user ) ) {
1049  $result,
1050  $ret,
1051  $logEntry->getParameters(),
1052  $logEntry->getType(),
1053  $logEntry->getSubtype(),
1054  $logEntry->getTimestamp(),
1055  $logEntry->isLegacy()
1056  );
1057  }
1058  if ( LogEventsList::userCan( $this->row, LogPage::DELETED_USER, $user ) ) {
1059  $ret += array(
1060  'userid' => $this->row->log_user,
1061  'user' => $this->row->log_user_text,
1062  );
1063  }
1064  if ( LogEventsList::userCan( $this->row, LogPage::DELETED_COMMENT, $user ) ) {
1065  $ret += array(
1066  'comment' => $this->row->log_comment,
1067  );
1068  }
1069  return $ret;
1070  }
1071 }
RevDel_ArchiveItem\getAuthorNameField
getAuthorNameField()
Get the DB field name storing user names.
Definition: RevisionDelete.php:375
RevDel_Item
Abstract base class for deletable items.
Definition: RevisionDeleteAbstracts.php:318
RevDel_RevisionList\getRestriction
static getRestriction()
Get the user right required for this list type Override this function.
Definition: RevisionDelete.php:44
Revision\DELETED_USER
const DELETED_USER
Definition: Revision.php:67
FakeResultWrapper
Overloads the relevant methods of the real ResultsWrapper so it doesn't go anywhere near an actual da...
Definition: DatabaseUtility.php:230
RevDel_LogList\getType
getType()
Get the internal type name of this list.
Definition: RevisionDelete.php:887
Title\makeTitle
static & makeTitle( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
Definition: Title.php:398
RevDel_LogItem\setBits
setBits( $bits)
Set the visibility of the item.
Definition: RevisionDelete.php:983
Revision\DELETED_RESTRICTED
const DELETED_RESTRICTED
Definition: Revision.php:68
$result
The index of the header message $result[1]=The index of the body text message $result[2 through n]=Parameters passed to body text message. Please note the header message cannot receive/use parameters. 'ImportHandleLogItemXMLTag':When parsing a XML tag in a log item. $reader:XMLReader object $logInfo:Array of information Return false to stop further processing of the tag 'ImportHandlePageXMLTag':When parsing a XML tag in a page. $reader:XMLReader object $pageInfo:Array of information Return false to stop further processing of the tag 'ImportHandleRevisionXMLTag':When parsing a XML tag in a page revision. $reader:XMLReader object $pageInfo:Array of page information $revisionInfo:Array of revision information Return false to stop further processing of the tag 'ImportHandleToplevelXMLTag':When parsing a top level XML tag. $reader:XMLReader object Return false to stop further processing of the tag 'ImportHandleUploadXMLTag':When parsing a XML tag in a file upload. $reader:XMLReader object $revisionInfo:Array of information Return false to stop further processing of the tag 'InfoAction':When building information to display on the action=info page. $context:IContextSource object & $pageInfo:Array of information 'InitializeArticleMaybeRedirect':MediaWiki check to see if title is a redirect. $title:Title object for the current page $request:WebRequest $ignoreRedirect:boolean to skip redirect check $target:Title/string of redirect target $article:Article object 'InterwikiLoadPrefix':When resolving if a given prefix is an interwiki or not. Return true without providing an interwiki to continue interwiki search. $prefix:interwiki prefix we are looking for. & $iwData:output array describing the interwiki with keys iw_url, iw_local, iw_trans and optionally iw_api and iw_wikiid. 'InternalParseBeforeSanitize':during Parser 's internalParse method just before the parser removes unwanted/dangerous HTML tags and after nowiki/noinclude/includeonly/onlyinclude and other processings. Ideal for syntax-extensions after template/parser function execution which respect nowiki and HTML-comments. & $parser:Parser object & $text:string containing partially parsed text & $stripState:Parser 's internal StripState object 'InternalParseBeforeLinks':during Parser 's internalParse method before links but after nowiki/noinclude/includeonly/onlyinclude and other processings. & $parser:Parser object & $text:string containing partially parsed text & $stripState:Parser 's internal StripState object 'InvalidateEmailComplete':Called after a user 's email has been invalidated successfully. $user:user(object) whose email is being invalidated 'IRCLineURL':When constructing the URL to use in an IRC notification. Callee may modify $url and $query, URL will be constructed as $url . $query & $url:URL to index.php & $query:Query string $rc:RecentChange object that triggered url generation 'IsFileCacheable':Override the result of Article::isFileCacheable()(if true) $article:article(object) being checked 'IsTrustedProxy':Override the result of wfIsTrustedProxy() $ip:IP being check $result:Change this value to override the result of wfIsTrustedProxy() 'IsUploadAllowedFromUrl':Override the result of UploadFromUrl::isAllowedUrl() $url:URL used to upload from & $allowed:Boolean indicating if uploading is allowed for given URL 'isValidEmailAddr':Override the result of User::isValidEmailAddr(), for instance to return false if the domain name doesn 't match your organization. $addr:The e-mail address entered by the user & $result:Set this and return false to override the internal checks 'isValidPassword':Override the result of User::isValidPassword() $password:The password entered by the user & $result:Set this and return false to override the internal checks $user:User the password is being validated for 'Language::getMessagesFileName':$code:The language code or the language we 're looking for a messages file for & $file:The messages file path, you can override this to change the location. 'LanguageGetNamespaces':Provide custom ordering for namespaces or remove namespaces. Do not use this hook to add namespaces. Use CanonicalNamespaces for that. & $namespaces:Array of namespaces indexed by their numbers 'LanguageGetMagic':DEPRECATED, use $magicWords in a file listed in $wgExtensionMessagesFiles instead. Use this to define synonyms of magic words depending of the language $magicExtensions:associative array of magic words synonyms $lang:language code(string) 'LanguageGetSpecialPageAliases':DEPRECATED, use $specialPageAliases in a file listed in $wgExtensionMessagesFiles instead. Use to define aliases of special pages names depending of the language $specialPageAliases:associative array of magic words synonyms $lang:language code(string) 'LanguageGetTranslatedLanguageNames':Provide translated language names. & $names:array of language code=> language name $code language of the preferred translations 'LanguageLinks':Manipulate a page 's language links. This is called in various places to allow extensions to define the effective language links for a page. $title:The page 's Title. & $links:Associative array mapping language codes to prefixed links of the form "language:title". & $linkFlags:Associative array mapping prefixed links to arrays of flags. Currently unused, but planned to provide support for marking individual language links in the UI, e.g. for featured articles. 'LinkBegin':Used when generating internal and interwiki links in Linker::link(), before processing starts. Return false to skip default processing and return $ret. See documentation for Linker::link() for details on the expected meanings of parameters. $skin:the Skin object $target:the Title that the link is pointing to & $html:the contents that the< a > tag should have(raw HTML) $result
Definition: hooks.txt:1528
RevDel_ArchivedFileItem\getAuthorIdField
getAuthorIdField()
Get the DB field name storing user ids.
Definition: RevisionDelete.php:833
LogFormatter\FOR_THIS_USER
const FOR_THIS_USER
Definition: LogFormatter.php:36
RevDel_FileItem\getHTML
getHTML()
Get the HTML of the list item.
Definition: RevisionDelete.php:726
Linker\commentBlock
static commentBlock( $comment, $title=null, $local=false)
Wrap a comment in standard punctuation and formatting if it's non-empty, otherwise return empty strin...
Definition: Linker.php:1556
RevDel_ArchiveItem\getRevisionLink
getRevisionLink()
Get the HTML link to the revision text.
Definition: RevisionDelete.php:400
DB_MASTER
const DB_MASTER
Definition: Defines.php:56
RevDel_RevisionItem\getDiffLink
getDiffLink()
Get the HTML link to the diff.
Definition: RevisionDelete.php:254
RepoGroup\singleton
static singleton()
Get a RepoGroup instance.
Definition: RepoGroup.php:53
Revision\DELETED_COMMENT
const DELETED_COMMENT
Definition: Revision.php:66
File\getHeight
getHeight( $page=1)
Return the height of the image.
Definition: File.php:437
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
Revision\newFromId
static newFromId( $id, $flags=0)
Load a page revision from a given revision ID number.
Definition: Revision.php:88
Revision\pageJoinCond
static pageJoinCond()
Return the value of a select() page conds array for the page table.
Definition: Revision.php:396
RevDel_FileList\$storeBatch
$storeBatch
Definition: RevisionDelete.php:489
RevDel_RevisionItem\canView
canView()
Returns true if the current user can view the item.
Definition: RevisionDelete.php:173
ApiQueryLogEvents\addLogParams
static addLogParams( $result, &$vals, $params, $type, $action, $ts, $legacy=false)
Definition: ApiQueryLogEvents.php:248
Linker\revUserLink
static revUserLink( $rev, $isPublic=false)
Generate a user link if the current user is allowed to view it.
Definition: Linker.php:1198
RevDel_RevisionList\newItem
newItem( $row)
Create an item object from a DB result row.
Definition: RevisionDelete.php:109
FileRepo\OVERWRITE_SAME
const OVERWRITE_SAME
Definition: FileRepo.php:40
Linker\userLink
static userLink( $userId, $userName, $altUserName=false)
Make user link (or user contributions for unregistered users)
Definition: Linker.php:1072
File\DELETED_RESTRICTED
const DELETED_RESTRICTED
Definition: File.php:55
RevDel_FileList\getRevdelConstant
static getRevdelConstant()
Get the revision deletion constant for this list type Override this function.
Definition: RevisionDelete.php:485
RevDel_LogItem\getIdField
getIdField()
Get the DB field name associated with the ID list.
Definition: RevisionDelete.php:955
RevDel_FileList\doPreCommitUpdates
doPreCommitUpdates()
A hook for setVisibility(): do batch updates pre-commit.
Definition: RevisionDelete.php:522
RevDel_ArchivedFileItem\getId
getId()
Get the ID, as it would appear in the ids URL parameter.
Definition: RevisionDelete.php:841
wfGetDB
& wfGetDB( $db, $groups=array(), $wiki=false)
Get a Database object.
Definition: GlobalFunctions.php:3650
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
RevDel_RevisionList\doPostCommitUpdates
doPostCommitUpdates()
A hook for setVisibility(): do any necessary updates post-commit.
Definition: RevisionDelete.php:138
RevDel_RevisionList\suggestTarget
static suggestTarget( $target, array $ids)
Suggest a target for the revision deletion Optionally override this function.
Definition: RevisionDelete.php:52
$timestamp
if( $limit) $timestamp
Definition: importImages.php:104
RevDel_FileList\clearFileOps
clearFileOps()
Clear any data structures needed for doPreCommitUpdates() and doPostCommitUpdates() STUB.
Definition: RevisionDelete.php:516
RevDel_LogList\getRelationType
static getRelationType()
Get the DB field name associated with the ID list.
Definition: RevisionDelete.php:891
RevisionItemBase\$list
$list
The parent RevisionListBase.
Definition: RevisionList.php:132
RevDel_RevisionItem\isDeleted
isDeleted()
Definition: RevisionDelete.php:217
wfTimestamp
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
Definition: GlobalFunctions.php:2483
RevDel_RevisionItem\getTimestampField
getTimestampField()
Get the DB field name storing timestamps.
Definition: RevisionDelete.php:161
RevDel_ArchiveItem
Item class for a archive table row.
Definition: RevisionDelete.php:356
File\getTimestamp
getTimestamp()
Get the 14-character timestamp of the file upload.
Definition: File.php:1804
RevDel_RevisionList\doQuery
doQuery( $db)
Definition: RevisionDelete.php:61
$ret
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 & $ret
Definition: hooks.txt:1530
RevisionItemBase\__construct
__construct( $list, $row)
Definition: RevisionList.php:141
RevDel_ArchiveList
List for archive table items, i.e.
Definition: RevisionDelete.php:311
RevDel_ArchivedFileItem\getIdField
getIdField()
Get the DB field name associated with the ID list.
Definition: RevisionDelete.php:825
RevDel_LogItem\getApiData
getApiData(ApiResult $result)
Get the return information about the revision for the API.
Definition: RevisionDelete.php:1034
Status\newGood
static newGood( $value=null)
Factory function for good results.
Definition: Status.php:77
RevDel_LogList\getLogAction
getLogAction()
Get the log action for this list type.
Definition: RevisionDelete.php:938
File\getUrl
getUrl()
Return the URL of the file.
Definition: File.php:324
$params
$params
Definition: styleTest.css.php:40
RevDel_FileItem\getAuthorNameField
getAuthorNameField()
Get the DB field name storing user names.
Definition: RevisionDelete.php:594
RevDel_ArchiveItem\setBits
setBits( $bits)
Set the visibility of the item.
Definition: RevisionDelete.php:384
RevDel_ArchivedFileItem\setBits
setBits( $bits)
Set the visibility of the item.
Definition: RevisionDelete.php:845
File\getWidth
getWidth( $page=1)
Return the width of the image.
Definition: File.php:423
RevDel_RevisionList\getCurrent
getCurrent()
Definition: RevisionDelete.php:120
RevDel_ArchivedFileList\newItem
newItem( $row)
Create an item object from a DB result row.
Definition: RevisionDelete.php:811
OldLocalFile\selectFields
static selectFields()
Fields in the oldimage table.
Definition: OldLocalFile.php:106
RevDel_RevisionItem\getAuthorNameField
getAuthorNameField()
Get the DB field name storing user names.
Definition: RevisionDelete.php:169
SpecialPage\getTitleFor
static getTitleFor( $name, $subpage=false, $fragment='')
Get a localised Title object for a specified special page name.
Definition: SpecialPage.php:74
RevDel_FileList\doQuery
doQuery( $db)
Definition: RevisionDelete.php:495
RevDel_ArchiveItem\getIdField
getIdField()
Get the DB field name associated with the ID list.
Definition: RevisionDelete.php:363
RevDel_RevisionList\getSuppressBit
getSuppressBit()
Get the integer value of the flag used for suppression.
Definition: RevisionDelete.php:129
RevDel_FileItem\canViewContent
canViewContent()
Returns true if the current user can view the item text/file.
Definition: RevisionDelete.php:607
RevDel_FileItem\getBits
getBits()
Get the current deletion bitfield value.
Definition: RevisionDelete.php:611
RevDel_ArchivedFileItem\getLink
getLink()
Get the link to the file.
Definition: RevisionDelete.php:858
RevDel_ArchiveItem\getDiffLink
getDiffLink()
Get the HTML link to the diff.
Definition: RevisionDelete.php:419
RevDel_FileList\doPostCommitUpdates
doPostCommitUpdates()
A hook for setVisibility(): do any necessary updates post-commit.
Definition: RevisionDelete.php:545
$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
RevDel_ArchiveItem\getTimestampField
getTimestampField()
Get the DB field name storing timestamps.
Definition: RevisionDelete.php:367
RevDel_FileItem\__construct
__construct( $list, $row)
Definition: RevisionDelete.php:577
RevDel_FileList\getRestriction
static getRestriction()
Get the user right required for this list type Override this function.
Definition: RevisionDelete.php:481
RevDel_LogItem\getHTML
getHTML()
Get the HTML of the list item.
Definition: RevisionDelete.php:1007
File\isDeleted
isDeleted( $field)
Is this file a "deleted" file in a private archive? STUB.
Definition: File.php:1587
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
RevDel_RevisionList\getType
getType()
Get the internal type name of this list.
Definition: RevisionDelete.php:36
RevDel_LogItem\canViewContent
canViewContent()
Returns true if the current user can view the item text/file.
Definition: RevisionDelete.php:975
RevDel_LogItem\canView
canView()
Returns true if the current user can view the item.
Definition: RevisionDelete.php:971
RevDel_LogList\doQuery
doQuery( $db)
Definition: RevisionDelete.php:921
RevDel_ArchivedFileList\getRelationType
static getRelationType()
Get the DB field name associated with the ID list.
Definition: RevisionDelete.php:789
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
Revision\FOR_THIS_USER
const FOR_THIS_USER
Definition: Revision.php:73
Revision
Definition: Revision.php:26
RevDel_FileList
List for oldimage table items.
Definition: RevisionDelete.php:472
title
to move a page</td >< td > &*You are moving the page across *A non empty talk page already exists under the new or *You uncheck the box below In those you will have to move or merge the page manually if desired</td >< td > be sure to &You are responsible for making sure that links continue to point where they are supposed to go Note that the page will &a page at the new title
Definition: All_system_messages.txt:2703
RevDel_LogItem
Item class for a logging table row.
Definition: RevisionDelete.php:954
file
We ve cleaned up the code here by removing clumps of infrequently used code and moving them off somewhere else It s much easier for someone working with this code to see what s _really_ going and make changes or fix bugs In we can take all the code that deals with the little used title reversing we can concentrate it all in an extension file
Definition: hooks.txt:93
RevDel_RevisionItem\setBits
setBits( $bits)
Set the visibility of the item.
Definition: RevisionDelete.php:185
RevDel_ArchivedRevisionItem\setBits
setBits( $bits)
Set the visibility of the item.
Definition: RevisionDelete.php:457
File
Implements some public methods and some protected utility functions which are required by multiple ch...
Definition: File.php:50
RevDel_LogList\suggestTarget
static suggestTarget( $target, array $ids)
Suggest a target for the revision deletion Optionally override this function.
Definition: RevisionDelete.php:903
RevDel_ArchivedRevisionItem\getIdField
getIdField()
Get the DB field name associated with the ID list.
Definition: RevisionDelete.php:449
RevDel_ArchivedFileList\doQuery
doQuery( $db)
Definition: RevisionDelete.php:797
MWException
MediaWiki exception.
Definition: MWException.php:26
RevDel_LogItem\getAuthorNameField
getAuthorNameField()
Get the DB field name storing user names.
Definition: RevisionDelete.php:967
File\DELETED_COMMENT
const DELETED_COMMENT
Definition: File.php:53
DatabaseLogEntry\newFromRow
static newFromRow( $row)
Constructs new LogEntry from database result row.
Definition: LogEntry.php:163
RevDel_ArchivedRevisionItem\__construct
__construct( $list, $row)
Definition: RevisionDelete.php:442
LogPage\DELETED_COMMENT
const DELETED_COMMENT
Definition: LogPage.php:34
RevDel_LogList\getRevdelConstant
static getRevdelConstant()
Get the revision deletion constant for this list type Override this function.
Definition: RevisionDelete.php:899
RevDel_ArchiveList\doPostCommitUpdates
doPostCommitUpdates()
A hook for setVisibility(): do any necessary updates post-commit.
Definition: RevisionDelete.php:348
LogFormatter\newFromRow
static newFromRow( $row)
Handy shortcut for constructing a formatter directly from database row.
Definition: LogFormatter.php:71
ApiResult
This class represents the result of the API operations.
Definition: ApiResult.php:44
RevDel_RevisionItem\$revision
$revision
Definition: RevisionDelete.php:150
LogPage\DELETED_USER
const DELETED_USER
Definition: LogPage.php:35
RevDel_ArchivedFileList
List for filearchive table items.
Definition: RevisionDelete.php:784
RevDel_ArchivedRevisionItem\getId
getId()
Get the ID, as it would appear in the ids URL parameter.
Definition: RevisionDelete.php:453
RevDel_ArchivedFileItem\getAuthorNameField
getAuthorNameField()
Get the DB field name storing user names.
Definition: RevisionDelete.php:837
TS_ISO_8601
const TS_ISO_8601
ISO 8601 format with no timezone: 1986-02-09T20:00:00Z.
Definition: GlobalFunctions.php:2448
RevDel_List
Abstract base class for a list of deletable items.
Definition: RevisionDeleteAbstracts.php:30
SquidUpdate\purge
static purge( $urlArr)
Purges a list of Squids defined in $wgSquidServers.
Definition: SquidUpdate.php:134
RevDel_ArchiveList\newItem
newItem( $row)
Create an item object from a DB result row.
Definition: RevisionDelete.php:340
wfRunHooks
wfRunHooks( $event, array $args=array(), $deprecatedVersion=null)
Call hook functions defined in $wgHooks.
Definition: GlobalFunctions.php:4001
RevDel_FileList\newItem
newItem( $row)
Create an item object from a DB result row.
Definition: RevisionDelete.php:512
RevDel_FileItem\getTimestampField
getTimestampField()
Get the DB field name storing timestamps.
Definition: RevisionDelete.php:586
array
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
global
when a variable name is used in a it is silently declared as a new masking the global
Definition: design.txt:93
$comment
$comment
Definition: importImages.php:107
RevDel_FileList\getRelationType
static getRelationType()
Get the DB field name associated with the ID list.
Definition: RevisionDelete.php:477
RevDel_ArchiveList\getType
getType()
Get the internal type name of this list.
Definition: RevisionDelete.php:312
RevDel_FileItem\getIdField
getIdField()
Get the DB field name associated with the ID list.
Definition: RevisionDelete.php:582
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
RevDel_ArchiveList\doQuery
doQuery( $db)
Definition: RevisionDelete.php:324
LogPage\DELETED_ACTION
const DELETED_ACTION
Definition: LogPage.php:33
RevDel_ArchivedFileItem\__construct
__construct( $list, $row)
Definition: RevisionDelete.php:820
RevDel_RevisionList\getRevdelConstant
static getRevdelConstant()
Get the revision deletion constant for this list type Override this function.
Definition: RevisionDelete.php:48
Linker\revComment
static revComment(Revision $rev, $local=false, $isPublic=false)
Wrap and format the given revision's comment block, if the current user is allowed to view it.
Definition: Linker.php:1578
$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
Linker\userToolLinks
static userToolLinks( $userId, $userText, $redContribsWhenNoEdits=false, $flags=0, $edits=null)
Generate standard user tool links (talk, contributions, block link, etc.)
Definition: Linker.php:1100
RevisionItemBase\getId
getId()
Get the ID, as it would appear in the ids URL parameter.
Definition: RevisionList.php:186
RevisionListBase\$ids
$ids
Definition: RevisionList.php:31
RevDel_FileItem\getApiData
getApiData(ApiResult $result)
Get the return information about the revision for the API.
Definition: RevisionDelete.php:736
RevDel_RevisionItem\getIdField
getIdField()
Get the DB field name associated with the ID list.
Definition: RevisionDelete.php:157
RevDel_FileItem
Item class for an oldimage table row.
Definition: RevisionDelete.php:571
RevisionItemBase\$row
$row
The DB result row.
Definition: RevisionList.php:135
RevDel_ArchivedFileItem
Item class for a filearchive table row.
Definition: RevisionDelete.php:819
RevDel_LogItem\getBits
getBits()
Get the current deletion bitfield value.
Definition: RevisionDelete.php:979
Revision\newFromArchiveRow
static newFromArchiveRow( $row, $overrides=array())
Make a fake revision object from an archive table row.
Definition: Revision.php:159
PROTO_RELATIVE
const PROTO_RELATIVE
Definition: Defines.php:269
RevDel_FileList\getSuppressBit
getSuppressBit()
Get the integer value of the flag used for suppression.
Definition: RevisionDelete.php:563
RevDel_ArchivedFileList\getType
getType()
Get the internal type name of this list.
Definition: RevisionDelete.php:785
RevDel_ArchiveItem\getAuthorIdField
getAuthorIdField()
Get the DB field name storing user ids.
Definition: RevisionDelete.php:371
RevDel_LogList\newItem
newItem( $row)
Create an item object from a DB result row.
Definition: RevisionDelete.php:930
RevDel_RevisionItem\getRevisionLink
getRevisionLink()
Get the HTML link to the revision text.
Definition: RevisionDelete.php:231
$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
RevDel_LogItem\getTimestampField
getTimestampField()
Get the DB field name storing timestamps.
Definition: RevisionDelete.php:959
RevDel_FileItem\getLink
getLink()
Get the link to the file.
Definition: RevisionDelete.php:662
RevDel_RevisionItem\getAuthorIdField
getAuthorIdField()
Get the DB field name storing user ids.
Definition: RevisionDelete.php:165
RevDel_ArchiveItem\__construct
__construct( $list, $row)
Definition: RevisionDelete.php:357
$file
if(PHP_SAPI !='cli') $file
Definition: UtfNormalTest2.php:30
RevDel_ArchiveList\getRelationType
static getRelationType()
Get the DB field name associated with the ID list.
Definition: RevisionDelete.php:316
RevDel_RevisionList\getRelationType
static getRelationType()
Get the DB field name associated with the ID list.
Definition: RevisionDelete.php:40
RevDel_RevisionList\$currentRevId
$currentRevId
Definition: RevisionDelete.php:34
$rev
presenting them properly to the user as errors is done by the caller return true use this to change the list i e etc $rev
Definition: hooks.txt:1337
RevDel_FileItem\getId
getId()
Get the ID, as it would appear in the ids URL parameter.
Definition: RevisionDelete.php:598
RevDel_RevisionItem\getHTML
getHTML()
Get the HTML of the list item.
Definition: RevisionDelete.php:271
DB_SLAVE
const DB_SLAVE
Definition: Defines.php:55
RevDel_FileItem\$file
File $file
Definition: RevisionDelete.php:575
RevDel_LogList\getSuppressBit
getSuppressBit()
Get the integer value of the flag used for suppression.
Definition: RevisionDelete.php:934
RevDel_LogList
List for logging table items.
Definition: RevisionDelete.php:886
RevDel_RevisionItem
Item class for a live revision table row.
Definition: RevisionDelete.php:149
RevDel_FileList\getType
getType()
Get the internal type name of this list.
Definition: RevisionDelete.php:473
RevDel_LogItem\getAuthorIdField
getAuthorIdField()
Get the DB field name storing user ids.
Definition: RevisionDelete.php:963
RevDel_FileItem\setBits
setBits( $bits)
Set the visibility of the item.
Definition: RevisionDelete.php:615
RevDel_RevisionItem\getBits
getBits()
Get the current deletion bitfield value.
Definition: RevisionDelete.php:181
RevDel_ArchivedRevisionItem
Item class for a archive table row by ar_rev_id – actually used via RevDel_RevisionList.
Definition: RevisionDelete.php:441
RevDel_FileItem\getUserTools
getUserTools()
Generate a user tool link cluster if the current user is allowed to view it.
Definition: RevisionDelete.php:694
RevDel_RevisionList
List for revision table items.
Definition: RevisionDelete.php:33
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
RevDel_RevisionItem\getApiData
getApiData(ApiResult $result)
Get the return information about the revision for the API.
Definition: RevisionDelete.php:283
Revision\userJoinCond
static userJoinCond()
Return the value of a select() JOIN conds array for the user table.
Definition: Revision.php:386
LogEventsList\userCan
static userCan( $row, $field, User $user=null)
Determine if the current user is allowed to view a particular field of this log row,...
Definition: LogEventsList.php:443
LogEventsList\isDeleted
static isDeleted( $row, $field)
Definition: LogEventsList.php:480
RevDel_LogList\getLogParams
getLogParams( $params)
Get log parameter array.
Definition: RevisionDelete.php:942
RevDel_LogList\getRestriction
static getRestriction()
Get the user right required for this list type Override this function.
Definition: RevisionDelete.php:895
RevDel_ArchivedFileItem\getTimestampField
getTimestampField()
Get the DB field name storing timestamps.
Definition: RevisionDelete.php:829
File\DELETED_FILE
const DELETED_FILE
Definition: File.php:52
Revision\selectUserFields
static selectUserFields()
Return the list of user fields that should be selected from user table.
Definition: Revision.php:493
RevDel_FileItem\canView
canView()
Returns true if the current user can view the item.
Definition: RevisionDelete.php:603
RevDel_RevisionItem\__construct
__construct( $list, $row)
Definition: RevisionDelete.php:152
RevDel_RevisionItem\isHideCurrentOp
isHideCurrentOp( $newBits)
Returns true if the item is "current", and the operation to set the given bits can't be executed for ...
Definition: RevisionDelete.php:221
RevDel_RevisionList\doPreCommitUpdates
doPreCommitUpdates()
A hook for setVisibility(): do batch updates pre-commit.
Definition: RevisionDelete.php:133
ArchivedFile\selectFields
static selectFields()
Fields in the filearchive table.
Definition: ArchivedFile.php:190
Html\rawElement
static rawElement( $element, $attribs=array(), $contents='')
Returns an HTML element in a string.
Definition: Html.php:124
Revision\selectFields
static selectFields()
Return the list of revision fields that should be selected to create a new revision.
Definition: Revision.php:405
RevDel_FileItem\getComment
getComment()
Wrap and format the file's comment block, if the current user is allowed to view it.
Definition: RevisionDelete.php:714
RevDel_ArchiveItem\getId
getId()
Get the ID, as it would appear in the ids URL parameter.
Definition: RevisionDelete.php:379
RevDel_FileItem\getAuthorIdField
getAuthorIdField()
Get the DB field name storing user ids.
Definition: RevisionDelete.php:590
File\userCan
userCan( $field, User $user=null)
Determine if the current user is allowed to view a particular field of this file, if it's marked as d...
Definition: File.php:1845
RevDel_FileItem\isDeleted
isDeleted()
Definition: RevisionDelete.php:653
wfLocalFile
wfLocalFile( $title)
Get an object referring to a locally registered file.
Definition: GlobalFunctions.php:3704
RevDel_FileList\$cleanupBatch
$cleanupBatch
Definition: RevisionDelete.php:489
RevDel_RevisionItem\canViewContent
canViewContent()
Returns true if the current user can view the item text/file.
Definition: RevisionDelete.php:177
RevDel_ArchiveList\doPreCommitUpdates
doPreCommitUpdates()
A hook for setVisibility(): do batch updates pre-commit.
Definition: RevisionDelete.php:344
Revision\DELETED_TEXT
const DELETED_TEXT
Definition: Revision.php:65
File\getSize
getSize()
Return the size of the image file, in bytes Overridden by LocalFile, UnregisteredLocalFile STUB.
Definition: File.php:612
ArchivedFile\newFromRow
static newFromRow( $row)
Loads a file object from the filearchive table.
Definition: ArchivedFile.php:179
RevDel_FileList\$deleteBatch
$deleteBatch
Definition: RevisionDelete.php:489