18 private $preventClickjacking =
false;
39 bool $showRollbackLink,
47 # Rollback and undo links
48 $userCanEditTitle = $authority->probablyCan(
'edit', $title );
49 if ( $showRollbackLink && $userCanEditTitle ) {
50 if ( $authority->probablyCan(
'rollback', $title ) ) {
52 $rollbackLink = Linker::generateRollback(
57 if ( $rollbackLink ) {
58 $this->preventClickjacking =
true;
59 $tools[
'mw-rollback'] = $rollbackLink;
63 if ( $userCanEditTitle && $previousRevRecord ) {
64 if ( !$revRecord->
isDeleted( RevisionRecord::DELETED_TEXT )
65 && !$previousRevRecord->
isDeleted( RevisionRecord::DELETED_TEXT )
67 # Create undo tooltip for the first (=latest) line only
68 $undoTooltip = $showRollbackLink
69 ? [
'title' => $context->
msg(
'tooltip-undo' )->text() ]
73 $context->
msg(
'editundo' )->text(),
77 'undoafter' => $previousRevRecord->
getId(),
78 'undo' => $revRecord->
getId()
81 $tools[
'mw-undo'] =
"<span class=\"mw-history-undo\">{$undolink}</span>";
93 $this->tools = $tools;
97 return $this->preventClickjacking;
101 $tools = $this->tools;
104 $s2 .=
' ' . Html::openElement(
'span', [
'class' =>
'mw-changeslist-links mw-pager-tools' ] );
105 foreach ( $tools as $tool ) {
106 $s2 .= Html::rawElement(
'span', [], $tool );
108 $s2 .= Html::closeElement(
'span' );
118class_alias( PagerTools::class,
'PagerTools' );
Interface for objects which can provide a MediaWiki context on request.
Interface for objects (potentially) representing an editable wiki page.
msg( $key,... $params)
This is the method for getting translated interface messages.