MediaWiki  master
HistoryPager.php
Go to the documentation of this file.
1 <?php
27 
36  public $lastRow = false;
37 
39 
40  protected $oldIdChecked;
41 
42  protected $preventClickjacking = false;
46  protected $parentLens;
47 
49  protected $showTagEditUI;
50 
52  private $tagFilter;
53 
55  private $revisionStore;
56 
65  public function __construct(
67  $year = '',
68  $month = '',
69  $tagFilter = '',
70  array $conds = [],
71  $day = ''
72  ) {
73  parent::__construct( $historyPage->getContext() );
74  $this->historyPage = $historyPage;
75  $this->tagFilter = $tagFilter;
76  $this->getDateCond( $year, $month, $day );
77  $this->conds = $conds;
78  $this->showTagEditUI = ChangeTags::showTagEditingUI( $this->getUser() );
79  $this->revisionStore = MediaWikiServices::getInstance()->getRevisionStore();
80  }
81 
82  // For hook compatibility...
83  public function getArticle() {
84  return $this->historyPage->getArticle();
85  }
86 
87  protected function getSqlComment() {
88  if ( $this->conds ) {
89  return 'history page filtered'; // potentially slow, see CR r58153
90  } else {
91  return 'history page unfiltered';
92  }
93  }
94 
95  public function getQueryInfo() {
96  $revQuery = $this->revisionStore->getQueryInfo( [ 'user' ] );
97  $queryInfo = [
98  'tables' => $revQuery['tables'],
99  'fields' => $revQuery['fields'],
100  'conds' => array_merge(
101  [ 'rev_page' => $this->getWikiPage()->getId() ],
102  $this->conds ),
103  'options' => [ 'USE INDEX' => [ 'revision' => 'page_timestamp' ] ],
104  'join_conds' => $revQuery['joins'],
105  ];
107  $queryInfo['tables'],
108  $queryInfo['fields'],
109  $queryInfo['conds'],
110  $queryInfo['join_conds'],
111  $queryInfo['options'],
112  $this->tagFilter
113  );
114 
115  $this->getHookRunner()->onPageHistoryPager__getQueryInfo( $this, $queryInfo );
116 
117  return $queryInfo;
118  }
119 
120  public function getIndexField() {
121  return [ [ 'rev_timestamp', 'rev_id' ] ];
122  }
123 
128  public function formatRow( $row ) {
129  if ( $this->lastRow ) {
130  $firstInList = $this->counter == 1;
131  $this->counter++;
132 
133  $notifTimestamp = $this->getConfig()->get( 'ShowUpdatedMarker' )
134  ? $this->getTitle()->getNotificationTimestamp( $this->getUser() )
135  : false;
136 
137  $s = $this->historyLine( $this->lastRow, $row, $notifTimestamp, false, $firstInList );
138  } else {
139  $s = '';
140  }
141  $this->lastRow = $row;
142 
143  return $s;
144  }
145 
146  protected function doBatchLookups() {
147  if ( !$this->getHookRunner()->onPageHistoryPager__doBatchLookups( $this, $this->mResult ) ) {
148  return;
149  }
150 
151  # Do a link batch query
152  $this->mResult->seek( 0 );
153  $batch = new LinkBatch();
154  $revIds = [];
155  foreach ( $this->mResult as $row ) {
156  if ( $row->rev_parent_id ) {
157  $revIds[] = $row->rev_parent_id;
158  }
159  if ( $row->user_name !== null ) {
160  $batch->add( NS_USER, $row->user_name );
161  $batch->add( NS_USER_TALK, $row->user_name );
162  } else { # for anons or usernames of imported revisions
163  $batch->add( NS_USER, $row->rev_user_text );
164  $batch->add( NS_USER_TALK, $row->rev_user_text );
165  }
166  }
167  $this->parentLens = $this->revisionStore->getRevisionSizes( $revIds );
168  $batch->execute();
169  $this->mResult->seek( 0 );
170  }
171 
176  protected function getEmptyBody() {
177  return $this->msg( 'history-empty' )->escaped();
178  }
179 
185  protected function getStartBody() {
186  $permissionManager = MediaWikiServices::getInstance()->getPermissionManager();
187  $this->lastRow = false;
188  $this->counter = 1;
189  $this->oldIdChecked = 0;
190  $s = '';
191  // Button container stored in $this->buttons for re-use in getEndBody()
192  $this->buttons = '';
193  if ( $this->getNumRows() > 0 ) {
194  $this->getOutput()->wrapWikiMsg( "<div class='mw-history-legend'>\n$1\n</div>", 'histlegend' );
195  $s = Html::openElement( 'form', [
196  'action' => wfScript(),
197  'id' => 'mw-history-compare'
198  ] ) . "\n";
199  $s .= Html::hidden( 'title', $this->getTitle()->getPrefixedDBkey() ) . "\n";
200  $s .= Html::hidden( 'action', 'historysubmit' ) . "\n";
201  $s .= Html::hidden( 'type', 'revision' ) . "\n";
202 
203  $this->buttons .= Html::openElement(
204  'div', [ 'class' => 'mw-history-compareselectedversions' ] );
205  $className = 'historysubmit mw-history-compareselectedversions-button mw-ui-button';
206  $attrs = [ 'class' => $className ]
207  + Linker::tooltipAndAccesskeyAttribs( 'compareselectedversions' );
208  $this->buttons .= $this->submitButton( $this->msg( 'compareselectedversions' )->text(),
209  $attrs
210  ) . "\n";
211 
212  $user = $this->getUser();
213  $actionButtons = '';
214  if ( $permissionManager->userHasRight( $user, 'deleterevision' ) ) {
215  $actionButtons .= $this->getRevisionButton(
216  'revisiondelete', 'showhideselectedversions' );
217  }
218  if ( $this->showTagEditUI ) {
219  $actionButtons .= $this->getRevisionButton(
220  'editchangetags', 'history-edit-tags' );
221  }
222  if ( $actionButtons ) {
223  $this->buttons .= Xml::tags( 'div', [ 'class' =>
224  'mw-history-revisionactions' ], $actionButtons );
225  }
226 
227  if ( $permissionManager->userHasRight( $user, 'deleterevision' ) || $this->showTagEditUI ) {
228  $this->buttons .= ( new ListToggle( $this->getOutput() ) )->getHTML();
229  }
230 
231  $this->buttons .= '</div>';
232 
233  $s .= $this->buttons;
234  $s .= '<ul id="pagehistory">' . "\n";
235  }
236 
237  return $s;
238  }
239 
240  private function getRevisionButton( $name, $msg ) {
241  $this->preventClickjacking();
242  $element = Html::element(
243  'button',
244  [
245  'type' => 'submit',
246  'name' => $name,
247  'value' => '1',
248  'class' => "historysubmit mw-history-$name-button mw-ui-button",
249  ],
250  $this->msg( $msg )->text()
251  ) . "\n";
252  return $element;
253  }
254 
255  protected function getEndBody() {
256  if ( $this->getNumRows() == 0 ) {
257  return '';
258  }
259 
260  if ( $this->lastRow ) {
261  $firstInList = $this->counter == 1;
262  if ( $this->mIsBackwards ) {
263  # Next row is unknown, but for UI reasons, probably exists if an offset has been specified
264  if ( $this->mOffset == '' ) {
265  $next = null;
266  } else {
267  $next = 'unknown';
268  }
269  } else {
270  # The next row is the past-the-end row
271  $next = $this->mPastTheEndRow;
272  }
273  $this->counter++;
274 
275  $notifTimestamp = $this->getConfig()->get( 'ShowUpdatedMarker' )
276  ? $this->getTitle()->getNotificationTimestamp( $this->getUser() )
277  : false;
278 
279  $s = $this->historyLine( $this->lastRow, $next, $notifTimestamp, false, $firstInList );
280  } else {
281  $s = '';
282  }
283  $s .= "</ul>\n";
284  # Add second buttons only if there is more than one rev
285  if ( $this->getNumRows() > 2 ) {
286  $s .= $this->buttons;
287  }
288  $s .= '</form>';
289  return $s;
290  }
291 
299  private function submitButton( $message, $attributes = [] ) {
300  # Disable submit button if history has 1 revision only
301  if ( $this->getNumRows() > 1 ) {
302  return Html::submitButton( $message, $attributes );
303  } else {
304  return '';
305  }
306  }
307 
322  private function historyLine( $row, $next, $notificationtimestamp = false,
323  $dummy = false, $firstInList = false ) {
324  $permissionManager = MediaWikiServices::getInstance()->getPermissionManager();
325 
326  $revRecord = $this->revisionStore->newRevisionFromRow(
327  $row,
328  RevisionStore::READ_NORMAL,
329  $this->getTitle()
330  );
331 
332  if ( is_object( $next ) ) {
333  $previousRevRecord = $this->revisionStore->newRevisionFromRow(
334  $next,
335  RevisionStore::READ_NORMAL,
336  $this->getTitle()
337  );
338  } else {
339  $previousRevRecord = null;
340  }
341 
342  $latest = $revRecord->getId() === $this->getWikiPage()->getLatest();
343  $curlink = $this->curLink( $revRecord );
344  $lastlink = $this->lastLink( $revRecord, $next );
345  $curLastlinks = Html::rawElement( 'span', [], $curlink ) .
346  Html::rawElement( 'span', [], $lastlink );
347  $histLinks = Html::rawElement(
348  'span',
349  [ 'class' => 'mw-history-histlinks mw-changeslist-links' ],
350  $curLastlinks
351  );
352 
353  $diffButtons = $this->diffButtons( $revRecord, $firstInList );
354  $s = $histLinks . $diffButtons;
355 
356  $link = $this->revLink( $revRecord );
357  $classes = [];
358 
359  $del = '';
360  $user = $this->getUser();
361  $canRevDelete = $permissionManager->userHasRight( $user, 'deleterevision' );
362  // Show checkboxes for each revision, to allow for revision deletion and
363  // change tags
364  $visibility = $revRecord->getVisibility();
365  if ( $canRevDelete || $this->showTagEditUI ) {
366  $this->preventClickjacking();
367  // If revision was hidden from sysops and we don't need the checkbox
368  // for anything else, disable it
369  if ( !$this->showTagEditUI
370  && !RevisionRecord::userCanBitfield(
371  $visibility,
372  RevisionRecord::DELETED_RESTRICTED,
373  $user
374  )
375  ) {
376  $del = Xml::check( 'deleterevisions', false, [ 'disabled' => 'disabled' ] );
377  // Otherwise, enable the checkbox...
378  } else {
379  $del = Xml::check( 'showhiderevisions', false,
380  [ 'name' => 'ids[' . $revRecord->getId() . ']' ] );
381  }
382  // User can only view deleted revisions...
383  } elseif ( $visibility && $permissionManager->userHasRight( $user, 'deletedhistory' ) ) {
384  // If revision was hidden from sysops, disable the link
385  if ( !RevisionRecord::userCanBitfield(
386  $visibility,
387  RevisionRecord::DELETED_RESTRICTED,
388  $user
389  ) ) {
390  $del = Linker::revDeleteLinkDisabled( false );
391  // Otherwise, show the link...
392  } else {
393  $query = [
394  'type' => 'revision',
395  'target' => $this->getTitle()->getPrefixedDBkey(),
396  'ids' => $revRecord->getId()
397  ];
398  $del .= Linker::revDeleteLink(
399  $query,
400  $revRecord->isDeleted( RevisionRecord::DELETED_RESTRICTED ),
401  false
402  );
403  }
404  }
405  if ( $del ) {
406  $s .= " $del ";
407  }
408 
409  $lang = $this->getLanguage();
410  $dirmark = $lang->getDirMark();
411 
412  $s .= " $link";
413  $s .= $dirmark;
414  $s .= " <span class='history-user'>" .
415  Linker::revUserTools( $revRecord, true, false ) . "</span>";
416  $s .= $dirmark;
417 
418  if ( $revRecord->isMinor() ) {
419  $s .= ' ' . ChangesList::flag( 'minor', $this->getContext() );
420  }
421 
422  # Sometimes rev_len isn't populated
423  if ( $revRecord->getSize() !== null ) {
424  # Size is always public data
425  $prevSize = $this->parentLens[$row->rev_parent_id] ?? 0;
426  $sDiff = ChangesList::showCharacterDifference( $prevSize, $revRecord->getSize() );
427  $fSize = Linker::formatRevisionSize( $revRecord->getSize() );
428  $s .= ' <span class="mw-changeslist-separator"></span> ' . "$fSize $sDiff";
429  }
430 
431  # Text following the character difference is added just before running hooks
432  $s2 = Linker::revComment( $revRecord, false, true, false );
433 
434  if ( $notificationtimestamp && ( $row->rev_timestamp >= $notificationtimestamp ) ) {
435  $s2 .= ' <span class="updatedmarker">' . $this->msg( 'updatedmarker' )->escaped() . '</span>';
436  $classes[] = 'mw-history-line-updated';
437  }
438 
439  $tools = [];
440 
441  # Rollback and undo links
442 
443  if ( $previousRevRecord &&
444  $permissionManager->quickUserCan( 'edit', $user, $this->getTitle() )
445  ) {
446  if ( $latest && $permissionManager->quickUserCan( 'rollback',
447  $user, $this->getTitle() )
448  ) {
449  // Get a rollback link without the brackets
450  $rollbackLink = Linker::generateRollback(
451  $revRecord,
452  $this->getContext(),
453  [ 'verify', 'noBrackets' ]
454  );
455  if ( $rollbackLink ) {
456  $this->preventClickjacking();
457  $tools[] = $rollbackLink;
458  }
459  }
460 
461  if ( !$revRecord->isDeleted( RevisionRecord::DELETED_TEXT )
462  && !$previousRevRecord->isDeleted( RevisionRecord::DELETED_TEXT )
463  ) {
464  # Create undo tooltip for the first (=latest) line only
465  $undoTooltip = $latest
466  ? [ 'title' => $this->msg( 'tooltip-undo' )->text() ]
467  : [];
468  $undolink = $this->getLinkRenderer()->makeKnownLink(
469  $this->getTitle(),
470  $this->msg( 'editundo' )->text(),
471  $undoTooltip,
472  [
473  'action' => 'edit',
474  'undoafter' => $previousRevRecord->getId(),
475  'undo' => $revRecord->getId()
476  ]
477  );
478  $tools[] = "<span class=\"mw-history-undo\">{$undolink}</span>";
479  }
480  }
481  // Allow extension to add their own links here
482  // TODO replace hook with one using RevisionRecord
483  $this->getHookRunner()->onHistoryRevisionTools(
484  new Revision( $revRecord ),
485  $tools,
486  $previousRevRecord ? new Revision( $previousRevRecord ) : null,
487  $user
488  );
489 
490  if ( $tools ) {
491  $s2 .= ' ' . Html::openElement( 'span', [ 'class' => 'mw-changeslist-links' ] );
492  foreach ( $tools as $tool ) {
493  $s2 .= Html::rawElement( 'span', [], $tool );
494  }
495  $s2 .= Html::closeElement( 'span' );
496  }
497 
498  # Tags
499  list( $tagSummary, $newClasses ) = ChangeTags::formatSummaryRow(
500  $row->ts_tags,
501  'history',
502  $this->getContext()
503  );
504  $classes = array_merge( $classes, $newClasses );
505  if ( $tagSummary !== '' ) {
506  $s2 .= " $tagSummary";
507  }
508 
509  # Include separator between character difference and following text
510  if ( $s2 !== '' ) {
511  $s .= ' <span class="mw-changeslist-separator"></span> ' . $s2;
512  }
513 
514  $attribs = [ 'data-mw-revid' => $revRecord->getId() ];
515 
516  $this->getHookRunner()->onPageHistoryLineEnding( $this, $row, $s, $classes, $attribs );
517  $attribs = array_filter( $attribs,
518  [ Sanitizer::class, 'isReservedDataAttribute' ],
519  ARRAY_FILTER_USE_KEY
520  );
521 
522  if ( $classes ) {
523  $attribs['class'] = implode( ' ', $classes );
524  }
525 
526  return Xml::tags( 'li', $attribs, $s ) . "\n";
527  }
528 
535  private function revLink( RevisionRecord $rev ) {
536  return ChangesList::revDateLink( $rev, $this->getUser(), $this->getLanguage(),
537  $this->getTitle() );
538  }
539 
546  private function curLink( RevisionRecord $rev ) {
547  $cur = $this->historyPage->message['cur'];
548  $latest = $this->getWikiPage()->getLatest();
549  if ( $latest === $rev->getId()
550  || !RevisionRecord::userCanBitfield(
551  $rev->getVisibility(),
552  RevisionRecord::DELETED_TEXT,
553  $this->getUser()
554  )
555  ) {
556  return $cur;
557  } else {
558  return $this->getLinkRenderer()->makeKnownLink(
559  $this->getTitle(),
560  new HtmlArmor( $cur ),
561  [],
562  [
563  'diff' => $latest,
564  'oldid' => $rev->getId()
565  ]
566  );
567  }
568  }
569 
579  private function lastLink( RevisionRecord $prevRev, $next ) {
580  $last = $this->historyPage->message['last'];
581 
582  if ( $next === null ) {
583  # Probably no next row
584  return $last;
585  }
586 
587  $linkRenderer = $this->getLinkRenderer();
588  if ( $next === 'unknown' ) {
589  # Next row probably exists but is unknown, use an oldid=prev link
590  return $linkRenderer->makeKnownLink(
591  $this->getTitle(),
592  new HtmlArmor( $last ),
593  [],
594  [
595  'diff' => $prevRev->getId(),
596  'oldid' => 'prev'
597  ]
598  );
599  }
600 
601  $nextRev = $this->revisionStore->newRevisionFromRow(
602  $next,
603  RevisionStore::READ_NORMAL,
604  $this->getTitle()
605  );
606 
607  if ( !RevisionRecord::userCanBitfield(
608  $prevRev->getVisibility(),
609  RevisionRecord::DELETED_TEXT,
610  $this->getUser()
611  ) || !RevisionRecord::userCanBitfield(
612  $nextRev->getVisibility(),
613  RevisionRecord::DELETED_TEXT,
614  $this->getUser()
615  )
616  ) {
617  return $last;
618  }
619 
620  return $linkRenderer->makeKnownLink(
621  $this->getTitle(),
622  new HtmlArmor( $last ),
623  [],
624  [
625  'diff' => $prevRev->getId(),
626  'oldid' => $next->rev_id
627  ]
628  );
629  }
630 
639  private function diffButtons( RevisionRecord $rev, $firstInList ) {
640  if ( $this->getNumRows() > 1 ) {
641  $id = $rev->getId();
642  $radio = [ 'type' => 'radio', 'value' => $id ];
644  if ( $firstInList ) {
645  $first = Xml::element( 'input',
646  array_merge( $radio, [
647  'style' => 'visibility:hidden',
648  'name' => 'oldid',
649  'id' => 'mw-oldid-null' ] )
650  );
651  $checkmark = [ 'checked' => 'checked' ];
652  } else {
653  # Check visibility of old revisions
654  if ( !RevisionRecord::userCanBitfield(
655  $rev->getVisibility(),
656  RevisionRecord::DELETED_TEXT,
657  $this->getUser()
658  ) ) {
659  $radio['disabled'] = 'disabled';
660  $checkmark = []; // We will check the next possible one
661  } elseif ( !$this->oldIdChecked ) {
662  $checkmark = [ 'checked' => 'checked' ];
663  $this->oldIdChecked = $id;
664  } else {
665  $checkmark = [];
666  }
667  $first = Xml::element( 'input',
668  array_merge( $radio, $checkmark, [
669  'name' => 'oldid',
670  'id' => "mw-oldid-$id" ] ) );
671  $checkmark = [];
672  }
673  $second = Xml::element( 'input',
674  array_merge( $radio, $checkmark, [
675  'name' => 'diff',
676  'id' => "mw-diff-$id" ] ) );
677 
678  return $first . $second;
679  } else {
680  return '';
681  }
682  }
683 
687  public function getDefaultQuery() {
688  parent::getDefaultQuery();
689  unset( $this->mDefaultQuery['date-range-to'] );
690  return $this->mDefaultQuery;
691  }
692 
697  private function preventClickjacking( $enable = true ) {
698  $this->preventClickjacking = $enable;
699  }
700 
705  public function getPreventClickjacking() {
707  }
708 
709 }
ContextSource\getConfig
getConfig()
Definition: ContextSource.php:63
ReverseChronologicalPager\getDateCond
getDateCond( $year, $month, $day=-1)
Set and return the mOffset timestamp such that we can get all revisions with a timestamp up to the sp...
Definition: ReverseChronologicalPager.php:77
ContextSource\getContext
getContext()
Get the base IContextSource object.
Definition: ContextSource.php:40
HtmlArmor
Marks HTML that shouldn't be escaped.
Definition: HtmlArmor.php:28
Revision\RevisionRecord
Page revision base class.
Definition: RevisionRecord.php:46
HistoryPager\$counter
$counter
Definition: HistoryPager.php:38
HistoryPager\$parentLens
array $parentLens
Definition: HistoryPager.php:46
HistoryPager\historyLine
historyLine( $row, $next, $notificationtimestamp=false, $dummy=false, $firstInList=false)
Returns a row from the history printout.
Definition: HistoryPager.php:322
LinkBatch
Class representing a list of titles The execute() method checks them all for existence and adds them ...
Definition: LinkBatch.php:35
HistoryPager\getPreventClickjacking
getPreventClickjacking()
Get the "prevent clickjacking" flag.
Definition: HistoryPager.php:705
MediaWiki\MediaWikiServices
MediaWikiServices is the service locator for the application scope of MediaWiki.
Definition: MediaWikiServices.php:146
$lang
if(!isset( $args[0])) $lang
Definition: testCompression.php:37
HistoryPager\getArticle
getArticle()
Definition: HistoryPager.php:83
Revision\RevisionStore
Service for looking up page revisions.
Definition: RevisionStore.php:79
HistoryPager\$showTagEditUI
bool $showTagEditUI
Whether to show the tag editing UI.
Definition: HistoryPager.php:49
Linker\revComment
static revComment( $rev, $local=false, $isPublic=false, $useParentheses=true)
Wrap and format the given revision's comment block, if the current user is allowed to view it.
Definition: Linker.php:1606
HistoryPager\getEmptyBody
getEmptyBody()
Returns message when query returns no revisions.
Definition: HistoryPager.php:176
HistoryPager\$tagFilter
string $tagFilter
Definition: HistoryPager.php:52
HistoryPager\getDefaultQuery
getDefaultQuery()
@inheritDoc
Definition: HistoryPager.php:687
HistoryPager\getRevisionButton
getRevisionButton( $name, $msg)
Definition: HistoryPager.php:240
$s
$s
Definition: mergeMessageFileList.php:185
IndexPager\$linkRenderer
LinkRenderer $linkRenderer
Definition: IndexPager.php:166
ChangeTags\showTagEditingUI
static showTagEditingUI(User $user)
Indicate whether change tag editing UI is relevant.
Definition: ChangeTags.php:1590
HistoryPager\$conds
$conds
Definition: HistoryPager.php:38
ContextSource\getUser
getUser()
Definition: ContextSource.php:120
ContextSource\getTitle
getTitle()
Definition: ContextSource.php:79
HistoryPager\__construct
__construct(HistoryAction $historyPage, $year='', $month='', $tagFilter='', array $conds=[], $day='')
Definition: HistoryPager.php:65
$revQuery
$revQuery
Definition: testCompression.php:56
Linker\tooltipAndAccesskeyAttribs
static tooltipAndAccesskeyAttribs( $name, array $msgParams=[], $options=null)
Returns the attributes for the tooltip and access key.
Definition: Linker.php:2295
IndexPager\$mPastTheEndRow
stdClass bool null $mPastTheEndRow
Extra row fetched at the end to see if the end was reached.
Definition: IndexPager.php:101
HistoryPager\submitButton
submitButton( $message, $attributes=[])
Creates a submit button.
Definition: HistoryPager.php:299
ContextSource\getLanguage
getLanguage()
Definition: ContextSource.php:128
HistoryPager\$historyPage
$historyPage
Definition: HistoryPager.php:38
Revision
Definition: Revision.php:39
HistoryPager\$lastRow
bool stdClass $lastRow
Definition: HistoryPager.php:36
Html\closeElement
static closeElement( $element)
Returns "</$element>".
Definition: Html.php:315
ChangeTags\modifyDisplayQuery
static modifyDisplayQuery(&$tables, &$fields, &$conds, &$join_conds, &$options, $filter_tag='')
Applies all tags-related changes to a query.
Definition: ChangeTags.php:784
HistoryPager\preventClickjacking
preventClickjacking( $enable=true)
This is called if a write operation is possible from the generated HTML.
Definition: HistoryPager.php:697
Linker\generateRollback
static generateRollback( $rev, IContextSource $context=null, $options=[ 'verify'])
Generate a rollback link for a given revision.
Definition: Linker.php:1862
HistoryPager\doBatchLookups
doBatchLookups()
Called from getBody(), before getStartBody() is called and after doQuery() was called.
Definition: HistoryPager.php:146
wfScript
wfScript( $script='index')
Get the path to a specified script file, respecting file extensions; this is a wrapper around $wgScri...
Definition: GlobalFunctions.php:2530
HistoryPager\$buttons
$buttons
Definition: HistoryPager.php:38
HistoryAction
This class handles printing the history page for an article.
Definition: HistoryAction.php:38
ListToggle
Class for generating clickable toggle links for a list of checkboxes.
Definition: ListToggle.php:31
ContextSource\getOutput
getOutput()
Definition: ContextSource.php:112
HistoryPager\getSqlComment
getSqlComment()
Get some text to go in brackets in the "function name" part of the SQL comment.
Definition: HistoryPager.php:87
Xml\check
static check( $name, $checked=false, $attribs=[])
Convenience function to build an HTML checkbox.
Definition: Xml.php:327
ContextSource\getWikiPage
getWikiPage()
Get the WikiPage object.
Definition: ContextSource.php:104
HistoryPager\$oldIdChecked
$oldIdChecked
Definition: HistoryPager.php:40
Xml\element
static element( $element, $attribs=null, $contents='', $allowShortTag=true)
Format an XML element with given attributes and, optionally, text content.
Definition: Xml.php:41
HistoryPager\getIndexField
getIndexField()
Returns the name of the index field.
Definition: HistoryPager.php:120
ChangesList\flag
static flag( $flag, IContextSource $context=null)
Make an "<abbr>" element for a given change flag.
Definition: ChangesList.php:268
Linker\revDeleteLinkDisabled
static revDeleteLinkDisabled( $delete=true)
Creates a dead (show/hide) link for deleting revisions/log entries.
Definition: Linker.php:2276
HistoryPager
Definition: HistoryPager.php:32
Linker\revUserTools
static revUserTools( $rev, $isPublic=false, $useParentheses=true)
Generate a user tool link cluster if the current user is allowed to view it.
Definition: Linker.php:1142
HistoryPager\formatRow
formatRow( $row)
Definition: HistoryPager.php:128
Revision\RevisionRecord\getId
getId()
Get revision ID.
Definition: RevisionRecord.php:279
HistoryPager\revLink
revLink(RevisionRecord $rev)
Create a link to view this revision of the page.
Definition: HistoryPager.php:535
ContextSource\msg
msg( $key,... $params)
Get a Message object with context set Parameters are the same as wfMessage()
Definition: ContextSource.php:168
Html\hidden
static hidden( $name, $value, array $attribs=[])
Convenience function to produce an input element with type=hidden.
Definition: Html.php:802
NS_USER_TALK
const NS_USER_TALK
Definition: Defines.php:72
HistoryPager\getEndBody
getEndBody()
Hook into getBody() for the end of the list.
Definition: HistoryPager.php:255
HistoryPager\$preventClickjacking
$preventClickjacking
Definition: HistoryPager.php:42
Xml\tags
static tags( $element, $attribs, $contents)
Same as Xml::element(), but does not escape contents.
Definition: Xml.php:130
HistoryPager\$revisionStore
RevisionStore $revisionStore
Definition: HistoryPager.php:55
Linker\formatRevisionSize
static formatRevisionSize( $size)
Definition: Linker.php:1651
ChangesList\showCharacterDifference
static showCharacterDifference( $old, $new, IContextSource $context=null)
Show formatted char difference.
Definition: ChangesList.php:332
HistoryPager\getQueryInfo
getQueryInfo()
Provides all parameters needed for the main paged query.
Definition: HistoryPager.php:95
IndexPager\getLinkRenderer
getLinkRenderer()
Definition: IndexPager.php:932
Html\submitButton
static submitButton( $contents, array $attrs, array $modifiers=[])
Returns an HTML link element in a string styled as a button (when $wgUseMediaWikiUIEverywhere is enab...
Definition: Html.php:185
Revision\RevisionRecord\getVisibility
getVisibility()
Get the deletion bitfield of the revision.
Definition: RevisionRecord.php:431
HistoryPager\curLink
curLink(RevisionRecord $rev)
Create a diff-to-current link for this revision for this page.
Definition: HistoryPager.php:546
Html\openElement
static openElement( $element, $attribs=[])
Identical to rawElement(), but has no third parameter and omits the end tag (and the self-closing '/'...
Definition: Html.php:251
Html\rawElement
static rawElement( $element, $attribs=[], $contents='')
Returns an HTML element in a string.
Definition: Html.php:209
Linker\revDeleteLink
static revDeleteLink( $query=[], $restricted=false, $delete=true)
Creates a (show/hide) link for deleting revisions/log entries.
Definition: Linker.php:2254
NS_USER
const NS_USER
Definition: Defines.php:71
ReverseChronologicalPager
Efficient paging for SQL queries.
Definition: ReverseChronologicalPager.php:28
HistoryPager\diffButtons
diffButtons(RevisionRecord $rev, $firstInList)
Create radio buttons for page history.
Definition: HistoryPager.php:639
Html\element
static element( $element, $attribs=[], $contents='')
Identical to rawElement(), but HTML-escapes $contents (like Xml::element()).
Definition: Html.php:231
ChangesList\revDateLink
static revDateLink(RevisionRecord $rev, User $user, Language $lang, $title=null)
Render the date and time of a revision in the current user language based on whether the user is able...
Definition: ChangesList.php:424
HistoryPager\getStartBody
getStartBody()
Creates begin of history list with a submit button.
Definition: HistoryPager.php:185
HistoryPager\lastLink
lastLink(RevisionRecord $prevRev, $next)
Create a diff-to-previous link for this revision for this page.
Definition: HistoryPager.php:579
ChangeTags\formatSummaryRow
static formatSummaryRow( $tags, $page, IContextSource $context=null)
Creates HTML for the given tags.
Definition: ChangeTags.php:100
IndexPager\$mDefaultQuery
array $mDefaultQuery
Definition: IndexPager.php:148
IndexPager\getNumRows
getNumRows()
Get the number of rows in the result set.
Definition: IndexPager.php:698