2 # Copyright (C) 2004 Brion Vibber <brion@pobox.com>, 2008 Aaron Schulz
3 # http://www.mediawiki.org/
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2 of the License, or
8 # (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License along
16 # with this program; if not, write to the Free Software Foundation, Inc.,
17 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 # http://www.gnu.org/copyleft/gpl.html
21 const NO_ACTION_LINK
= 1;
27 public function __construct( $skin, $out, $flags = 0 ) {
30 $this->flags
= $flags;
31 $this->preCacheMessages();
35 * As we use the same small set of messages in various methods and that
36 * they are called often, we call them once and save them in $this->message
38 private function preCacheMessages() {
39 // Precache various messages
40 if( !isset( $this->message
) ) {
41 $messages = array('revertmerge','protect_change','unblocklink','change-blocklink',
42 'revertmove','undeletelink','revdel-restore','rev-delundel','hist');
43 foreach( $messages as $msg ) {
44 $this->message
[$msg] = wfMsgExt( $msg, array( 'escape') );
50 * Set page title and show header for this log type
53 public function showHeader( $type ) {
54 if( LogPage
::isLogType( $type ) ) {
55 $this->out
->setPageTitle( LogPage
::logName( $type ) );
56 $this->out
->addHTML( LogPage
::logHeader( $type ) );
61 * Show options for the log list
65 * @param $pattern String
66 * @param $year Integer: year
67 * @param $month Integer: month
68 * @param $filter Boolean
70 public function showOptions( $type = '', $user = '', $page = '', $pattern = '', $year = '',
71 $month = '', $filter = null )
73 global $wgScript, $wgMiserMode;
74 $action = htmlspecialchars( $wgScript );
75 $title = SpecialPage
::getTitleFor( 'Log' );
76 $special = htmlspecialchars( $title->getPrefixedDBkey() );
78 $this->out
->addHTML( "<form action=\"$action\" method=\"get\"><fieldset>" .
79 Xml
::element( 'legend', array(), wfMsg( 'log' ) ) .
80 Xml
::hidden( 'title', $special ) . "\n" .
81 $this->getTypeMenu( $type ) . "\n" .
82 $this->getUserInput( $user ) . "\n" .
83 $this->getTitleInput( $page ) . "\n" .
84 ( !$wgMiserMode ?
($this->getTitlePattern( $pattern )."\n") : "" ) .
85 "<p>" . $this->getDateMenu( $year, $month ) . "\n" .
86 ( $filter ?
"</p><p>".$this->getFilterLinks( $type, $filter )."\n" : "" ) .
87 Xml
::submitButton( wfMsg( 'allpagessubmit' ) ) . "</p>\n" .
92 private function getFilterLinks( $logType, $filter ) {
95 $messages = array( wfMsgHtml( 'show' ), wfMsgHtml( 'hide' ) );
96 // Option value -> message mapping
98 foreach( $filter as $type => $val ) {
99 $hideVal = 1 - intval($val);
100 $link = $this->skin
->makeKnownLinkObj( $wgTitle, $messages[$hideVal],
101 wfArrayToCGI( array( "hide_{$type}_log" => $hideVal ), $this->getDefaultQuery() )
103 $links[$type] = wfMsgHtml( "log-show-hide-{$type}", $link );
106 return implode( ' | ', $links );
109 private function getDefaultQuery() {
110 if ( !isset( $this->mDefaultQuery
) ) {
111 $this->mDefaultQuery
= $_GET;
112 unset( $this->mDefaultQuery
['title'] );
113 unset( $this->mDefaultQuery
['dir'] );
114 unset( $this->mDefaultQuery
['offset'] );
115 unset( $this->mDefaultQuery
['limit'] );
116 unset( $this->mDefaultQuery
['order'] );
117 unset( $this->mDefaultQuery
['month'] );
118 unset( $this->mDefaultQuery
['year'] );
120 return $this->mDefaultQuery
;
124 * @param $queryType String
125 * @return String: Formatted HTML
127 private function getTypeMenu( $queryType ) {
128 global $wgLogRestrictions, $wgUser;
130 $html = "<select name='type'>\n";
132 $validTypes = LogPage
::validTypes();
133 $typesByName = array(); // Temporary array
135 // First pass to load the log names
136 foreach( $validTypes as $type ) {
137 $text = LogPage
::logName( $type );
138 $typesByName[$text] = $type;
141 // Second pass to sort by name
144 // Third pass generates sorted XHTML content
145 foreach( $typesByName as $text => $type ) {
146 $selected = ($type == $queryType);
148 if ( isset($wgLogRestrictions[$type]) ) {
149 if ( $wgUser->isAllowed( $wgLogRestrictions[$type] ) ) {
150 $html .= Xml
::option( $text, $type, $selected ) . "\n";
153 $html .= Xml
::option( $text, $type, $selected ) . "\n";
157 $html .= '</select>';
162 * @param $user String
163 * @return String: Formatted HTML
165 private function getUserInput( $user ) {
166 return Xml
::inputLabel( wfMsg( 'specialloguserlabel' ), 'user', 'user', 15, $user );
170 * @param $title String
171 * @return String: Formatted HTML
173 private function getTitleInput( $title ) {
174 return Xml
::inputLabel( wfMsg( 'speciallogtitlelabel' ), 'page', 'page', 20, $title );
178 * @param $year Integer
179 * @param $month Integer
180 * @return string Formatted HTML
182 private function getDateMenu( $year, $month ) {
183 # Offset overrides year/month selection
184 if( $month && $month !== -1 ) {
185 $encMonth = intval( $month );
190 $encYear = intval( $year );
191 } else if( $encMonth ) {
192 $thisMonth = intval( gmdate( 'n' ) );
193 $thisYear = intval( gmdate( 'Y' ) );
194 if( intval($encMonth) > $thisMonth ) {
197 $encYear = $thisYear;
201 return Xml
::label( wfMsg( 'year' ), 'year' ) . ' '.
202 Xml
::input( 'year', 4, $encYear, array('id' => 'year', 'maxlength' => 4) ) .
204 Xml
::label( wfMsg( 'month' ), 'month' ) . ' '.
205 Xml
::monthSelector( $encMonth, -1 );
209 * @return boolean Checkbox
211 private function getTitlePattern( $pattern ) {
212 return '<span style="white-space: nowrap">' .
213 Xml
::checkLabel( wfMsg( 'log-title-wildcard' ), 'pattern', 'pattern', $pattern ) .
217 public function beginLogEventsList() {
221 public function endLogEventsList() {
226 * @param $row Row: a single row from the result set
227 * @return String: Formatted HTML list item
229 public function logLine( $row ) {
230 global $wgLang, $wgUser, $wgContLang;
232 $title = Title
::makeTitle( $row->log_namespace
, $row->log_title
);
233 $time = $wgLang->timeanddate( wfTimestamp(TS_MW
, $row->log_timestamp
), true );
235 if( self
::isDeleted($row,LogPage
::DELETED_USER
) ) {
236 $userLink = '<span class="history-deleted">' . wfMsgHtml( 'rev-deleted-user' ) . '</span>';
238 $userLink = $this->skin
->userLink( $row->log_user
, $row->user_name
) .
239 $this->skin
->userToolLinks( $row->log_user
, $row->user_name
, true, 0, $row->user_editcount
);
242 if( self
::isDeleted($row,LogPage
::DELETED_COMMENT
) ) {
243 $comment = '<span class="history-deleted">' . wfMsgHtml('rev-deleted-comment') . '</span>';
245 $comment = $wgContLang->getDirMark() . $this->skin
->commentBlock( $row->log_comment
);
247 // Extract extra parameters
248 $paramArray = LogPage
::extractParams( $row->log_params
);
250 // Some user can hide log items and have review links
251 if( $wgUser->isAllowed( 'deleterevision' ) ) {
252 $del = $this->getShowHideLinks( $row ) . ' ';
254 // Add review links and such...
255 if( ($this->flags
& self
::NO_ACTION_LINK
) ||
($row->log_deleted
& LogPage
::DELETED_ACTION
) ) {
256 // Action text is suppressed...
257 } else if( self
::typeAction($row,'move','move','move') && !empty($paramArray[0]) ) {
258 $destTitle = Title
::newFromText( $paramArray[0] );
260 $revert = '(' . $this->skin
->makeKnownLinkObj( SpecialPage
::getTitleFor( 'Movepage' ),
261 $this->message
['revertmove'],
262 'wpOldTitle=' . urlencode( $destTitle->getPrefixedDBkey() ) .
263 '&wpNewTitle=' . urlencode( $title->getPrefixedDBkey() ) .
264 '&wpReason=' . urlencode( wfMsgForContent( 'revertmove' ) ) .
265 '&wpMovetalk=0' ) . ')';
267 // Show undelete link
268 } else if( self
::typeAction($row,array('delete','suppress'),'delete','delete') ) {
269 $revert = '(' . $this->skin
->makeKnownLinkObj( SpecialPage
::getTitleFor( 'Undelete' ),
270 $this->message
['undeletelink'], 'target='. urlencode( $title->getPrefixedDBkey() ) ) . ')';
271 // Show unblock/change block link
272 } else if( self
::typeAction($row,array('block','suppress'),array('block','reblock'),'block') ) {
274 $this->skin
->link( SpecialPage
::getTitleFor( 'Ipblocklist' ),
275 $this->message
['unblocklink'],
277 array( 'action' => 'unblock', 'ip' => $row->log_title
),
279 . ' ' . wfMsg( 'pipe-separator' ) . ' ' .
280 $this->skin
->link( SpecialPage
::getTitleFor( 'Blockip', $row->log_title
),
281 $this->message
['change-blocklink'],
282 array(), array(), 'known' ) .
284 // Show change protection link
285 } else if( self
::typeAction($row,'protect',array('modify','protect','unprotect')) ) {
286 $revert .= ' (' . $this->skin
->makeKnownLinkObj( $title, $this->message
['hist'],
287 'action=history&offset=' . urlencode($row->log_timestamp
) ) . ')';
288 if( $wgUser->isAllowed('protect') && $row->log_action
!= 'unprotect' ) {
289 $revert .= ' (' . $this->skin
->makeKnownLinkObj( $title, $this->message
['protect_change'],
290 'action=unprotect' ) . ')';
293 } else if( self
::typeAction($row,'merge','merge','mergehistory') ) {
294 $merge = SpecialPage
::getTitleFor( 'Mergehistory' );
295 $revert = '(' . $this->skin
->makeKnownLinkObj( $merge, $this->message
['revertmerge'],
296 wfArrayToCGI( array('target' => $paramArray[0], 'dest' => $title->getPrefixedDBkey(),
297 'mergepoint' => $paramArray[1] ) ) ) . ')';
298 // If an edit was hidden from a page give a review link to the history
299 } else if( self
::typeAction($row,array('delete','suppress'),'revision','deleterevision') ) {
300 if( count($paramArray) == 2 ) {
301 $revdel = SpecialPage
::getTitleFor( 'Revisiondelete' );
302 // Different revision types use different URL params...
303 $key = $paramArray[0];
304 // Link to each hidden object ID, $paramArray[1] is the url param
305 $Ids = explode( ',', $paramArray[1] );
307 foreach( $Ids as $n => $id ) {
308 $revParams .= '&' . urlencode($key) . '[]=' . urlencode($id);
310 $revert = '(' . $this->skin
->makeKnownLinkObj( $revdel, $this->message
['revdel-restore'],
311 'target=' . $title->getPrefixedUrl() . $revParams ) . ')';
313 // Hidden log items, give review link
314 } else if( self
::typeAction($row,array('delete','suppress'),'event','deleterevision') ) {
315 if( count($paramArray) == 1 ) {
316 $revdel = SpecialPage
::getTitleFor( 'Revisiondelete' );
317 $Ids = explode( ',', $paramArray[0] );
318 // Link to each hidden object ID, $paramArray[1] is the url param
320 foreach( $Ids as $n => $id ) {
321 $logParams .= '&logid[]=' . intval($id);
323 $revert = '(' . $this->skin
->makeKnownLinkObj( $revdel, $this->message
['revdel-restore'],
324 'target=' . $title->getPrefixedUrl() . $logParams ) . ')';
326 // Self-created users
327 } else if( self
::typeAction($row,'newusers','create2') ) {
328 if( isset( $paramArray[0] ) ) {
329 $revert = $this->skin
->userToolLinks( $paramArray[0], $title->getDBkey(), true );
331 # Fall back to a blue contributions link
332 $revert = $this->skin
->userToolLinks( 1, $title->getDBkey() );
334 if( $time < '20080129000000' ) {
335 # Suppress $comment from old entries (before 2008-01-29),
336 # not needed and can contain incorrect links
339 // Do nothing. The implementation is handled by the hook modifiying the passed-by-ref parameters.
341 wfRunHooks( 'LogLine', array( $row->log_type
, $row->log_action
, $title, $paramArray,
342 &$comment, &$revert, $row->log_timestamp
) );
345 if( self
::isDeleted($row,LogPage
::DELETED_ACTION
) ) {
346 $action = '<span class="history-deleted">' . wfMsgHtml('rev-deleted-event') . '</span>';
348 $action = LogPage
::actionText( $row->log_type
, $row->log_action
, $title,
349 $this->skin
, $paramArray, true );
352 if( $revert != '' ) {
353 $revert = '<span class="mw-logevent-actionlink">' . $revert . '</span>';
356 return "<li>$del$time $userLink $action $comment $revert</li>\n";
363 private function getShowHideLinks( $row ) {
364 $revdel = SpecialPage
::getTitleFor( 'Revisiondelete' );
365 // If event was hidden from sysops
366 if( !self
::userCan( $row, LogPage
::DELETED_RESTRICTED
) ) {
367 $del = $this->message
['rev-delundel'];
368 } else if( $row->log_type
== 'suppress' ) {
369 // No one should be hiding from the oversight log
370 $del = $this->message
['rev-delundel'];
372 $target = SpecialPage
::getTitleFor( 'Log', $row->log_type
);
373 $del = $this->skin
->makeKnownLinkObj( $revdel, $this->message
['rev-delundel'],
374 'target=' . $target->getPrefixedUrl() . '&logid='.$row->log_id
);
375 // Bolden oversighted content
376 if( self
::isDeleted( $row, LogPage
::DELETED_RESTRICTED
) )
377 $del = "<strong>$del</strong>";
379 return "<tt>(<small>$del</small>)</tt>";
384 * @param $type Mixed: string/array
385 * @param $action Mixed: string/array
386 * @param $right string
389 public static function typeAction( $row, $type, $action, $right='' ) {
390 $match = is_array($type) ?
in_array($row->log_type
,$type) : $row->log_type
== $type;
392 $match = is_array($action) ?
393 in_array($row->log_action
,$action) : $row->log_action
== $action;
394 if( $match && $right ) {
396 $match = $wgUser->isAllowed( $right );
403 * Determine if the current user is allowed to view a particular
404 * field of this log row, if it's marked as deleted.
406 * @param $field Integer
409 public static function userCan( $row, $field ) {
410 if( ( $row->log_deleted
& $field ) == $field ) {
412 $permission = ( $row->log_deleted
& LogPage
::DELETED_RESTRICTED
) == LogPage
::DELETED_RESTRICTED
415 wfDebug( "Checking for $permission due to $field match on $row->log_deleted\n" );
416 return $wgUser->isAllowed( $permission );
424 * @param $field Integer: one of DELETED_* bitfield constants
427 public static function isDeleted( $row, $field ) {
428 return ($row->log_deleted
& $field) == $field;
432 * Quick function to show a short log extract
433 * @param $out OutputPage
434 * @param $type String
435 * @param $page String
436 * @param $user String
437 * @param $lim Integer
438 * @param $conds Array
440 public static function showLogExtract( $out, $type='', $page='', $user='', $lim=0, $conds=array() ) {
442 # Insert list of top 50 or so items
443 $loglist = new LogEventsList( $wgUser->getSkin(), $out, 0 );
444 $pager = new LogPager( $loglist, $type, $user, $page, '', $conds );
445 if( $lim > 0 ) $pager->mLimit
= $lim;
446 $logBody = $pager->getBody();
449 $loglist->beginLogEventsList() .
451 $loglist->endLogEventsList()
454 $out->addWikiMsg( 'logempty' );
456 return $pager->getNumRows();
460 * SQL clause to skip forbidden log types for this user
461 * @param $db Database
462 * @return mixed (string or false)
464 public static function getExcludeClause( $db ) {
465 global $wgLogRestrictions, $wgUser;
466 // Reset the array, clears extra "where" clauses when $par is used
467 $hiddenLogs = array();
468 // Don't show private logs to unprivileged users
469 foreach( $wgLogRestrictions as $logType => $right ) {
470 if( !$wgUser->isAllowed($right) ) {
471 $safeType = $db->strencode( $logType );
472 $hiddenLogs[] = $safeType;
475 if( count($hiddenLogs) == 1 ) {
476 return 'log_type != ' . $db->addQuotes( $hiddenLogs[0] );
477 } elseif( $hiddenLogs ) {
478 return 'log_type NOT IN (' . $db->makeList($hiddenLogs) . ')';
487 class LogPager
extends ReverseChronologicalPager
{
488 private $type = '', $user = '', $title = '', $pattern = '';
489 public $mLogEventsList;
493 * @param $list LogEventsList
494 * @param $type String
495 * @param $user String
496 * @param $title String
497 * @param $pattern String
498 * @param $conds Array
499 * @param $year Integer
500 * @param $month Integer
502 public function __construct( $list, $type = '', $user = '', $title = '', $pattern = '',
503 $conds = array(), $year = false, $month = false )
505 parent
::__construct();
506 $this->mConds
= $conds;
508 $this->mLogEventsList
= $list;
510 $this->limitType( $type );
511 $this->limitUser( $user );
512 $this->limitTitle( $title, $pattern );
513 $this->getDateCond( $year, $month );
516 public function getDefaultQuery() {
517 $query = parent
::getDefaultQuery();
518 $query['type'] = $this->type
;
519 $query['month'] = $this->mMonth
;
520 $query['year'] = $this->mYear
;
524 public function getFilterParams() {
525 global $wgFilterLogTypes, $wgUser, $wgRequest;
530 foreach( $wgFilterLogTypes as $type => $default ) {
531 // Avoid silly filtering
532 if( $type !== 'patrol' ||
$wgUser->useNPPatrol() ) {
533 $hide = $wgRequest->getInt( "hide_{$type}_log", $default );
534 $filters[$type] = $hide;
536 $this->mConds
[] = 'log_type != ' . $this->mDb
->addQuotes( $type );
543 * Set the log reader to return only entries of the given type.
544 * Type restrictions enforced here
545 * @param $type String: A log type ('upload', 'delete', etc)
547 private function limitType( $type ) {
548 global $wgLogRestrictions, $wgUser;
549 // Don't even show header for private logs; don't recognize it...
550 if( isset($wgLogRestrictions[$type]) && !$wgUser->isAllowed($wgLogRestrictions[$type]) ) {
553 // Don't show private logs to unpriviledged users
554 $hideLogs = LogEventsList
::getExcludeClause( $this->mDb
);
555 if( $hideLogs !== false ) {
556 $this->mConds
[] = $hideLogs;
562 $this->mConds
['log_type'] = $type;
566 * Set the log reader to return only entries by the given user.
567 * @param $name String: (In)valid user name
569 private function limitUser( $name ) {
573 $usertitle = Title
::makeTitleSafe( NS_USER
, $name );
574 if( is_null($usertitle) ) {
577 /* Fetch userid at first, if known, provides awesome query plan afterwards */
578 $userid = User
::idFromName( $name );
580 /* It should be nicer to abort query at all,
581 but for now it won't pass anywhere behind the optimizer */
582 $this->mConds
[] = "NULL";
584 $this->mConds
['log_user'] = $userid;
585 $this->user
= $usertitle->getText();
590 * Set the log reader to return only entries affecting the given page.
591 * (For the block and rights logs, this is a user page.)
592 * @param $page String: Title name as text
593 * @param $pattern String
595 private function limitTitle( $page, $pattern ) {
598 $title = Title
::newFromText( $page );
599 if( strlen($page) == 0 ||
!$title instanceof Title
)
602 $this->title
= $title->getPrefixedText();
603 $ns = $title->getNamespace();
604 # Using the (log_namespace, log_title, log_timestamp) index with a
605 # range scan (LIKE) on the first two parts, instead of simple equality,
606 # makes it unusable for sorting. Sorted retrieval using another index
607 # would be possible, but then we might have to scan arbitrarily many
608 # nodes of that index. Therefore, we need to avoid this if $wgMiserMode
611 # This is not a problem with simple title matches, because then we can
612 # use the page_time index. That should have no more than a few hundred
613 # log entries for even the busiest pages, so it can be safely scanned
614 # in full to satisfy an impossible condition on user or similar.
615 if( $pattern && !$wgMiserMode ) {
616 # use escapeLike to avoid expensive search patterns like 't%st%'
617 $safetitle = $this->mDb
->escapeLike( $title->getDBkey() );
618 $this->mConds
['log_namespace'] = $ns;
619 $this->mConds
[] = "log_title LIKE '$safetitle%'";
620 $this->pattern
= $pattern;
622 $this->mConds
['log_namespace'] = $ns;
623 $this->mConds
['log_title'] = $title->getDBkey();
627 public function getQueryInfo() {
628 $this->mConds
[] = 'user_id = log_user';
629 # Don't use the wrong logging index
630 if( $this->title ||
$this->pattern ||
$this->user
) {
631 $index = array( 'USE INDEX' => array( 'logging' => array('page_time','user_time') ) );
632 } else if( $this->type
) {
633 $index = array( 'USE INDEX' => array( 'logging' => 'type_time' ) );
635 $index = array( 'USE INDEX' => array( 'logging' => 'times' ) );
638 'tables' => array( 'logging', 'user' ),
639 'fields' => array( 'log_type', 'log_action', 'log_user', 'log_namespace', 'log_title', 'log_params',
640 'log_comment', 'log_id', 'log_deleted', 'log_timestamp', 'user_name', 'user_editcount' ),
641 'conds' => $this->mConds
,
646 function getIndexField() {
647 return 'log_timestamp';
650 public function getStartBody() {
651 wfProfileIn( __METHOD__
);
652 # Do a link batch query
653 if( $this->getNumRows() > 0 ) {
655 while( $row = $this->mResult
->fetchObject() ) {
656 $lb->add( $row->log_namespace
, $row->log_title
);
657 $lb->addObj( Title
::makeTitleSafe( NS_USER
, $row->user_name
) );
658 $lb->addObj( Title
::makeTitleSafe( NS_USER_TALK
, $row->user_name
) );
661 $this->mResult
->seek( 0 );
663 wfProfileOut( __METHOD__
);
667 public function formatRow( $row ) {
668 return $this->mLogEventsList
->logLine( $row );
671 public function getType() {
675 public function getUser() {
679 public function getPage() {
683 public function getPattern() {
684 return $this->pattern
;
687 public function getYear() {
691 public function getMonth() {
692 return $this->mMonth
;
698 * @ingroup SpecialPage
703 * @param $request WebRequest: for internal use use a FauxRequest object to pass arbitrary parameters.
705 function __construct( $request ) {
706 global $wgUser, $wgOut;
707 wfDeprecated(__FUNCTION__
);
709 $type = $request->getVal( 'type' );
710 $user = $request->getText( 'user' );
711 $title = $request->getText( 'page' );
712 $pattern = $request->getBool( 'pattern' );
713 $year = $request->getIntOrNull( 'year' );
714 $month = $request->getIntOrNull( 'month' );
715 # Don't let the user get stuck with a certain date
716 $skip = $request->getText( 'offset' ) ||
$request->getText( 'dir' ) == 'prev';
721 # Use new list class to output results
722 $loglist = new LogEventsList( $wgUser->getSkin(), $wgOut, 0 );
723 $this->pager
= new LogPager( $loglist, $type, $user, $title, $pattern, $year, $month );
727 * Is there at least one row?
730 public function hasRows() {
731 return isset($this->pager
) ?
($this->pager
->getNumRows() > 0) : false;
737 * @ingroup SpecialPage
740 const NO_ACTION_LINK
= 1;
748 * @param &$reader LogReader: where to get our data from
749 * @param $flags Integer: Bitwise combination of flags:
750 * LogEventsList::NO_ACTION_LINK Don't show restore/unblock/block links
752 function __construct( &$reader, $flags = 0 ) {
754 wfDeprecated(__FUNCTION__
);
755 $this->reader
=& $reader;
756 $this->reader
->pager
->mLogEventsList
->flags
= $flags;
757 # Aliases for shorter code...
758 $this->pager
=& $this->reader
->pager
;
759 $this->list =& $this->reader
->pager
->mLogEventsList
;
763 * Take over the whole output page in $wgOut with the log display.
765 public function show() {
766 # Set title and add header
767 $this->list->showHeader( $pager->getType() );
769 $this->list->showOptions( $this->pager
->getType(), $this->pager
->getUser(), $this->pager
->getPage(),
770 $this->pager
->getPattern(), $this->pager
->getYear(), $this->pager
->getMonth() );
772 $logBody = $this->pager
->getBody();
775 $this->pager
->getNavigationBar() .
776 $this->list->beginLogEventsList() .
778 $this->list->endLogEventsList() .
779 $this->pager
->getNavigationBar()
782 $wgOut->addWikiMsg( 'logempty' );
787 * Output just the list of entries given by the linked LogReader,
788 * with extraneous UI elements. Use for displaying log fragments in
789 * another page (eg at Special:Undelete)
790 * @param $out OutputPage: where to send output
792 public function showList( &$out ) {
793 $logBody = $this->pager
->getBody();
796 $this->list->beginLogEventsList() .
798 $this->list->endLogEventsList()
801 $out->addWikiMsg( 'logempty' );