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();
109 # Fill in the file cache if not set already
110 $useFileCache = $this->context
->getConfig()->get( 'UseFileCache' );
111 if ( $useFileCache && HTMLFileCache
::useFileCache( $this->getContext() ) ) {
112 $cache = HTMLFileCache
::newFromTitle( $this->getTitle(), 'history' );
113 if ( !$cache->isCacheGood( /* Assume up to date */ ) ) {
114 ob_start( array( &$cache, 'saveToFileCache' ) );
118 // Setup page variables.
119 $out->setFeedAppendQuery( 'action=history' );
120 $out->addModules( 'mediawiki.action.history' );
122 // Handle atom/RSS feeds.
123 $feedType = $request->getVal( 'feed' );
125 $this->feed( $feedType );
126 wfProfileOut( __METHOD__
);
131 // Fail nicely if article doesn't exist.
132 if ( !$this->page
->exists() ) {
133 $out->addWikiMsg( 'nohistory' );
134 # show deletion/move log if there is an entry
135 LogEventsList
::showLogExtract(
137 array( 'delete', 'move' ),
141 'conds' => array( "log_action != 'revision'" ),
142 'showIfEmpty' => false,
143 'msgKey' => array( 'moveddeleted-notice' )
146 wfProfileOut( __METHOD__
);
152 * Add date selector to quickly get to a certain time
154 $year = $request->getInt( 'year' );
155 $month = $request->getInt( 'month' );
156 $tagFilter = $request->getVal( 'tagfilter' );
157 $tagSelector = ChangeTags
::buildTagFilterSelector( $tagFilter );
160 * Option to show only revisions that have been (partially) hidden via RevisionDelete
162 if ( $request->getBool( 'deleted' ) ) {
163 $conds = array( 'rev_deleted != 0' );
167 if ( $this->getUser()->isAllowed( 'deletedhistory' ) ) {
168 $checkDeleted = Xml
::checkLabel( $this->msg( 'history-show-deleted' )->text(),
169 'deleted', 'mw-show-deleted-only', $request->getBool( 'deleted' ) ) . "\n";
174 // Add the general form
175 $action = htmlspecialchars( wfScript() );
177 "<form action=\"$action\" method=\"get\" id=\"mw-history-searchform\">" .
179 $this->msg( 'history-fieldset-title' )->text(),
181 array( 'id' => 'mw-history-search' )
183 Html
::hidden( 'title', $this->getTitle()->getPrefixedDBkey() ) . "\n" .
184 Html
::hidden( 'action', 'history' ) . "\n" .
186 ( $year == null ? MWTimestamp
::getLocalInstance()->format( 'Y' ) : $year ),
189 ( $tagSelector ?
( implode( ' ', $tagSelector ) . ' ' ) : '' ) .
191 Xml
::submitButton( $this->msg( 'allpagessubmit' )->text() ) . "\n" .
195 wfRunHooks( 'PageHistoryBeforeList', array( &$this->page
, $this->getContext() ) );
197 // Create and output the list.
198 $pager = new HistoryPager( $this, $year, $month, $tagFilter, $conds );
200 $pager->getNavigationBar() .
202 $pager->getNavigationBar()
204 $out->preventClickjacking( $pager->getPreventClickjacking() );
206 wfProfileOut( __METHOD__
);
210 * Fetch an array of revisions, specified by a given limit, offset and
211 * direction. This is now only used by the feeds. It was previously
212 * used by the main UI but that's now handled by the pager.
214 * @param int $limit The limit number of revisions to get
216 * @param int $direction Either self::DIR_PREV or self::DIR_NEXT
217 * @return ResultWrapper
219 function fetchRevisions( $limit, $offset, $direction ) {
220 // Fail if article doesn't exist.
221 if ( !$this->getTitle()->exists() ) {
222 return new FakeResultWrapper( array() );
225 $dbr = wfGetDB( DB_SLAVE
);
227 if ( $direction === self
::DIR_PREV
) {
228 list( $dirs, $oper ) = array( "ASC", ">=" );
229 } else { /* $direction === self::DIR_NEXT */
230 list( $dirs, $oper ) = array( "DESC", "<=" );
234 $offsets = array( "rev_timestamp $oper " . $dbr->addQuotes( $dbr->timestamp( $offset ) ) );
239 $page_id = $this->page
->getId();
241 return $dbr->select( 'revision',
242 Revision
::selectFields(),
243 array_merge( array( 'rev_page' => $page_id ), $offsets ),
245 array( 'ORDER BY' => "rev_timestamp $dirs",
246 'USE INDEX' => 'page_timestamp', 'LIMIT' => $limit )
251 * Output a subscription feed listing recent edits to this page.
253 * @param string $type Feed type
255 function feed( $type ) {
256 if ( !FeedUtils
::checkFeedOutput( $type ) ) {
259 $request = $this->getRequest();
261 $feedClasses = $this->context
->getConfig()->get( 'FeedClasses' );
262 /** @var RSSFeed|AtomFeed $feed */
263 $feed = new $feedClasses[$type](
264 $this->getTitle()->getPrefixedText() . ' - ' .
265 $this->msg( 'history-feed-title' )->inContentLanguage()->text(),
266 $this->msg( 'history-feed-description' )->inContentLanguage()->text(),
267 $this->getTitle()->getFullURL( 'action=history' )
270 // Get a limit on number of feed entries. Provide a sane default
271 // of 10 if none is defined (but limit to $wgFeedLimit max)
272 $limit = $request->getInt( 'limit', 10 );
275 $this->context
->getConfig()->get( 'FeedLimit' )
278 $items = $this->fetchRevisions( $limit, 0, self
::DIR_NEXT
);
280 // Generate feed elements enclosed between header and footer.
282 if ( $items->numRows() ) {
283 foreach ( $items as $row ) {
284 $feed->outItem( $this->feedItem( $row ) );
287 $feed->outItem( $this->feedEmpty() );
292 function feedEmpty() {
294 $this->msg( 'nohistory' )->inContentLanguage()->text(),
295 $this->msg( 'history-feed-empty' )->inContentLanguage()->parseAsBlock(),
296 $this->getTitle()->getFullURL(),
297 wfTimestamp( TS_MW
),
299 $this->getTitle()->getTalkPage()->getFullURL()
304 * Generate a FeedItem object from a given revision table row
305 * Borrows Recent Changes' feed generation functions for formatting;
306 * includes a diff to the previous revision (if any).
308 * @param stdClass|array $row Database row
311 function feedItem( $row ) {
312 $rev = new Revision( $row );
313 $rev->setTitle( $this->getTitle() );
314 $text = FeedUtils
::formatDiffRow(
316 $this->getTitle()->getPreviousRevisionID( $rev->getId() ),
318 $rev->getTimestamp(),
321 if ( $rev->getComment() == '' ) {
323 $title = $this->msg( 'history-feed-item-nocomment',
325 $wgContLang->timeanddate( $rev->getTimestamp() ),
326 $wgContLang->date( $rev->getTimestamp() ),
327 $wgContLang->time( $rev->getTimestamp() ) )->inContentLanguage()->text();
329 $title = $rev->getUserText() .
330 $this->msg( 'colon-separator' )->inContentLanguage()->text() .
331 FeedItem
::stripComment( $rev->getComment() );
337 $this->getTitle()->getFullURL( 'diff=' . $rev->getId() . '&oldid=prev' ),
338 $rev->getTimestamp(),
340 $this->getTitle()->getTalkPage()->getFullURL()
349 class HistoryPager
extends ReverseChronologicalPager
{
353 public $lastRow = false;
355 public $counter, $historyPage, $buttons, $conds;
357 protected $oldIdChecked;
359 protected $preventClickjacking = false;
363 protected $parentLens;
366 * @param HistoryAction $historyPage
367 * @param string $year
368 * @param string $month
369 * @param string $tagFilter
370 * @param array $conds
372 function __construct( $historyPage, $year = '', $month = '', $tagFilter = '', $conds = array() ) {
373 parent
::__construct( $historyPage->getContext() );
374 $this->historyPage
= $historyPage;
375 $this->tagFilter
= $tagFilter;
376 $this->getDateCond( $year, $month );
377 $this->conds
= $conds;
380 // For hook compatibility...
381 function getArticle() {
382 return $this->historyPage
->getArticle();
385 function getSqlComment() {
386 if ( $this->conds
) {
387 return 'history page filtered'; // potentially slow, see CR r58153
389 return 'history page unfiltered';
393 function getQueryInfo() {
395 'tables' => array( 'revision', 'user' ),
396 'fields' => array_merge( Revision
::selectFields(), Revision
::selectUserFields() ),
397 'conds' => array_merge(
398 array( 'rev_page' => $this->getWikiPage()->getId() ),
400 'options' => array( 'USE INDEX' => array( 'revision' => 'page_timestamp' ) ),
401 'join_conds' => array( 'user' => Revision
::userJoinCond() ),
403 ChangeTags
::modifyDisplayQuery(
404 $queryInfo['tables'],
405 $queryInfo['fields'],
407 $queryInfo['join_conds'],
408 $queryInfo['options'],
411 wfRunHooks( 'PageHistoryPager::getQueryInfo', array( &$this, &$queryInfo ) );
416 function getIndexField() {
417 return 'rev_timestamp';
421 * @param stdClass $row
424 function formatRow( $row ) {
425 if ( $this->lastRow
) {
426 $latest = ( $this->counter
== 1 && $this->mIsFirst
);
427 $firstInList = $this->counter
== 1;
429 $s = $this->historyLine( $this->lastRow
, $row,
430 $this->getTitle()->getNotificationTimestamp( $this->getUser() ), $latest, $firstInList );
434 $this->lastRow
= $row;
439 function doBatchLookups() {
440 # Do a link batch query
441 $this->mResult
->seek( 0 );
442 $batch = new LinkBatch();
444 foreach ( $this->mResult
as $row ) {
445 if ( $row->rev_parent_id
) {
446 $revIds[] = $row->rev_parent_id
;
448 if ( !is_null( $row->user_name
) ) {
449 $batch->add( NS_USER
, $row->user_name
);
450 $batch->add( NS_USER_TALK
, $row->user_name
);
451 } else { # for anons or usernames of imported revisions
452 $batch->add( NS_USER
, $row->rev_user_text
);
453 $batch->add( NS_USER_TALK
, $row->rev_user_text
);
456 $this->parentLens
= Revision
::getParentLengths( $this->mDb
, $revIds );
458 $this->mResult
->seek( 0 );
462 * Creates begin of history list with a submit button
464 * @return string HTML output
466 function getStartBody() {
467 $this->lastRow
= false;
469 $this->oldIdChecked
= 0;
471 $this->getOutput()->wrapWikiMsg( "<div class='mw-history-legend'>\n$1\n</div>", 'histlegend' );
472 $s = Html
::openElement( 'form', array( 'action' => wfScript(),
473 'id' => 'mw-history-compare' ) ) . "\n";
474 $s .= Html
::hidden( 'title', $this->getTitle()->getPrefixedDBkey() ) . "\n";
475 $s .= Html
::hidden( 'action', 'historysubmit' ) . "\n";
477 // Button container stored in $this->buttons for re-use in getEndBody()
478 $this->buttons
= '<div>';
479 $this->buttons
.= $this->submitButton( $this->msg( 'compareselectedversions' )->text(),
480 array( 'class' => 'historysubmit mw-history-compareselectedversions-button' )
481 + Linker
::tooltipAndAccesskeyAttribs( 'compareselectedversions' )
484 if ( $this->getUser()->isAllowed( 'deleterevision' ) ) {
485 $this->buttons
.= $this->getRevisionButton( 'revisiondelete', 'showhideselectedversions' );
487 $this->buttons
.= '</div>';
489 $s .= $this->buttons
;
490 $s .= '<ul id="pagehistory">' . "\n";
495 private function getRevisionButton( $name, $msg ) {
496 $this->preventClickjacking();
497 # Note bug #20966, <button> is non-standard in IE<8
498 $element = Html
::element(
504 'class' => "historysubmit mw-history-$name-button",
506 $this->msg( $msg )->text()
511 function getEndBody() {
512 if ( $this->lastRow
) {
513 $latest = $this->counter
== 1 && $this->mIsFirst
;
514 $firstInList = $this->counter
== 1;
515 if ( $this->mIsBackwards
) {
516 # Next row is unknown, but for UI reasons, probably exists if an offset has been specified
517 if ( $this->mOffset
== '' ) {
523 # The next row is the past-the-end row
524 $next = $this->mPastTheEndRow
;
527 $s = $this->historyLine( $this->lastRow
, $next,
528 $this->getTitle()->getNotificationTimestamp( $this->getUser() ), $latest, $firstInList );
533 # Add second buttons only if there is more than one rev
534 if ( $this->getNumRows() > 2 ) {
535 $s .= $this->buttons
;
543 * Creates a submit button
545 * @param string $message Text of the submit button, will be escaped
546 * @param array $attributes Attributes
547 * @return string HTML output for the submit button
549 function submitButton( $message, $attributes = array() ) {
550 # Disable submit button if history has 1 revision only
551 if ( $this->getNumRows() > 1 ) {
552 return Xml
::submitButton( $message, $attributes );
559 * Returns a row from the history printout.
561 * @todo document some more, and maybe clean up the code (some params redundant?)
563 * @param stdClass $row The database row corresponding to the previous line.
564 * @param mixed $next The database row corresponding to the next line
565 * (chronologically previous)
566 * @param bool|string $notificationtimestamp
567 * @param bool $latest Whether this row corresponds to the page's latest revision.
568 * @param bool $firstInList Whether this row corresponds to the first
569 * displayed on this history page.
570 * @return string HTML output for the row
572 function historyLine( $row, $next, $notificationtimestamp = false,
573 $latest = false, $firstInList = false ) {
574 $rev = new Revision( $row );
575 $rev->setTitle( $this->getTitle() );
577 if ( is_object( $next ) ) {
578 $prevRev = new Revision( $next );
579 $prevRev->setTitle( $this->getTitle() );
584 $curlink = $this->curLink( $rev, $latest );
585 $lastlink = $this->lastLink( $rev, $next );
586 $curLastlinks = $curlink . $this->historyPage
->message
['pipe-separator'] . $lastlink;
587 $histLinks = Html
::rawElement(
589 array( 'class' => 'mw-history-histlinks' ),
590 $this->msg( 'parentheses' )->rawParams( $curLastlinks )->escaped()
593 $diffButtons = $this->diffButtons( $rev, $firstInList );
594 $s = $histLinks . $diffButtons;
596 $link = $this->revLink( $rev );
600 $user = $this->getUser();
601 // Show checkboxes for each revision
602 if ( $user->isAllowed( 'deleterevision' ) ) {
603 $this->preventClickjacking();
604 // If revision was hidden from sysops, disable the checkbox
605 if ( !$rev->userCan( Revision
::DELETED_RESTRICTED
, $user ) ) {
606 $del = Xml
::check( 'deleterevisions', false, array( 'disabled' => 'disabled' ) );
607 // Otherwise, enable the checkbox...
609 $del = Xml
::check( 'showhiderevisions', false,
610 array( 'name' => 'ids[' . $rev->getId() . ']' ) );
612 // User can only view deleted revisions...
613 } elseif ( $rev->getVisibility() && $user->isAllowed( 'deletedhistory' ) ) {
614 // If revision was hidden from sysops, disable the link
615 if ( !$rev->userCan( Revision
::DELETED_RESTRICTED
, $user ) ) {
616 $del = Linker
::revDeleteLinkDisabled( false );
617 // Otherwise, show the link...
619 $query = array( 'type' => 'revision',
620 'target' => $this->getTitle()->getPrefixedDBkey(), 'ids' => $rev->getId() );
621 $del .= Linker
::revDeleteLink( $query,
622 $rev->isDeleted( Revision
::DELETED_RESTRICTED
), false );
629 $lang = $this->getLanguage();
630 $dirmark = $lang->getDirMark();
634 $s .= " <span class='history-user'>" .
635 Linker
::revUserTools( $rev, true ) . "</span>";
638 if ( $rev->isMinor() ) {
639 $s .= ' ' . ChangesList
::flag( 'minor' );
642 # Sometimes rev_len isn't populated
643 if ( $rev->getSize() !== null ) {
644 # Size is always public data
645 $prevSize = isset( $this->parentLens
[$row->rev_parent_id
] )
646 ?
$this->parentLens
[$row->rev_parent_id
]
648 $sDiff = ChangesList
::showCharacterDifference( $prevSize, $rev->getSize() );
649 $fSize = Linker
::formatRevisionSize( $rev->getSize() );
650 $s .= ' <span class="mw-changeslist-separator">. .</span> ' . "$fSize $sDiff";
653 # Text following the character difference is added just before running hooks
654 $s2 = Linker
::revComment( $rev, false, true );
656 if ( $notificationtimestamp && ( $row->rev_timestamp
>= $notificationtimestamp ) ) {
657 $s2 .= ' <span class="updatedmarker">' . $this->msg( 'updatedmarker' )->escaped() . '</span>';
658 $classes[] = 'mw-history-line-updated';
663 # Rollback and undo links
664 if ( $prevRev && $this->getTitle()->quickUserCan( 'edit', $user ) ) {
665 if ( $latest && $this->getTitle()->quickUserCan( 'rollback', $user ) ) {
666 // Get a rollback link without the brackets
667 $rollbackLink = Linker
::generateRollback(
670 array( 'verify', 'noBrackets' )
672 if ( $rollbackLink ) {
673 $this->preventClickjacking();
674 $tools[] = $rollbackLink;
678 if ( !$rev->isDeleted( Revision
::DELETED_TEXT
)
679 && !$prevRev->isDeleted( Revision
::DELETED_TEXT
)
681 # Create undo tooltip for the first (=latest) line only
682 $undoTooltip = $latest
683 ?
array( 'title' => $this->msg( 'tooltip-undo' )->text() )
685 $undolink = Linker
::linkKnown(
687 $this->msg( 'editundo' )->escaped(),
691 'undoafter' => $prevRev->getId(),
692 'undo' => $rev->getId()
695 $tools[] = "<span class=\"mw-history-undo\">{$undolink}</span>";
698 // Allow extension to add their own links here
699 wfRunHooks( 'HistoryRevisionTools', array( $rev, &$tools ) );
702 $s2 .= ' ' . $this->msg( 'parentheses' )->rawParams( $lang->pipeList( $tools ) )->escaped();
706 list( $tagSummary, $newClasses ) = ChangeTags
::formatSummaryRow( $row->ts_tags
, 'history' );
707 $classes = array_merge( $classes, $newClasses );
708 if ( $tagSummary !== '' ) {
709 $s2 .= " $tagSummary";
712 # Include separator between character difference and following text
714 $s .= ' <span class="mw-changeslist-separator">. .</span> ' . $s2;
717 wfRunHooks( 'PageHistoryLineEnding', array( $this, &$row, &$s, &$classes ) );
721 $attribs['class'] = implode( ' ', $classes );
724 return Xml
::tags( 'li', $attribs, $s ) . "\n";
728 * Create a link to view this revision of the page
730 * @param Revision $rev
733 function revLink( $rev ) {
734 $date = $this->getLanguage()->userTimeAndDate( $rev->getTimestamp(), $this->getUser() );
735 $date = htmlspecialchars( $date );
736 if ( $rev->userCan( Revision
::DELETED_TEXT
, $this->getUser() ) ) {
737 $link = Linker
::linkKnown(
740 array( 'class' => 'mw-changeslist-date' ),
741 array( 'oldid' => $rev->getId() )
746 if ( $rev->isDeleted( Revision
::DELETED_TEXT
) ) {
747 $link = "<span class=\"history-deleted\">$link</span>";
754 * Create a diff-to-current link for this revision for this page
756 * @param Revision $rev
757 * @param bool $latest This is the latest revision of the page?
760 function curLink( $rev, $latest ) {
761 $cur = $this->historyPage
->message
['cur'];
762 if ( $latest ||
!$rev->userCan( Revision
::DELETED_TEXT
, $this->getUser() ) ) {
765 return Linker
::linkKnown(
770 'diff' => $this->getWikiPage()->getLatest(),
771 'oldid' => $rev->getId()
778 * Create a diff-to-previous link for this revision for this page.
780 * @param Revision $prevRev The revision being displayed
781 * @param stdClass|string|null $next The next revision in list (that is
782 * the previous one in chronological order).
783 * May either be a row, "unknown" or null.
786 function lastLink( $prevRev, $next ) {
787 $last = $this->historyPage
->message
['last'];
789 if ( $next === null ) {
790 # Probably no next row
794 if ( $next === 'unknown' ) {
795 # Next row probably exists but is unknown, use an oldid=prev link
796 return Linker
::linkKnown(
801 'diff' => $prevRev->getId(),
807 $nextRev = new Revision( $next );
809 if ( !$prevRev->userCan( Revision
::DELETED_TEXT
, $this->getUser() )
810 ||
!$nextRev->userCan( Revision
::DELETED_TEXT
, $this->getUser() )
815 return Linker
::linkKnown(
820 'diff' => $prevRev->getId(),
821 'oldid' => $next->rev_id
827 * Create radio buttons for page history
829 * @param Revision $rev
830 * @param bool $firstInList Is this version the first one?
832 * @return string HTML output for the radio buttons
834 function diffButtons( $rev, $firstInList ) {
835 if ( $this->getNumRows() > 1 ) {
837 $radio = array( 'type' => 'radio', 'value' => $id );
838 /** @todo Move title texts to javascript */
839 if ( $firstInList ) {
840 $first = Xml
::element( 'input',
841 array_merge( $radio, array(
842 'style' => 'visibility:hidden',
844 'id' => 'mw-oldid-null' ) )
846 $checkmark = array( 'checked' => 'checked' );
848 # Check visibility of old revisions
849 if ( !$rev->userCan( Revision
::DELETED_TEXT
, $this->getUser() ) ) {
850 $radio['disabled'] = 'disabled';
851 $checkmark = array(); // We will check the next possible one
852 } elseif ( !$this->oldIdChecked
) {
853 $checkmark = array( 'checked' => 'checked' );
854 $this->oldIdChecked
= $id;
856 $checkmark = array();
858 $first = Xml
::element( 'input',
859 array_merge( $radio, $checkmark, array(
861 'id' => "mw-oldid-$id" ) ) );
862 $checkmark = array();
864 $second = Xml
::element( 'input',
865 array_merge( $radio, $checkmark, array(
867 'id' => "mw-diff-$id" ) ) );
869 return $first . $second;
876 * This is called if a write operation is possible from the generated HTML
878 function preventClickjacking( $enable = true ) {
879 $this->preventClickjacking
= $enable;
883 * Get the "prevent clickjacking" flag
886 function getPreventClickjacking() {
887 return $this->preventClickjacking
;