Add the other existing $skin.css/.js to the message files too to be consistent
[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 * @file
22 * @ingroup 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 $y = $wgRequest->getIntOrNull( 'year' );
36 $m = $wgRequest->getIntOrNull( 'month' );
37 # Don't let the user get stuck with a certain date
38 $skip = $wgRequest->getText( 'offset' ) || $wgRequest->getText( 'dir' ) == 'prev';
39 if( $skip ) {
40 $y = '';
41 $m = '';
42 }
43 # Create a LogPager item to get the results and a LogEventsList
44 # item to format them...
45 $loglist = new LogEventsList( $wgUser->getSkin(), $wgOut, 0 );
46 $pager = new LogPager( $loglist, $type, $user, $title, $pattern, array(), $y, $m );
47 # Set title and add header
48 $loglist->showHeader( $pager->getType() );
49 # Show form options
50 $loglist->showOptions( $pager->getType(), $pager->getUser(), $pager->getPage(), $pager->getPattern(),
51 $pager->getYear(), $pager->getMonth() );
52 # Insert list
53 $logBody = $pager->getBody();
54 if( $logBody ) {
55 $wgOut->addHTML(
56 $pager->getNavigationBar() .
57 $loglist->beginLogEventsList() .
58 $logBody .
59 $loglist->endLogEventsList() .
60 $pager->getNavigationBar()
61 );
62 } else {
63 $wgOut->addWikiMsg( 'logempty' );
64 }
65 }