Fix disabling of APC cache when loading message files: apc.enabled has been PHP_INI_S...
[lhc/web/wiklou.git] / includes / specials / 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, $wgLogTypes;
30
31 # Get parameters
32 $parms = explode( '/', ($par = ( $par !== null ) ? $par : '' ) );
33 $symsForAll = array( '*', 'all' );
34 if ( $parms[0] != '' && ( in_array( $par, $wgLogTypes ) || in_array( $par, $symsForAll ) ) ) {
35 $type = $par;
36 $user = $wgRequest->getText( 'user' );
37 } else if ( count( $parms ) == 2 ) {
38 $type = $parms[0];
39 $user = $parms[1];
40 } else {
41 $type = $wgRequest->getVal( 'type' );
42 $user = ( $par != '' ) ? $par : $wgRequest->getText( 'user' );
43 }
44 $title = $wgRequest->getText( 'page' );
45 $pattern = $wgRequest->getBool( 'pattern' );
46 $y = $wgRequest->getIntOrNull( 'year' );
47 $m = $wgRequest->getIntOrNull( 'month' );
48 $tagFilter = $wgRequest->getVal( 'tagfilter' );
49 # Don't let the user get stuck with a certain date
50 $skip = $wgRequest->getText( 'offset' ) || $wgRequest->getText( 'dir' ) == 'prev';
51 if( $skip ) {
52 $y = '';
53 $m = '';
54 }
55 # Create a LogPager item to get the results and a LogEventsList item to format them...
56 $loglist = new LogEventsList( $wgUser->getSkin(), $wgOut, 0 );
57 $pager = new LogPager( $loglist, $type, $user, $title, $pattern, array(), $y, $m, $tagFilter );
58 # Set title and add header
59 $loglist->showHeader( $pager->getType() );
60 # Show form options
61 $loglist->showOptions( $pager->getType(), $pager->getUser(), $pager->getPage(), $pager->getPattern(),
62 $pager->getYear(), $pager->getMonth(), $pager->getFilterParams(), $tagFilter );
63 # Insert list
64 $logBody = $pager->getBody();
65 if( $logBody ) {
66 $wgOut->addHTML(
67 $pager->getNavigationBar() .
68 $loglist->beginLogEventsList() .
69 $logBody .
70 $loglist->endLogEventsList() .
71 $pager->getNavigationBar()
72 );
73 } else {
74 $wgOut->addWikiMsg( 'logempty' );
75 }
76 }