15 private $preventClickjacking =
false;
36 bool $showRollbackLink,
44 # Rollback and undo links
45 $userCanEditTitle = $authority->probablyCan(
'edit',
$title );
46 if ( $showRollbackLink && $userCanEditTitle ) {
47 if ( $authority->probablyCan(
'rollback',
$title ) ) {
49 $rollbackLink = Linker::generateRollback(
54 if ( $rollbackLink ) {
55 $this->preventClickjacking =
true;
56 $tools[
'mw-rollback'] = $rollbackLink;
60 if ( $userCanEditTitle && $previousRevRecord ) {
61 if ( !$revRecord->
isDeleted( RevisionRecord::DELETED_TEXT )
62 && !$previousRevRecord->
isDeleted( RevisionRecord::DELETED_TEXT )
64 # Create undo tooltip for the first (=latest) line only
65 $undoTooltip = $showRollbackLink
66 ? [
'title' => $context->
msg(
'tooltip-undo' )->text() ]
70 $context->
msg(
'editundo' )->text(),
74 'undoafter' => $previousRevRecord->
getId(),
75 'undo' => $revRecord->
getId()
78 $tools[
'mw-undo'] =
"<span class=\"mw-history-undo\">{$undolink}</span>";
90 $this->tools = $tools;
94 return $this->preventClickjacking;
98 $tools = $this->tools;
101 $s2 .=
' ' . Html::openElement(
'span', [
'class' =>
'mw-changeslist-links mw-pager-tools' ] );
102 foreach ( $tools as $tool ) {
103 $s2 .= Html::rawElement(
'span', [], $tool );
105 $s2 .= Html::closeElement(
'span' );
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.