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 $this->preCacheMessages();
106 $config = $this->context
->getConfig();
108 # Fill in the file cache if not set already
109 $useFileCache = $config->get( 'UseFileCache' );
110 if ( $useFileCache && HTMLFileCache
::useFileCache( $this->getContext() ) ) {
111 $cache = new HTMLFileCache( $this->getTitle(), 'history' );
112 if ( !$cache->isCacheGood( /* Assume up to date */ ) ) {
113 ob_start( array( &$cache, 'saveToFileCache' ) );
117 // Setup page variables.
118 $out->setFeedAppendQuery( 'action=history' );
119 $out->addModules( 'mediawiki.action.history' );
120 if ( $config->get( 'UseMediaWikiUIEverywhere' ) ) {
121 $out = $this->getOutput();
122 $out->addModuleStyles( array(
123 'mediawiki.ui.input',
124 'mediawiki.ui.checkbox',
128 // Handle atom/RSS feeds.
129 $feedType = $request->getVal( 'feed' );
131 $this->feed( $feedType );
136 // Fail nicely if article doesn't exist.
137 if ( !$this->page
->exists() ) {
138 $out->addWikiMsg( 'nohistory' );
139 # show deletion/move log if there is an entry
140 LogEventsList
::showLogExtract(
142 array( 'delete', 'move' ),
146 'conds' => array( "log_action != 'revision'" ),
147 'showIfEmpty' => false,
148 'msgKey' => array( 'moveddeleted-notice' )
156 * Add date selector to quickly get to a certain time
158 $year = $request->getInt( 'year' );
159 $month = $request->getInt( 'month' );
160 $tagFilter = $request->getVal( 'tagfilter' );
161 $tagSelector = ChangeTags
::buildTagFilterSelector( $tagFilter );
164 * Option to show only revisions that have been (partially) hidden via RevisionDelete
166 if ( $request->getBool( 'deleted' ) ) {
167 $conds = array( 'rev_deleted != 0' );
171 if ( $this->getUser()->isAllowed( 'deletedhistory' ) ) {
172 $checkDeleted = Xml
::checkLabel( $this->msg( 'history-show-deleted' )->text(),
173 'deleted', 'mw-show-deleted-only', $request->getBool( 'deleted' ) ) . "\n";
178 // Add the general form
179 $action = htmlspecialchars( wfScript() );
181 "<form action=\"$action\" method=\"get\" id=\"mw-history-searchform\">" .
183 $this->msg( 'history-fieldset-title' )->text(),
185 array( 'id' => 'mw-history-search' )
187 Html
::hidden( 'title', $this->getTitle()->getPrefixedDBkey() ) . "\n" .
188 Html
::hidden( 'action', 'history' ) . "\n" .
190 ( $year == null ? MWTimestamp
::getLocalInstance()->format( 'Y' ) : $year ),
193 ( $tagSelector ?
( implode( ' ', $tagSelector ) . ' ' ) : '' ) .
196 $this->msg( 'allpagessubmit' )->text(),
198 array( 'mw-ui-progressive' )
203 Hooks
::run( 'PageHistoryBeforeList', array( &$this->page
, $this->getContext() ) );
205 // Create and output the list.
206 $pager = new HistoryPager( $this, $year, $month, $tagFilter, $conds );
208 $pager->getNavigationBar() .
210 $pager->getNavigationBar()
212 $out->preventClickjacking( $pager->getPreventClickjacking() );
217 * Fetch an array of revisions, specified by a given limit, offset and
218 * direction. This is now only used by the feeds. It was previously
219 * used by the main UI but that's now handled by the pager.
221 * @param int $limit The limit number of revisions to get
223 * @param int $direction Either self::DIR_PREV or self::DIR_NEXT
224 * @return ResultWrapper
226 function fetchRevisions( $limit, $offset, $direction ) {
227 // Fail if article doesn't exist.
228 if ( !$this->getTitle()->exists() ) {
229 return new FakeResultWrapper( array() );
232 $dbr = wfGetDB( DB_SLAVE
);
234 if ( $direction === self
::DIR_PREV
) {
235 list( $dirs, $oper ) = array( "ASC", ">=" );
236 } else { /* $direction === self::DIR_NEXT */
237 list( $dirs, $oper ) = array( "DESC", "<=" );
241 $offsets = array( "rev_timestamp $oper " . $dbr->addQuotes( $dbr->timestamp( $offset ) ) );
246 $page_id = $this->page
->getId();
248 return $dbr->select( 'revision',
249 Revision
::selectFields(),
250 array_merge( array( 'rev_page' => $page_id ), $offsets ),
252 array( 'ORDER BY' => "rev_timestamp $dirs",
253 'USE INDEX' => 'page_timestamp', 'LIMIT' => $limit )
258 * Output a subscription feed listing recent edits to this page.
260 * @param string $type Feed type
262 function feed( $type ) {
263 if ( !FeedUtils
::checkFeedOutput( $type ) ) {
266 $request = $this->getRequest();
268 $feedClasses = $this->context
->getConfig()->get( 'FeedClasses' );
269 /** @var RSSFeed|AtomFeed $feed */
270 $feed = new $feedClasses[$type](
271 $this->getTitle()->getPrefixedText() . ' - ' .
272 $this->msg( 'history-feed-title' )->inContentLanguage()->text(),
273 $this->msg( 'history-feed-description' )->inContentLanguage()->text(),
274 $this->getTitle()->getFullURL( 'action=history' )
277 // Get a limit on number of feed entries. Provide a sane default
278 // of 10 if none is defined (but limit to $wgFeedLimit max)
279 $limit = $request->getInt( 'limit', 10 );
282 $this->context
->getConfig()->get( 'FeedLimit' )
285 $items = $this->fetchRevisions( $limit, 0, self
::DIR_NEXT
);
287 // Generate feed elements enclosed between header and footer.
289 if ( $items->numRows() ) {
290 foreach ( $items as $row ) {
291 $feed->outItem( $this->feedItem( $row ) );
294 $feed->outItem( $this->feedEmpty() );
299 function feedEmpty() {
301 $this->msg( 'nohistory' )->inContentLanguage()->text(),
302 $this->msg( 'history-feed-empty' )->inContentLanguage()->parseAsBlock(),
303 $this->getTitle()->getFullURL(),
304 wfTimestamp( TS_MW
),
306 $this->getTitle()->getTalkPage()->getFullURL()
311 * Generate a FeedItem object from a given revision table row
312 * Borrows Recent Changes' feed generation functions for formatting;
313 * includes a diff to the previous revision (if any).
315 * @param stdClass|array $row Database row
318 function feedItem( $row ) {
319 $rev = new Revision( $row );
320 $rev->setTitle( $this->getTitle() );
321 $text = FeedUtils
::formatDiffRow(
323 $this->getTitle()->getPreviousRevisionID( $rev->getId() ),
325 $rev->getTimestamp(),
328 if ( $rev->getComment() == '' ) {
330 $title = $this->msg( 'history-feed-item-nocomment',
332 $wgContLang->timeanddate( $rev->getTimestamp() ),
333 $wgContLang->date( $rev->getTimestamp() ),
334 $wgContLang->time( $rev->getTimestamp() ) )->inContentLanguage()->text();
336 $title = $rev->getUserText() .
337 $this->msg( 'colon-separator' )->inContentLanguage()->text() .
338 FeedItem
::stripComment( $rev->getComment() );
344 $this->getTitle()->getFullURL( 'diff=' . $rev->getId() . '&oldid=prev' ),
345 $rev->getTimestamp(),
347 $this->getTitle()->getTalkPage()->getFullURL()
356 class HistoryPager
extends ReverseChronologicalPager
{
360 public $lastRow = false;
362 public $counter, $historyPage, $buttons, $conds;
364 protected $oldIdChecked;
366 protected $preventClickjacking = false;
370 protected $parentLens;
373 * @param HistoryAction $historyPage
374 * @param string $year
375 * @param string $month
376 * @param string $tagFilter
377 * @param array $conds
379 function __construct( $historyPage, $year = '', $month = '', $tagFilter = '', $conds = array() ) {
380 parent
::__construct( $historyPage->getContext() );
381 $this->historyPage
= $historyPage;
382 $this->tagFilter
= $tagFilter;
383 $this->getDateCond( $year, $month );
384 $this->conds
= $conds;
387 // For hook compatibility...
388 function getArticle() {
389 return $this->historyPage
->getArticle();
392 function getSqlComment() {
393 if ( $this->conds
) {
394 return 'history page filtered'; // potentially slow, see CR r58153
396 return 'history page unfiltered';
400 function getQueryInfo() {
402 'tables' => array( 'revision', 'user' ),
403 'fields' => array_merge( Revision
::selectFields(), Revision
::selectUserFields() ),
404 'conds' => array_merge(
405 array( 'rev_page' => $this->getWikiPage()->getId() ),
407 'options' => array( 'USE INDEX' => array( 'revision' => 'page_timestamp' ) ),
408 'join_conds' => array( 'user' => Revision
::userJoinCond() ),
410 ChangeTags
::modifyDisplayQuery(
411 $queryInfo['tables'],
412 $queryInfo['fields'],
414 $queryInfo['join_conds'],
415 $queryInfo['options'],
418 Hooks
::run( 'PageHistoryPager::getQueryInfo', array( &$this, &$queryInfo ) );
423 function getIndexField() {
424 return 'rev_timestamp';
428 * @param stdClass $row
431 function formatRow( $row ) {
432 if ( $this->lastRow
) {
433 $latest = ( $this->counter
== 1 && $this->mIsFirst
);
434 $firstInList = $this->counter
== 1;
436 $s = $this->historyLine( $this->lastRow
, $row,
437 $this->getTitle()->getNotificationTimestamp( $this->getUser() ), $latest, $firstInList );
441 $this->lastRow
= $row;
446 function doBatchLookups() {
447 # Do a link batch query
448 $this->mResult
->seek( 0 );
449 $batch = new LinkBatch();
451 foreach ( $this->mResult
as $row ) {
452 if ( $row->rev_parent_id
) {
453 $revIds[] = $row->rev_parent_id
;
455 if ( !is_null( $row->user_name
) ) {
456 $batch->add( NS_USER
, $row->user_name
);
457 $batch->add( NS_USER_TALK
, $row->user_name
);
458 } else { # for anons or usernames of imported revisions
459 $batch->add( NS_USER
, $row->rev_user_text
);
460 $batch->add( NS_USER_TALK
, $row->rev_user_text
);
463 $this->parentLens
= Revision
::getParentLengths( $this->mDb
, $revIds );
465 $this->mResult
->seek( 0 );
469 * Creates begin of history list with a submit button
471 * @return string HTML output
473 function getStartBody() {
474 $this->lastRow
= false;
476 $this->oldIdChecked
= 0;
478 $this->getOutput()->wrapWikiMsg( "<div class='mw-history-legend'>\n$1\n</div>", 'histlegend' );
479 $s = Html
::openElement( 'form', array( 'action' => wfScript(),
480 'id' => 'mw-history-compare' ) ) . "\n";
481 $s .= Html
::hidden( 'title', $this->getTitle()->getPrefixedDBkey() ) . "\n";
482 $s .= Html
::hidden( 'action', 'historysubmit' ) . "\n";
484 // Button container stored in $this->buttons for re-use in getEndBody()
485 $this->buttons
= '<div>';
486 $className = 'historysubmit mw-history-compareselectedversions-button';
487 $attrs = array( 'class' => $className )
488 + Linker
::tooltipAndAccesskeyAttribs( 'compareselectedversions' );
489 $this->buttons
.= $this->submitButton( $this->msg( 'compareselectedversions' )->text(),
493 if ( $this->getUser()->isAllowed( 'deleterevision' ) ) {
494 $this->buttons
.= $this->getRevisionButton( 'revisiondelete', 'showhideselectedversions' );
496 $this->buttons
.= '</div>';
498 $s .= $this->buttons
;
499 $s .= '<ul id="pagehistory">' . "\n";
504 private function getRevisionButton( $name, $msg ) {
505 $this->preventClickjacking();
506 # Note bug #20966, <button> is non-standard in IE<8
507 $element = Html
::element(
513 'class' => "historysubmit mw-history-$name-button",
515 $this->msg( $msg )->text()
520 function getEndBody() {
521 if ( $this->lastRow
) {
522 $latest = $this->counter
== 1 && $this->mIsFirst
;
523 $firstInList = $this->counter
== 1;
524 if ( $this->mIsBackwards
) {
525 # Next row is unknown, but for UI reasons, probably exists if an offset has been specified
526 if ( $this->mOffset
== '' ) {
532 # The next row is the past-the-end row
533 $next = $this->mPastTheEndRow
;
536 $s = $this->historyLine( $this->lastRow
, $next,
537 $this->getTitle()->getNotificationTimestamp( $this->getUser() ), $latest, $firstInList );
542 # Add second buttons only if there is more than one rev
543 if ( $this->getNumRows() > 2 ) {
544 $s .= $this->buttons
;
552 * Creates a submit button
554 * @param string $message Text of the submit button, will be escaped
555 * @param array $attributes Attributes
556 * @return string HTML output for the submit button
558 function submitButton( $message, $attributes = array() ) {
559 # Disable submit button if history has 1 revision only
560 if ( $this->getNumRows() > 1 ) {
561 return Html
::submitButton( $message, $attributes );
568 * Returns a row from the history printout.
570 * @todo document some more, and maybe clean up the code (some params redundant?)
572 * @param stdClass $row The database row corresponding to the previous line.
573 * @param mixed $next The database row corresponding to the next line
574 * (chronologically previous)
575 * @param bool|string $notificationtimestamp
576 * @param bool $latest Whether this row corresponds to the page's latest revision.
577 * @param bool $firstInList Whether this row corresponds to the first
578 * displayed on this history page.
579 * @return string HTML output for the row
581 function historyLine( $row, $next, $notificationtimestamp = false,
582 $latest = false, $firstInList = false ) {
583 $rev = new Revision( $row );
584 $rev->setTitle( $this->getTitle() );
586 if ( is_object( $next ) ) {
587 $prevRev = new Revision( $next );
588 $prevRev->setTitle( $this->getTitle() );
593 $curlink = $this->curLink( $rev, $latest );
594 $lastlink = $this->lastLink( $rev, $next );
595 $curLastlinks = $curlink . $this->historyPage
->message
['pipe-separator'] . $lastlink;
596 $histLinks = Html
::rawElement(
598 array( 'class' => 'mw-history-histlinks' ),
599 $this->msg( 'parentheses' )->rawParams( $curLastlinks )->escaped()
602 $diffButtons = $this->diffButtons( $rev, $firstInList );
603 $s = $histLinks . $diffButtons;
605 $link = $this->revLink( $rev );
609 $user = $this->getUser();
610 // Show checkboxes for each revision
611 if ( $user->isAllowed( 'deleterevision' ) ) {
612 $this->preventClickjacking();
613 // If revision was hidden from sysops, disable the checkbox
614 if ( !$rev->userCan( Revision
::DELETED_RESTRICTED
, $user ) ) {
615 $del = Xml
::check( 'deleterevisions', false, array( 'disabled' => 'disabled' ) );
616 // Otherwise, enable the checkbox...
618 $del = Xml
::check( 'showhiderevisions', false,
619 array( 'name' => 'ids[' . $rev->getId() . ']' ) );
621 // User can only view deleted revisions...
622 } elseif ( $rev->getVisibility() && $user->isAllowed( 'deletedhistory' ) ) {
623 // If revision was hidden from sysops, disable the link
624 if ( !$rev->userCan( Revision
::DELETED_RESTRICTED
, $user ) ) {
625 $del = Linker
::revDeleteLinkDisabled( false );
626 // Otherwise, show the link...
628 $query = array( 'type' => 'revision',
629 'target' => $this->getTitle()->getPrefixedDBkey(), 'ids' => $rev->getId() );
630 $del .= Linker
::revDeleteLink( $query,
631 $rev->isDeleted( Revision
::DELETED_RESTRICTED
), false );
638 $lang = $this->getLanguage();
639 $dirmark = $lang->getDirMark();
643 $s .= " <span class='history-user'>" .
644 Linker
::revUserTools( $rev, true ) . "</span>";
647 if ( $rev->isMinor() ) {
648 $s .= ' ' . ChangesList
::flag( 'minor' );
651 # Sometimes rev_len isn't populated
652 if ( $rev->getSize() !== null ) {
653 # Size is always public data
654 $prevSize = isset( $this->parentLens
[$row->rev_parent_id
] )
655 ?
$this->parentLens
[$row->rev_parent_id
]
657 $sDiff = ChangesList
::showCharacterDifference( $prevSize, $rev->getSize() );
658 $fSize = Linker
::formatRevisionSize( $rev->getSize() );
659 $s .= ' <span class="mw-changeslist-separator">. .</span> ' . "$fSize $sDiff";
662 # Text following the character difference is added just before running hooks
663 $s2 = Linker
::revComment( $rev, false, true );
665 if ( $notificationtimestamp && ( $row->rev_timestamp
>= $notificationtimestamp ) ) {
666 $s2 .= ' <span class="updatedmarker">' . $this->msg( 'updatedmarker' )->escaped() . '</span>';
667 $classes[] = 'mw-history-line-updated';
672 # Rollback and undo links
673 if ( $prevRev && $this->getTitle()->quickUserCan( 'edit', $user ) ) {
674 if ( $latest && $this->getTitle()->quickUserCan( 'rollback', $user ) ) {
675 // Get a rollback link without the brackets
676 $rollbackLink = Linker
::generateRollback(
679 array( 'verify', 'noBrackets' )
681 if ( $rollbackLink ) {
682 $this->preventClickjacking();
683 $tools[] = $rollbackLink;
687 if ( !$rev->isDeleted( Revision
::DELETED_TEXT
)
688 && !$prevRev->isDeleted( Revision
::DELETED_TEXT
)
690 # Create undo tooltip for the first (=latest) line only
691 $undoTooltip = $latest
692 ?
array( 'title' => $this->msg( 'tooltip-undo' )->text() )
694 $undolink = Linker
::linkKnown(
696 $this->msg( 'editundo' )->escaped(),
700 'undoafter' => $prevRev->getId(),
701 'undo' => $rev->getId()
704 $tools[] = "<span class=\"mw-history-undo\">{$undolink}</span>";
707 // Allow extension to add their own links here
708 Hooks
::run( 'HistoryRevisionTools', array( $rev, &$tools ) );
711 $s2 .= ' ' . $this->msg( 'parentheses' )->rawParams( $lang->pipeList( $tools ) )->escaped();
715 list( $tagSummary, $newClasses ) = ChangeTags
::formatSummaryRow( $row->ts_tags
, 'history' );
716 $classes = array_merge( $classes, $newClasses );
717 if ( $tagSummary !== '' ) {
718 $s2 .= " $tagSummary";
721 # Include separator between character difference and following text
723 $s .= ' <span class="mw-changeslist-separator">. .</span> ' . $s2;
726 Hooks
::run( 'PageHistoryLineEnding', array( $this, &$row, &$s, &$classes ) );
730 $attribs['class'] = implode( ' ', $classes );
733 return Xml
::tags( 'li', $attribs, $s ) . "\n";
737 * Create a link to view this revision of the page
739 * @param Revision $rev
742 function revLink( $rev ) {
743 $date = $this->getLanguage()->userTimeAndDate( $rev->getTimestamp(), $this->getUser() );
744 $date = htmlspecialchars( $date );
745 if ( $rev->userCan( Revision
::DELETED_TEXT
, $this->getUser() ) ) {
746 $link = Linker
::linkKnown(
749 array( 'class' => 'mw-changeslist-date' ),
750 array( 'oldid' => $rev->getId() )
755 if ( $rev->isDeleted( Revision
::DELETED_TEXT
) ) {
756 $link = "<span class=\"history-deleted\">$link</span>";
763 * Create a diff-to-current link for this revision for this page
765 * @param Revision $rev
766 * @param bool $latest This is the latest revision of the page?
769 function curLink( $rev, $latest ) {
770 $cur = $this->historyPage
->message
['cur'];
771 if ( $latest ||
!$rev->userCan( Revision
::DELETED_TEXT
, $this->getUser() ) ) {
774 return Linker
::linkKnown(
779 'diff' => $this->getWikiPage()->getLatest(),
780 'oldid' => $rev->getId()
787 * Create a diff-to-previous link for this revision for this page.
789 * @param Revision $prevRev The revision being displayed
790 * @param stdClass|string|null $next The next revision in list (that is
791 * the previous one in chronological order).
792 * May either be a row, "unknown" or null.
795 function lastLink( $prevRev, $next ) {
796 $last = $this->historyPage
->message
['last'];
798 if ( $next === null ) {
799 # Probably no next row
803 if ( $next === 'unknown' ) {
804 # Next row probably exists but is unknown, use an oldid=prev link
805 return Linker
::linkKnown(
810 'diff' => $prevRev->getId(),
816 $nextRev = new Revision( $next );
818 if ( !$prevRev->userCan( Revision
::DELETED_TEXT
, $this->getUser() )
819 ||
!$nextRev->userCan( Revision
::DELETED_TEXT
, $this->getUser() )
824 return Linker
::linkKnown(
829 'diff' => $prevRev->getId(),
830 'oldid' => $next->rev_id
836 * Create radio buttons for page history
838 * @param Revision $rev
839 * @param bool $firstInList Is this version the first one?
841 * @return string HTML output for the radio buttons
843 function diffButtons( $rev, $firstInList ) {
844 if ( $this->getNumRows() > 1 ) {
846 $radio = array( 'type' => 'radio', 'value' => $id );
847 /** @todo Move title texts to javascript */
848 if ( $firstInList ) {
849 $first = Xml
::element( 'input',
850 array_merge( $radio, array(
851 'style' => 'visibility:hidden',
853 'id' => 'mw-oldid-null' ) )
855 $checkmark = array( 'checked' => 'checked' );
857 # Check visibility of old revisions
858 if ( !$rev->userCan( Revision
::DELETED_TEXT
, $this->getUser() ) ) {
859 $radio['disabled'] = 'disabled';
860 $checkmark = array(); // We will check the next possible one
861 } elseif ( !$this->oldIdChecked
) {
862 $checkmark = array( 'checked' => 'checked' );
863 $this->oldIdChecked
= $id;
865 $checkmark = array();
867 $first = Xml
::element( 'input',
868 array_merge( $radio, $checkmark, array(
870 'id' => "mw-oldid-$id" ) ) );
871 $checkmark = array();
873 $second = Xml
::element( 'input',
874 array_merge( $radio, $checkmark, array(
876 'id' => "mw-diff-$id" ) ) );
878 return $first . $second;
885 * This is called if a write operation is possible from the generated HTML
886 * @param bool $enable
888 function preventClickjacking( $enable = true ) {
889 $this->preventClickjacking
= $enable;
893 * Get the "prevent clickjacking" flag
896 function getPreventClickjacking() {
897 return $this->preventClickjacking
;