* Populate rev_parent_id
[lhc/web/wiklou.git] / includes / SpecialLog.php
1 <?php
2 # Copyright (C) 2008 Aaron Schulz
3 # http://www.mediawiki.org/
4 #
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.
9 #
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.
14 #
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
19
20 /**
21 *
22 * @addtogroup SpecialPage
23 */
24
25 /**
26 * constructor
27 */
28 function wfSpecialLog( $par = '' ) {
29 global $wgRequest, $wgOut, $wgUser;
30 # Get parameters
31 $type = $wgRequest->getVal( 'type', $par );
32 $user = $wgRequest->getText( 'user' );
33 $title = $wgRequest->getText( 'page' );
34 $pattern = $wgRequest->getBool( 'pattern' );
35 # Create a LogPager item to get the results and a LogEventsList
36 # item to format them...
37 $loglist = new LogEventsList( $wgUser->getSkin() );
38 $pager = new LogPager( $loglist, $type, $user, $title, $pattern );
39 # Set title and add header
40 $loglist->showHeader( $wgOut, $pager->getType() );
41 # Show form options
42 $loglist->showOptions( $wgOut, $pager->getType(), $pager->getUser(), $pager->getPage(), $pager->getPattern() );
43 # Insert list
44 $logBody = $pager->getBody();
45 if( $logBody ) {
46 $wgOut->addHTML(
47 $pager->getNavigationBar() .
48 $loglist->beginLogEventsList() .
49 $logBody .
50 $loglist->endLogEventsList() .
51 $pager->getNavigationBar()
52 );
53 } else {
54 $wgOut->addWikiMsg( 'logempty' );
55 }
56 }
57