5 * Split off from Article.php and Skin.php, 2003-12-22
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 * http://www.gnu.org/copyleft/gpl.html
27 * This class handles printing the history page for an article. In order to
28 * be efficient, it uses timestamps rather than offsets for paging, to avoid
29 * costly LIMIT,offset queries.
31 * Construct it by passing in an Article, and call $h->history() to print the
36 class HistoryAction
extends FormlessAction
{
40 /** @var array Array of message keys and strings */
43 public function getName() {
47 public function requiresWrite() {
51 public function requiresUnblock() {
55 protected function getPageTitle() {
56 return $this->msg( 'history-title', $this->getTitle()->getPrefixedText() )->text();
59 protected function getDescription() {
60 // Creation of a subtitle link pointing to [[Special:Log]]
61 return Linker
::linkKnown(
62 SpecialPage
::getTitleFor( 'Log' ),
63 $this->msg( 'viewpagelogs' )->escaped(),
65 array( 'page' => $this->getTitle()->getPrefixedText() )
70 * Get the Article object we are working on.
73 public function getArticle() {
78 * As we use the same small set of messages in various methods and that
79 * they are called often, we call them once and save them in $this->message
81 private function preCacheMessages() {
82 // Precache various messages
83 if ( !isset( $this->message
) ) {
84 $msgs = array( 'cur', 'last', 'pipe-separator' );
85 foreach ( $msgs as $msg ) {
86 $this->message
[$msg] = $this->msg( $msg )->escaped();
92 * Print the history page for an article.
95 $out = $this->getOutput();
96 $request = $this->getRequest();
99 * Allow client caching.
101 if ( $out->checkLastModified( $this->page
->getTouched() ) ) {
102 return; // Client cache fresh and headers sent, nothing more to do.
105 wfProfileIn( __METHOD__
);
107 $this->preCacheMessages();
108 $config = $this->context
->getConfig();
110 # Fill in the file cache if not set already
111 $useFileCache = $config->get( 'UseFileCache' );
112 if ( $useFileCache && HTMLFileCache
::useFileCache( $this->getContext() ) ) {
113 $cache = new HTMLFileCache( $this->getTitle(), 'history' );
114 if ( !$cache->isCacheGood( /* Assume up to date */ ) ) {
115 ob_start( array( &$cache, 'saveToFileCache' ) );
119 // Setup page variables.
120 $out->setFeedAppendQuery( 'action=history' );
121 $out->addModules( 'mediawiki.action.history' );
122 if ( $config->get( 'UseMediaWikiUIEverywhere' ) ) {
123 $out = $this->getOutput();
124 $out->addModuleStyles( array(
125 'mediawiki.ui.input',
126 'mediawiki.ui.checkbox',
130 // Handle atom/RSS feeds.
131 $feedType = $request->getVal( 'feed' );
133 $this->feed( $feedType );
134 wfProfileOut( __METHOD__
);
139 // Fail nicely if article doesn't exist.
140 if ( !$this->page
->exists() ) {
141 $out->addWikiMsg( 'nohistory' );
142 # show deletion/move log if there is an entry
143 LogEventsList
::showLogExtract(
145 array( 'delete', 'move' ),
149 'conds' => array( "log_action != 'revision'" ),
150 'showIfEmpty' => false,
151 'msgKey' => array( 'moveddeleted-notice' )
154 wfProfileOut( __METHOD__
);
160 * Add date selector to quickly get to a certain time
162 $year = $request->getInt( 'year' );
163 $month = $request->getInt( 'month' );
164 $tagFilter = $request->getVal( 'tagfilter' );
165 $tagSelector = ChangeTags
::buildTagFilterSelector( $tagFilter );
168 * Option to show only revisions that have been (partially) hidden via RevisionDelete
170 if ( $request->getBool( 'deleted' ) ) {
171 $conds = array( 'rev_deleted != 0' );
175 if ( $this->getUser()->isAllowed( 'deletedhistory' ) ) {
176 $checkDeleted = Xml
::checkLabel( $this->msg( 'history-show-deleted' )->text(),
177 'deleted', 'mw-show-deleted-only', $request->getBool( 'deleted' ) ) . "\n";
182 // Add the general form
183 $action = htmlspecialchars( wfScript() );
184 $className = 'historysubmit mw-history-compareselectedversions-button';
186 "<form action=\"$action\" method=\"get\" id=\"mw-history-searchform\">" .
188 $this->msg( 'history-fieldset-title' )->text(),
190 array( 'id' => 'mw-history-search' )
192 Html
::hidden( 'title', $this->getTitle()->getPrefixedDBkey() ) . "\n" .
193 Html
::hidden( 'action', 'history' ) . "\n" .
195 ( $year == null ? MWTimestamp
::getLocalInstance()->format( 'Y' ) : $year ),
198 ( $tagSelector ?
( implode( ' ', $tagSelector ) . ' ' ) : '' ) .
201 $this->msg( 'allpagessubmit' )->text(),
203 array( 'mw-ui-progressive' )
208 wfRunHooks( 'PageHistoryBeforeList', array( &$this->page
, $this->getContext() ) );
210 // Create and output the list.
211 $pager = new HistoryPager( $this, $year, $month, $tagFilter, $conds );
213 $pager->getNavigationBar() .
215 $pager->getNavigationBar()
217 $out->preventClickjacking( $pager->getPreventClickjacking() );
219 wfProfileOut( __METHOD__
);
223 * Fetch an array of revisions, specified by a given limit, offset and
224 * direction. This is now only used by the feeds. It was previously
225 * used by the main UI but that's now handled by the pager.
227 * @param int $limit The limit number of revisions to get
229 * @param int $direction Either self::DIR_PREV or self::DIR_NEXT
230 * @return ResultWrapper
232 function fetchRevisions( $limit, $offset, $direction ) {
233 // Fail if article doesn't exist.
234 if ( !$this->getTitle()->exists() ) {
235 return new FakeResultWrapper( array() );
238 $dbr = wfGetDB( DB_SLAVE
);
240 if ( $direction === self
::DIR_PREV
) {
241 list( $dirs, $oper ) = array( "ASC", ">=" );
242 } else { /* $direction === self::DIR_NEXT */
243 list( $dirs, $oper ) = array( "DESC", "<=" );
247 $offsets = array( "rev_timestamp $oper " . $dbr->addQuotes( $dbr->timestamp( $offset ) ) );
252 $page_id = $this->page
->getId();
254 return $dbr->select( 'revision',
255 Revision
::selectFields(),
256 array_merge( array( 'rev_page' => $page_id ), $offsets ),
258 array( 'ORDER BY' => "rev_timestamp $dirs",
259 'USE INDEX' => 'page_timestamp', 'LIMIT' => $limit )
264 * Output a subscription feed listing recent edits to this page.
266 * @param string $type Feed type
268 function feed( $type ) {
269 if ( !FeedUtils
::checkFeedOutput( $type ) ) {
272 $request = $this->getRequest();
274 $feedClasses = $this->context
->getConfig()->get( 'FeedClasses' );
275 /** @var RSSFeed|AtomFeed $feed */
276 $feed = new $feedClasses[$type](
277 $this->getTitle()->getPrefixedText() . ' - ' .
278 $this->msg( 'history-feed-title' )->inContentLanguage()->text(),
279 $this->msg( 'history-feed-description' )->inContentLanguage()->text(),
280 $this->getTitle()->getFullURL( 'action=history' )
283 // Get a limit on number of feed entries. Provide a sane default
284 // of 10 if none is defined (but limit to $wgFeedLimit max)
285 $limit = $request->getInt( 'limit', 10 );
288 $this->context
->getConfig()->get( 'FeedLimit' )
291 $items = $this->fetchRevisions( $limit, 0, self
::DIR_NEXT
);
293 // Generate feed elements enclosed between header and footer.
295 if ( $items->numRows() ) {
296 foreach ( $items as $row ) {
297 $feed->outItem( $this->feedItem( $row ) );
300 $feed->outItem( $this->feedEmpty() );
305 function feedEmpty() {
307 $this->msg( 'nohistory' )->inContentLanguage()->text(),
308 $this->msg( 'history-feed-empty' )->inContentLanguage()->parseAsBlock(),
309 $this->getTitle()->getFullURL(),
310 wfTimestamp( TS_MW
),
312 $this->getTitle()->getTalkPage()->getFullURL()
317 * Generate a FeedItem object from a given revision table row
318 * Borrows Recent Changes' feed generation functions for formatting;
319 * includes a diff to the previous revision (if any).
321 * @param stdClass|array $row Database row
324 function feedItem( $row ) {
325 $rev = new Revision( $row );
326 $rev->setTitle( $this->getTitle() );
327 $text = FeedUtils
::formatDiffRow(
329 $this->getTitle()->getPreviousRevisionID( $rev->getId() ),
331 $rev->getTimestamp(),
334 if ( $rev->getComment() == '' ) {
336 $title = $this->msg( 'history-feed-item-nocomment',
338 $wgContLang->timeanddate( $rev->getTimestamp() ),
339 $wgContLang->date( $rev->getTimestamp() ),
340 $wgContLang->time( $rev->getTimestamp() ) )->inContentLanguage()->text();
342 $title = $rev->getUserText() .
343 $this->msg( 'colon-separator' )->inContentLanguage()->text() .
344 FeedItem
::stripComment( $rev->getComment() );
350 $this->getTitle()->getFullURL( 'diff=' . $rev->getId() . '&oldid=prev' ),
351 $rev->getTimestamp(),
353 $this->getTitle()->getTalkPage()->getFullURL()
362 class HistoryPager
extends ReverseChronologicalPager
{
366 public $lastRow = false;
368 public $counter, $historyPage, $buttons, $conds;
370 protected $oldIdChecked;
372 protected $preventClickjacking = false;
376 protected $parentLens;
379 * @param HistoryAction $historyPage
380 * @param string $year
381 * @param string $month
382 * @param string $tagFilter
383 * @param array $conds
385 function __construct( $historyPage, $year = '', $month = '', $tagFilter = '', $conds = array() ) {
386 parent
::__construct( $historyPage->getContext() );
387 $this->historyPage
= $historyPage;
388 $this->tagFilter
= $tagFilter;
389 $this->getDateCond( $year, $month );
390 $this->conds
= $conds;
393 // For hook compatibility...
394 function getArticle() {
395 return $this->historyPage
->getArticle();
398 function getSqlComment() {
399 if ( $this->conds
) {
400 return 'history page filtered'; // potentially slow, see CR r58153
402 return 'history page unfiltered';
406 function getQueryInfo() {
408 'tables' => array( 'revision', 'user' ),
409 'fields' => array_merge( Revision
::selectFields(), Revision
::selectUserFields() ),
410 'conds' => array_merge(
411 array( 'rev_page' => $this->getWikiPage()->getId() ),
413 'options' => array( 'USE INDEX' => array( 'revision' => 'page_timestamp' ) ),
414 'join_conds' => array( 'user' => Revision
::userJoinCond() ),
416 ChangeTags
::modifyDisplayQuery(
417 $queryInfo['tables'],
418 $queryInfo['fields'],
420 $queryInfo['join_conds'],
421 $queryInfo['options'],
424 wfRunHooks( 'PageHistoryPager::getQueryInfo', array( &$this, &$queryInfo ) );
429 function getIndexField() {
430 return 'rev_timestamp';
434 * @param stdClass $row
437 function formatRow( $row ) {
438 if ( $this->lastRow
) {
439 $latest = ( $this->counter
== 1 && $this->mIsFirst
);
440 $firstInList = $this->counter
== 1;
442 $s = $this->historyLine( $this->lastRow
, $row,
443 $this->getTitle()->getNotificationTimestamp( $this->getUser() ), $latest, $firstInList );
447 $this->lastRow
= $row;
452 function doBatchLookups() {
453 # Do a link batch query
454 $this->mResult
->seek( 0 );
455 $batch = new LinkBatch();
457 foreach ( $this->mResult
as $row ) {
458 if ( $row->rev_parent_id
) {
459 $revIds[] = $row->rev_parent_id
;
461 if ( !is_null( $row->user_name
) ) {
462 $batch->add( NS_USER
, $row->user_name
);
463 $batch->add( NS_USER_TALK
, $row->user_name
);
464 } else { # for anons or usernames of imported revisions
465 $batch->add( NS_USER
, $row->rev_user_text
);
466 $batch->add( NS_USER_TALK
, $row->rev_user_text
);
469 $this->parentLens
= Revision
::getParentLengths( $this->mDb
, $revIds );
471 $this->mResult
->seek( 0 );
475 * Creates begin of history list with a submit button
477 * @return string HTML output
479 function getStartBody() {
480 $this->lastRow
= false;
482 $this->oldIdChecked
= 0;
484 $this->getOutput()->wrapWikiMsg( "<div class='mw-history-legend'>\n$1\n</div>", 'histlegend' );
485 $s = Html
::openElement( 'form', array( 'action' => wfScript(),
486 'id' => 'mw-history-compare' ) ) . "\n";
487 $s .= Html
::hidden( 'title', $this->getTitle()->getPrefixedDBkey() ) . "\n";
488 $s .= Html
::hidden( 'action', 'historysubmit' ) . "\n";
490 // Button container stored in $this->buttons for re-use in getEndBody()
491 $this->buttons
= '<div>';
492 $className = 'historysubmit mw-history-compareselectedversions-button';
493 $attrs = array( 'class' => $className )
494 + Linker
::tooltipAndAccesskeyAttribs( 'compareselectedversions' );
495 $this->buttons
.= $this->submitButton( $this->msg( 'compareselectedversions' )->text(),
499 if ( $this->getUser()->isAllowed( 'deleterevision' ) ) {
500 $this->buttons
.= $this->getRevisionButton( 'revisiondelete', 'showhideselectedversions' );
502 $this->buttons
.= '</div>';
504 $s .= $this->buttons
;
505 $s .= '<ul id="pagehistory">' . "\n";
510 private function getRevisionButton( $name, $msg ) {
511 $this->preventClickjacking();
512 # Note bug #20966, <button> is non-standard in IE<8
513 $element = Html
::element(
519 'class' => "historysubmit mw-history-$name-button",
521 $this->msg( $msg )->text()
526 function getEndBody() {
527 if ( $this->lastRow
) {
528 $latest = $this->counter
== 1 && $this->mIsFirst
;
529 $firstInList = $this->counter
== 1;
530 if ( $this->mIsBackwards
) {
531 # Next row is unknown, but for UI reasons, probably exists if an offset has been specified
532 if ( $this->mOffset
== '' ) {
538 # The next row is the past-the-end row
539 $next = $this->mPastTheEndRow
;
542 $s = $this->historyLine( $this->lastRow
, $next,
543 $this->getTitle()->getNotificationTimestamp( $this->getUser() ), $latest, $firstInList );
548 # Add second buttons only if there is more than one rev
549 if ( $this->getNumRows() > 2 ) {
550 $s .= $this->buttons
;
558 * Creates a submit button
560 * @param string $message Text of the submit button, will be escaped
561 * @param array $attributes Attributes
562 * @return string HTML output for the submit button
564 function submitButton( $message, $attributes = array() ) {
565 # Disable submit button if history has 1 revision only
566 if ( $this->getNumRows() > 1 ) {
567 return Html
::submitButton( $message, $attributes );
574 * Returns a row from the history printout.
576 * @todo document some more, and maybe clean up the code (some params redundant?)
578 * @param stdClass $row The database row corresponding to the previous line.
579 * @param mixed $next The database row corresponding to the next line
580 * (chronologically previous)
581 * @param bool|string $notificationtimestamp
582 * @param bool $latest Whether this row corresponds to the page's latest revision.
583 * @param bool $firstInList Whether this row corresponds to the first
584 * displayed on this history page.
585 * @return string HTML output for the row
587 function historyLine( $row, $next, $notificationtimestamp = false,
588 $latest = false, $firstInList = false ) {
589 $rev = new Revision( $row );
590 $rev->setTitle( $this->getTitle() );
592 if ( is_object( $next ) ) {
593 $prevRev = new Revision( $next );
594 $prevRev->setTitle( $this->getTitle() );
599 $curlink = $this->curLink( $rev, $latest );
600 $lastlink = $this->lastLink( $rev, $next );
601 $curLastlinks = $curlink . $this->historyPage
->message
['pipe-separator'] . $lastlink;
602 $histLinks = Html
::rawElement(
604 array( 'class' => 'mw-history-histlinks' ),
605 $this->msg( 'parentheses' )->rawParams( $curLastlinks )->escaped()
608 $diffButtons = $this->diffButtons( $rev, $firstInList );
609 $s = $histLinks . $diffButtons;
611 $link = $this->revLink( $rev );
615 $user = $this->getUser();
616 // Show checkboxes for each revision
617 if ( $user->isAllowed( 'deleterevision' ) ) {
618 $this->preventClickjacking();
619 // If revision was hidden from sysops, disable the checkbox
620 if ( !$rev->userCan( Revision
::DELETED_RESTRICTED
, $user ) ) {
621 $del = Xml
::check( 'deleterevisions', false, array( 'disabled' => 'disabled' ) );
622 // Otherwise, enable the checkbox...
624 $del = Xml
::check( 'showhiderevisions', false,
625 array( 'name' => 'ids[' . $rev->getId() . ']' ) );
627 // User can only view deleted revisions...
628 } elseif ( $rev->getVisibility() && $user->isAllowed( 'deletedhistory' ) ) {
629 // If revision was hidden from sysops, disable the link
630 if ( !$rev->userCan( Revision
::DELETED_RESTRICTED
, $user ) ) {
631 $del = Linker
::revDeleteLinkDisabled( false );
632 // Otherwise, show the link...
634 $query = array( 'type' => 'revision',
635 'target' => $this->getTitle()->getPrefixedDBkey(), 'ids' => $rev->getId() );
636 $del .= Linker
::revDeleteLink( $query,
637 $rev->isDeleted( Revision
::DELETED_RESTRICTED
), false );
644 $lang = $this->getLanguage();
645 $dirmark = $lang->getDirMark();
649 $s .= " <span class='history-user'>" .
650 Linker
::revUserTools( $rev, true ) . "</span>";
653 if ( $rev->isMinor() ) {
654 $s .= ' ' . ChangesList
::flag( 'minor' );
657 # Sometimes rev_len isn't populated
658 if ( $rev->getSize() !== null ) {
659 # Size is always public data
660 $prevSize = isset( $this->parentLens
[$row->rev_parent_id
] )
661 ?
$this->parentLens
[$row->rev_parent_id
]
663 $sDiff = ChangesList
::showCharacterDifference( $prevSize, $rev->getSize() );
664 $fSize = Linker
::formatRevisionSize( $rev->getSize() );
665 $s .= ' <span class="mw-changeslist-separator">. .</span> ' . "$fSize $sDiff";
668 # Text following the character difference is added just before running hooks
669 $s2 = Linker
::revComment( $rev, false, true );
671 if ( $notificationtimestamp && ( $row->rev_timestamp
>= $notificationtimestamp ) ) {
672 $s2 .= ' <span class="updatedmarker">' . $this->msg( 'updatedmarker' )->escaped() . '</span>';
673 $classes[] = 'mw-history-line-updated';
678 # Rollback and undo links
679 if ( $prevRev && $this->getTitle()->quickUserCan( 'edit', $user ) ) {
680 if ( $latest && $this->getTitle()->quickUserCan( 'rollback', $user ) ) {
681 // Get a rollback link without the brackets
682 $rollbackLink = Linker
::generateRollback(
685 array( 'verify', 'noBrackets' )
687 if ( $rollbackLink ) {
688 $this->preventClickjacking();
689 $tools[] = $rollbackLink;
693 if ( !$rev->isDeleted( Revision
::DELETED_TEXT
)
694 && !$prevRev->isDeleted( Revision
::DELETED_TEXT
)
696 # Create undo tooltip for the first (=latest) line only
697 $undoTooltip = $latest
698 ?
array( 'title' => $this->msg( 'tooltip-undo' )->text() )
700 $undolink = Linker
::linkKnown(
702 $this->msg( 'editundo' )->escaped(),
706 'undoafter' => $prevRev->getId(),
707 'undo' => $rev->getId()
710 $tools[] = "<span class=\"mw-history-undo\">{$undolink}</span>";
713 // Allow extension to add their own links here
714 wfRunHooks( 'HistoryRevisionTools', array( $rev, &$tools ) );
717 $s2 .= ' ' . $this->msg( 'parentheses' )->rawParams( $lang->pipeList( $tools ) )->escaped();
721 list( $tagSummary, $newClasses ) = ChangeTags
::formatSummaryRow( $row->ts_tags
, 'history' );
722 $classes = array_merge( $classes, $newClasses );
723 if ( $tagSummary !== '' ) {
724 $s2 .= " $tagSummary";
727 # Include separator between character difference and following text
729 $s .= ' <span class="mw-changeslist-separator">. .</span> ' . $s2;
732 wfRunHooks( 'PageHistoryLineEnding', array( $this, &$row, &$s, &$classes ) );
736 $attribs['class'] = implode( ' ', $classes );
739 return Xml
::tags( 'li', $attribs, $s ) . "\n";
743 * Create a link to view this revision of the page
745 * @param Revision $rev
748 function revLink( $rev ) {
749 $date = $this->getLanguage()->userTimeAndDate( $rev->getTimestamp(), $this->getUser() );
750 $date = htmlspecialchars( $date );
751 if ( $rev->userCan( Revision
::DELETED_TEXT
, $this->getUser() ) ) {
752 $link = Linker
::linkKnown(
755 array( 'class' => 'mw-changeslist-date' ),
756 array( 'oldid' => $rev->getId() )
761 if ( $rev->isDeleted( Revision
::DELETED_TEXT
) ) {
762 $link = "<span class=\"history-deleted\">$link</span>";
769 * Create a diff-to-current link for this revision for this page
771 * @param Revision $rev
772 * @param bool $latest This is the latest revision of the page?
775 function curLink( $rev, $latest ) {
776 $cur = $this->historyPage
->message
['cur'];
777 if ( $latest ||
!$rev->userCan( Revision
::DELETED_TEXT
, $this->getUser() ) ) {
780 return Linker
::linkKnown(
785 'diff' => $this->getWikiPage()->getLatest(),
786 'oldid' => $rev->getId()
793 * Create a diff-to-previous link for this revision for this page.
795 * @param Revision $prevRev The revision being displayed
796 * @param stdClass|string|null $next The next revision in list (that is
797 * the previous one in chronological order).
798 * May either be a row, "unknown" or null.
801 function lastLink( $prevRev, $next ) {
802 $last = $this->historyPage
->message
['last'];
804 if ( $next === null ) {
805 # Probably no next row
809 if ( $next === 'unknown' ) {
810 # Next row probably exists but is unknown, use an oldid=prev link
811 return Linker
::linkKnown(
816 'diff' => $prevRev->getId(),
822 $nextRev = new Revision( $next );
824 if ( !$prevRev->userCan( Revision
::DELETED_TEXT
, $this->getUser() )
825 ||
!$nextRev->userCan( Revision
::DELETED_TEXT
, $this->getUser() )
830 return Linker
::linkKnown(
835 'diff' => $prevRev->getId(),
836 'oldid' => $next->rev_id
842 * Create radio buttons for page history
844 * @param Revision $rev
845 * @param bool $firstInList Is this version the first one?
847 * @return string HTML output for the radio buttons
849 function diffButtons( $rev, $firstInList ) {
850 if ( $this->getNumRows() > 1 ) {
852 $radio = array( 'type' => 'radio', 'value' => $id );
853 /** @todo Move title texts to javascript */
854 if ( $firstInList ) {
855 $first = Xml
::element( 'input',
856 array_merge( $radio, array(
857 'style' => 'visibility:hidden',
859 'id' => 'mw-oldid-null' ) )
861 $checkmark = array( 'checked' => 'checked' );
863 # Check visibility of old revisions
864 if ( !$rev->userCan( Revision
::DELETED_TEXT
, $this->getUser() ) ) {
865 $radio['disabled'] = 'disabled';
866 $checkmark = array(); // We will check the next possible one
867 } elseif ( !$this->oldIdChecked
) {
868 $checkmark = array( 'checked' => 'checked' );
869 $this->oldIdChecked
= $id;
871 $checkmark = array();
873 $first = Xml
::element( 'input',
874 array_merge( $radio, $checkmark, array(
876 'id' => "mw-oldid-$id" ) ) );
877 $checkmark = array();
879 $second = Xml
::element( 'input',
880 array_merge( $radio, $checkmark, array(
882 'id' => "mw-diff-$id" ) ) );
884 return $first . $second;
891 * This is called if a write operation is possible from the generated HTML
892 * @param bool $enable
894 function preventClickjacking( $enable = true ) {
895 $this->preventClickjacking
= $enable;
899 * Get the "prevent clickjacking" flag
902 function getPreventClickjacking() {
903 return $this->preventClickjacking
;