author | Dan |
Tue, 14 Apr 2009 21:03:25 -0400 | |
changeset 910 | e5de998b934b |
parent 909 | 94c1ff984286 |
child 911 | facff435cdaa |
permissions | -rw-r--r-- |
901
99ea0b0ac4be
Work started on Special:Log and associated tools/interfaces. This is far from complete, but the basic functionality is in there.
Dan
parents:
diff
changeset
|
1 |
<?php |
99ea0b0ac4be
Work started on Special:Log and associated tools/interfaces. This is far from complete, but the basic functionality is in there.
Dan
parents:
diff
changeset
|
2 |
/**!info** |
99ea0b0ac4be
Work started on Special:Log and associated tools/interfaces. This is far from complete, but the basic functionality is in there.
Dan
parents:
diff
changeset
|
3 |
{ |
99ea0b0ac4be
Work started on Special:Log and associated tools/interfaces. This is far from complete, but the basic functionality is in there.
Dan
parents:
diff
changeset
|
4 |
"Plugin Name" : "plugin_speciallog_title", |
99ea0b0ac4be
Work started on Special:Log and associated tools/interfaces. This is far from complete, but the basic functionality is in there.
Dan
parents:
diff
changeset
|
5 |
"Plugin URI" : "http://enanocms.org/", |
99ea0b0ac4be
Work started on Special:Log and associated tools/interfaces. This is far from complete, but the basic functionality is in there.
Dan
parents:
diff
changeset
|
6 |
"Description" : "plugin_speciallog_desc", |
99ea0b0ac4be
Work started on Special:Log and associated tools/interfaces. This is far from complete, but the basic functionality is in there.
Dan
parents:
diff
changeset
|
7 |
"Author" : "Dan Fuhry", |
99ea0b0ac4be
Work started on Special:Log and associated tools/interfaces. This is far from complete, but the basic functionality is in there.
Dan
parents:
diff
changeset
|
8 |
"Version" : "1.1.6", |
99ea0b0ac4be
Work started on Special:Log and associated tools/interfaces. This is far from complete, but the basic functionality is in there.
Dan
parents:
diff
changeset
|
9 |
"Author URI" : "http://enanocms.org/" |
99ea0b0ac4be
Work started on Special:Log and associated tools/interfaces. This is far from complete, but the basic functionality is in there.
Dan
parents:
diff
changeset
|
10 |
} |
99ea0b0ac4be
Work started on Special:Log and associated tools/interfaces. This is far from complete, but the basic functionality is in there.
Dan
parents:
diff
changeset
|
11 |
**!*/ |
99ea0b0ac4be
Work started on Special:Log and associated tools/interfaces. This is far from complete, but the basic functionality is in there.
Dan
parents:
diff
changeset
|
12 |
|
99ea0b0ac4be
Work started on Special:Log and associated tools/interfaces. This is far from complete, but the basic functionality is in there.
Dan
parents:
diff
changeset
|
13 |
/* |
99ea0b0ac4be
Work started on Special:Log and associated tools/interfaces. This is far from complete, but the basic functionality is in there.
Dan
parents:
diff
changeset
|
14 |
* Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between |
99ea0b0ac4be
Work started on Special:Log and associated tools/interfaces. This is far from complete, but the basic functionality is in there.
Dan
parents:
diff
changeset
|
15 |
* Version 1.1.6 (Caoineag beta 1) |
99ea0b0ac4be
Work started on Special:Log and associated tools/interfaces. This is far from complete, but the basic functionality is in there.
Dan
parents:
diff
changeset
|
16 |
* Copyright (C) 2006-2008 Dan Fuhry |
99ea0b0ac4be
Work started on Special:Log and associated tools/interfaces. This is far from complete, but the basic functionality is in there.
Dan
parents:
diff
changeset
|
17 |
* |
99ea0b0ac4be
Work started on Special:Log and associated tools/interfaces. This is far from complete, but the basic functionality is in there.
Dan
parents:
diff
changeset
|
18 |
* This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License |
99ea0b0ac4be
Work started on Special:Log and associated tools/interfaces. This is far from complete, but the basic functionality is in there.
Dan
parents:
diff
changeset
|
19 |
* as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. |
99ea0b0ac4be
Work started on Special:Log and associated tools/interfaces. This is far from complete, but the basic functionality is in there.
Dan
parents:
diff
changeset
|
20 |
* |
99ea0b0ac4be
Work started on Special:Log and associated tools/interfaces. This is far from complete, but the basic functionality is in there.
Dan
parents:
diff
changeset
|
21 |
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied |
99ea0b0ac4be
Work started on Special:Log and associated tools/interfaces. This is far from complete, but the basic functionality is in there.
Dan
parents:
diff
changeset
|
22 |
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. |
99ea0b0ac4be
Work started on Special:Log and associated tools/interfaces. This is far from complete, but the basic functionality is in there.
Dan
parents:
diff
changeset
|
23 |
*/ |
99ea0b0ac4be
Work started on Special:Log and associated tools/interfaces. This is far from complete, but the basic functionality is in there.
Dan
parents:
diff
changeset
|
24 |
|
99ea0b0ac4be
Work started on Special:Log and associated tools/interfaces. This is far from complete, but the basic functionality is in there.
Dan
parents:
diff
changeset
|
25 |
function SpecialLog_paths_init() |
99ea0b0ac4be
Work started on Special:Log and associated tools/interfaces. This is far from complete, but the basic functionality is in there.
Dan
parents:
diff
changeset
|
26 |
{ |
99ea0b0ac4be
Work started on Special:Log and associated tools/interfaces. This is far from complete, but the basic functionality is in there.
Dan
parents:
diff
changeset
|
27 |
global $paths; |
99ea0b0ac4be
Work started on Special:Log and associated tools/interfaces. This is far from complete, but the basic functionality is in there.
Dan
parents:
diff
changeset
|
28 |
$paths->add_page(Array( |
99ea0b0ac4be
Work started on Special:Log and associated tools/interfaces. This is far from complete, but the basic functionality is in there.
Dan
parents:
diff
changeset
|
29 |
'name'=>'specialpage_log', |
99ea0b0ac4be
Work started on Special:Log and associated tools/interfaces. This is far from complete, but the basic functionality is in there.
Dan
parents:
diff
changeset
|
30 |
'urlname'=>'Log', |
99ea0b0ac4be
Work started on Special:Log and associated tools/interfaces. This is far from complete, but the basic functionality is in there.
Dan
parents:
diff
changeset
|
31 |
'namespace'=>'Special', |
99ea0b0ac4be
Work started on Special:Log and associated tools/interfaces. This is far from complete, but the basic functionality is in there.
Dan
parents:
diff
changeset
|
32 |
'special'=>0,'visible'=>1,'comments_on'=>0,'protected'=>1,'delvotes'=>0,'delvote_ips'=>'', |
99ea0b0ac4be
Work started on Special:Log and associated tools/interfaces. This is far from complete, but the basic functionality is in there.
Dan
parents:
diff
changeset
|
33 |
)); |
99ea0b0ac4be
Work started on Special:Log and associated tools/interfaces. This is far from complete, but the basic functionality is in there.
Dan
parents:
diff
changeset
|
34 |
} |
99ea0b0ac4be
Work started on Special:Log and associated tools/interfaces. This is far from complete, but the basic functionality is in there.
Dan
parents:
diff
changeset
|
35 |
|
99ea0b0ac4be
Work started on Special:Log and associated tools/interfaces. This is far from complete, but the basic functionality is in there.
Dan
parents:
diff
changeset
|
36 |
function page_Special_Log() |
99ea0b0ac4be
Work started on Special:Log and associated tools/interfaces. This is far from complete, but the basic functionality is in there.
Dan
parents:
diff
changeset
|
37 |
{ |
99ea0b0ac4be
Work started on Special:Log and associated tools/interfaces. This is far from complete, but the basic functionality is in there.
Dan
parents:
diff
changeset
|
38 |
global $db, $session, $paths, $template, $plugins; // Common objects |
99ea0b0ac4be
Work started on Special:Log and associated tools/interfaces. This is far from complete, but the basic functionality is in there.
Dan
parents:
diff
changeset
|
39 |
global $lang; |
99ea0b0ac4be
Work started on Special:Log and associated tools/interfaces. This is far from complete, but the basic functionality is in there.
Dan
parents:
diff
changeset
|
40 |
global $output; |
99ea0b0ac4be
Work started on Special:Log and associated tools/interfaces. This is far from complete, but the basic functionality is in there.
Dan
parents:
diff
changeset
|
41 |
|
909
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
42 |
// FIXME: This doesn't currently prohibit viewing of aggregate logs that might include a page for which |
910
e5de998b934b
Meh, finished my half-written-out thought in a FIXME in Special:Log code.
Dan
parents:
909
diff
changeset
|
43 |
// we don't have permission to view history. It does, however, block access if a list of pages is given |
e5de998b934b
Meh, finished my half-written-out thought in a FIXME in Special:Log code.
Dan
parents:
909
diff
changeset
|
44 |
// and one of those doesn't allow history_view. |
909
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
45 |
|
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
46 |
// FIXME: This is a real hack. We're trying to get permissions on a random non-existent article, which |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
47 |
// effectively forces calculation to occur based on site-wide permissions. |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
48 |
$pid = ''; |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
49 |
for ( $i = 0; $i < 32; $i++ ) |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
50 |
{ |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
51 |
$pid .= chr(mt_rand(32, 126)); |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
52 |
} |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
53 |
$perms = $session->fetch_page_acl($pid, 'Article'); |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
54 |
$perms_changed = false; |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
55 |
|
901
99ea0b0ac4be
Work started on Special:Log and associated tools/interfaces. This is far from complete, but the basic functionality is in there.
Dan
parents:
diff
changeset
|
56 |
require_once(ENANO_ROOT . '/includes/log.php'); |
99ea0b0ac4be
Work started on Special:Log and associated tools/interfaces. This is far from complete, but the basic functionality is in there.
Dan
parents:
diff
changeset
|
57 |
$log = new LogDisplay(); |
99ea0b0ac4be
Work started on Special:Log and associated tools/interfaces. This is far from complete, but the basic functionality is in there.
Dan
parents:
diff
changeset
|
58 |
$page = 1; |
99ea0b0ac4be
Work started on Special:Log and associated tools/interfaces. This is far from complete, but the basic functionality is in there.
Dan
parents:
diff
changeset
|
59 |
$pagesize = 50; |
909
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
60 |
$fmt = 'full'; |
901
99ea0b0ac4be
Work started on Special:Log and associated tools/interfaces. This is far from complete, but the basic functionality is in there.
Dan
parents:
diff
changeset
|
61 |
|
909
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
62 |
if ( $params = $paths->getAllParams() ) |
901
99ea0b0ac4be
Work started on Special:Log and associated tools/interfaces. This is far from complete, but the basic functionality is in there.
Dan
parents:
diff
changeset
|
63 |
{ |
909
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
64 |
if ( $params === 'AddFilter' && !empty($_POST['type']) && !empty($_POST['value']) ) |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
65 |
{ |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
66 |
$type = $_POST['type']; |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
67 |
if ( $type == 'within' ) |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
68 |
$value = strval(intval($_POST['value']['within'])) . $_POST['value']['withinunits']; |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
69 |
else |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
70 |
$value = $_POST['value'][$type]; |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
71 |
|
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
72 |
$value = str_replace('/', '.2f', sanitize_page_id($value)); |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
73 |
|
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
74 |
if ( empty($value) || ( $type == 'within' && intval($value) == 0 ) ) |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
75 |
{ |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
76 |
$adderror = $lang->get('log_err_addfilter_field_empty'); |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
77 |
} |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
78 |
|
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
79 |
$append = ( !empty($_POST['existing_filters']) ) ? "{$_POST['existing_filters']}/" : ''; |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
80 |
$url = makeUrlNS('Special', "Log/{$append}{$type}={$value}"); |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
81 |
|
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
82 |
redirect($url, '', '', 0); |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
83 |
} |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
84 |
$params = explode('/', $params); |
901
99ea0b0ac4be
Work started on Special:Log and associated tools/interfaces. This is far from complete, but the basic functionality is in there.
Dan
parents:
diff
changeset
|
85 |
foreach ( $params as $param ) |
99ea0b0ac4be
Work started on Special:Log and associated tools/interfaces. This is far from complete, but the basic functionality is in there.
Dan
parents:
diff
changeset
|
86 |
{ |
909
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
87 |
$param = str_replace('.2f', '/', dirtify_page_id($param)); |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
88 |
if ( preg_match('/^([a-z!]+)=(.+?)$/', $param, $match) ) |
901
99ea0b0ac4be
Work started on Special:Log and associated tools/interfaces. This is far from complete, but the basic functionality is in there.
Dan
parents:
diff
changeset
|
89 |
{ |
99ea0b0ac4be
Work started on Special:Log and associated tools/interfaces. This is far from complete, but the basic functionality is in there.
Dan
parents:
diff
changeset
|
90 |
$name =& $match[1]; |
99ea0b0ac4be
Work started on Special:Log and associated tools/interfaces. This is far from complete, but the basic functionality is in there.
Dan
parents:
diff
changeset
|
91 |
$value =& $match[2]; |
99ea0b0ac4be
Work started on Special:Log and associated tools/interfaces. This is far from complete, but the basic functionality is in there.
Dan
parents:
diff
changeset
|
92 |
switch($name) |
99ea0b0ac4be
Work started on Special:Log and associated tools/interfaces. This is far from complete, but the basic functionality is in there.
Dan
parents:
diff
changeset
|
93 |
{ |
99ea0b0ac4be
Work started on Special:Log and associated tools/interfaces. This is far from complete, but the basic functionality is in there.
Dan
parents:
diff
changeset
|
94 |
case 'resultpage': |
99ea0b0ac4be
Work started on Special:Log and associated tools/interfaces. This is far from complete, but the basic functionality is in there.
Dan
parents:
diff
changeset
|
95 |
$page = intval($value); |
99ea0b0ac4be
Work started on Special:Log and associated tools/interfaces. This is far from complete, but the basic functionality is in there.
Dan
parents:
diff
changeset
|
96 |
break; |
99ea0b0ac4be
Work started on Special:Log and associated tools/interfaces. This is far from complete, but the basic functionality is in there.
Dan
parents:
diff
changeset
|
97 |
case 'size': |
99ea0b0ac4be
Work started on Special:Log and associated tools/interfaces. This is far from complete, but the basic functionality is in there.
Dan
parents:
diff
changeset
|
98 |
$pagesize = intval($value); |
99ea0b0ac4be
Work started on Special:Log and associated tools/interfaces. This is far from complete, but the basic functionality is in there.
Dan
parents:
diff
changeset
|
99 |
break; |
909
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
100 |
case 'fmt': |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
101 |
switch($value) |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
102 |
{ |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
103 |
case 'barenaked': |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
104 |
case 'ajax': |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
105 |
$fmt = 'naked'; |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
106 |
$output = new Output_Naked(); |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
107 |
break; |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
108 |
} |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
109 |
break; |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
110 |
case 'page': |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
111 |
if ( get_class($perms) == 'sessionManager' ) |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
112 |
{ |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
113 |
unset($perms); |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
114 |
list($pid, $ns) = RenderMan::strToPageID($value); |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
115 |
$perms = $session->fetch_page_acl($pid, $ns); |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
116 |
if ( !$perms->get_permissions('history_view') ) |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
117 |
{ |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
118 |
die_friendly($lang->get('etc_access_denied_short'), '<p>' . $lang->get('log_err_access_denied') . '</p>'); |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
119 |
} |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
120 |
} |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
121 |
// no break here on purpose |
901
99ea0b0ac4be
Work started on Special:Log and associated tools/interfaces. This is far from complete, but the basic functionality is in there.
Dan
parents:
diff
changeset
|
122 |
default: |
909
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
123 |
try |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
124 |
{ |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
125 |
$log->add_criterion($name, $value); |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
126 |
} |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
127 |
catch ( Exception $e ) |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
128 |
{ |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
129 |
} |
901
99ea0b0ac4be
Work started on Special:Log and associated tools/interfaces. This is far from complete, but the basic functionality is in there.
Dan
parents:
diff
changeset
|
130 |
break; |
99ea0b0ac4be
Work started on Special:Log and associated tools/interfaces. This is far from complete, but the basic functionality is in there.
Dan
parents:
diff
changeset
|
131 |
} |
99ea0b0ac4be
Work started on Special:Log and associated tools/interfaces. This is far from complete, but the basic functionality is in there.
Dan
parents:
diff
changeset
|
132 |
} |
99ea0b0ac4be
Work started on Special:Log and associated tools/interfaces. This is far from complete, but the basic functionality is in there.
Dan
parents:
diff
changeset
|
133 |
} |
99ea0b0ac4be
Work started on Special:Log and associated tools/interfaces. This is far from complete, but the basic functionality is in there.
Dan
parents:
diff
changeset
|
134 |
} |
909
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
135 |
if ( !$perms->get_permissions('history_view') ) |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
136 |
{ |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
137 |
die_friendly($lang->get('etc_access_denied_short'), '<p>' . $lang->get('log_err_access_denied') . '</p>'); |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
138 |
} |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
139 |
|
901
99ea0b0ac4be
Work started on Special:Log and associated tools/interfaces. This is far from complete, but the basic functionality is in there.
Dan
parents:
diff
changeset
|
140 |
$page--; |
99ea0b0ac4be
Work started on Special:Log and associated tools/interfaces. This is far from complete, but the basic functionality is in there.
Dan
parents:
diff
changeset
|
141 |
$rowcount = $log->get_row_count(); |
909
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
142 |
$result_url = makeUrlNS('Special', 'Log/' . rtrim(preg_replace('|/?resultpage=([0-9]+)/?|', '/', $paths->getAllParams()), '/') . '/resultpage=%s', false, true); |
901
99ea0b0ac4be
Work started on Special:Log and associated tools/interfaces. This is far from complete, but the basic functionality is in there.
Dan
parents:
diff
changeset
|
143 |
$paginator = generate_paginator($page, ceil($rowcount / $pagesize), $result_url); |
99ea0b0ac4be
Work started on Special:Log and associated tools/interfaces. This is far from complete, but the basic functionality is in there.
Dan
parents:
diff
changeset
|
144 |
|
99ea0b0ac4be
Work started on Special:Log and associated tools/interfaces. This is far from complete, but the basic functionality is in there.
Dan
parents:
diff
changeset
|
145 |
$dataset = $log->get_data($page * $pagesize, $pagesize); |
99ea0b0ac4be
Work started on Special:Log and associated tools/interfaces. This is far from complete, but the basic functionality is in there.
Dan
parents:
diff
changeset
|
146 |
|
99ea0b0ac4be
Work started on Special:Log and associated tools/interfaces. This is far from complete, but the basic functionality is in there.
Dan
parents:
diff
changeset
|
147 |
$output->header(); |
909
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
148 |
|
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
149 |
// breadcrumbs |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
150 |
if ( $fmt != 'naked' ) |
901
99ea0b0ac4be
Work started on Special:Log and associated tools/interfaces. This is far from complete, but the basic functionality is in there.
Dan
parents:
diff
changeset
|
151 |
{ |
909
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
152 |
echo '<div class="breadcrumbs" style="font-weight: normal;" id="log-breadcrumbs">'; |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
153 |
echo speciallog_generate_breadcrumbs($log->get_criteria()); |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
154 |
echo '</div>'; |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
155 |
|
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
156 |
// form |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
157 |
?> |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
158 |
|
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
159 |
<!-- Begin filter add form --> |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
160 |
|
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
161 |
<form action="<?php echo makeUrlNS('Special', 'Log/AddFilter', false, true); ?>" method="post" enctype="multipart/form-data"> |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
162 |
<?php |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
163 |
// serialize parameters |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
164 |
$params_pre = rtrim(preg_replace('#/?resultpage=[0-9]+/?#', '/', $paths->getAllParams()), '/'); |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
165 |
echo '<input type="hidden" name="existing_filters" value="' . htmlspecialchars($params_pre) . '" />'; |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
166 |
?> |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
167 |
<script type="text/javascript">//<![CDATA[ |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
168 |
addOnloadHook(function() |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
169 |
{ |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
170 |
load_component('jquery'); |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
171 |
$('#log_addfilter_select').change(function() |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
172 |
{ |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
173 |
var value = $(this).val(); |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
174 |
$('.log_addfilter').hide(); |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
175 |
$('#log_addform_' + value).show(); |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
176 |
}); |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
177 |
$('#log_addform_' + $('#log_addfilter_select').val()).show(); |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
178 |
}); |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
179 |
// ]]> |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
180 |
</script> |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
181 |
<?php |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
182 |
if ( isset($adderror) ) |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
183 |
{ |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
184 |
echo '<div class="error-box">' . $adderror . '</div>'; |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
185 |
} |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
186 |
?> |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
187 |
<div class="tblholder"> |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
188 |
<table border="0" cellspacing="1" cellpadding="4"> |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
189 |
<tr> |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
190 |
<th colspan="2"> |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
191 |
<?php echo $lang->get('log_heading_addfilter'); ?> |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
192 |
</th> |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
193 |
</tr> |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
194 |
<tr> |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
195 |
<td class="row1" style="width: 50%; text-align: right;"> |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
196 |
<select name="type" id="log_addfilter_select"> |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
197 |
<option value="user"><?php echo $lang->get('log_form_filtertype_user'); ?></option> |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
198 |
<option value="page"><?php echo $lang->get('log_form_filtertype_page'); ?></option> |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
199 |
<option value="within"><?php echo $lang->get('log_form_filtertype_within'); ?></option> |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
200 |
<option value="action"><?php echo $lang->get('log_form_filtertype_action'); ?></option> |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
201 |
</select> |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
202 |
</td> |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
203 |
<td class="row1" style="width: 50%; text-align: left;"> |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
204 |
<div class="log_addfilter" id="log_addform_user"> |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
205 |
<input type="text" class="autofill username" name="value[user]" size="40" /> |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
206 |
</div> |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
207 |
<div class="log_addfilter" id="log_addform_page"> |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
208 |
<input type="text" class="autofill page" name="value[page]" size="40" /> |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
209 |
</div> |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
210 |
<div class="log_addfilter" id="log_addform_within"> |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
211 |
<input type="text" name="value[within]" size="7" /> |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
212 |
<select name="value[withinunits]"> |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
213 |
<option value="d"><?php echo $lang->get('etc_unit_days'); ?></option> |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
214 |
<option value="w"><?php echo $lang->get('etc_unit_weeks'); ?></option> |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
215 |
<option value="m"><?php echo $lang->get('etc_unit_months'); ?></option> |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
216 |
<option value="y"><?php echo $lang->get('etc_unit_years'); ?></option> |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
217 |
</select> |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
218 |
</div> |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
219 |
<div class="log_addfilter" id="log_addform_action"> |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
220 |
<select name="value[action]"> |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
221 |
<option value="rename"><?php echo $lang->get('log_formaction_rename'); ?></option> |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
222 |
<option value="create"><?php echo $lang->get('log_formaction_create'); ?></option> |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
223 |
<option value="delete"><?php echo $lang->get('log_formaction_delete'); ?></option> |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
224 |
<option value="protect"><?php echo $lang->get('log_action_protect'); ?></option> |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
225 |
<option value="edit"><?php echo $lang->get('log_action_edit'); ?></option> |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
226 |
</select> |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
227 |
</div> |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
228 |
</td> |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
229 |
</tr> |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
230 |
<tr> |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
231 |
<th colspan="2" class="subhead"> |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
232 |
<input type="submit" value="<?php echo $lang->get('log_btn_add_filter'); ?>" /> |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
233 |
</th> |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
234 |
</tr> |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
235 |
</table> |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
236 |
</div> |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
237 |
|
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
238 |
</form> |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
239 |
|
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
240 |
<!-- End filter add form --> |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
241 |
|
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
242 |
<?php |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
243 |
|
901
99ea0b0ac4be
Work started on Special:Log and associated tools/interfaces. This is far from complete, but the basic functionality is in there.
Dan
parents:
diff
changeset
|
244 |
} |
909
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
245 |
|
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
246 |
// start of actual log output area |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
247 |
if ( $fmt != 'naked' ) |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
248 |
{ |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
249 |
echo '<div id="log-body">'; |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
250 |
} |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
251 |
|
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
252 |
if ( $rowcount > 0 ) |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
253 |
{ |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
254 |
// we have some results, show pagination + result list |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
255 |
echo '<h3 style="float: left;">' . $lang->get('log_heading_logdisplay') . '</h3>'; |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
256 |
|
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
257 |
echo $paginator; |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
258 |
// padding |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
259 |
echo '<div style="height: 10px;"></div>'; |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
260 |
foreach ( $dataset as $row ) |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
261 |
{ |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
262 |
echo LogDisplay::render_row($row) . '<br />'; |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
263 |
} |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
264 |
echo $paginator; |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
265 |
} |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
266 |
else |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
267 |
{ |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
268 |
// no results |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
269 |
echo '<h2 class="emptymessage">' . $lang->get('log_msg_no_results') . '</h2>'; |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
270 |
} |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
271 |
|
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
272 |
if ( $fmt != 'naked' ) |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
273 |
echo '</div> <!-- div#log-body -->'; |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
274 |
|
901
99ea0b0ac4be
Work started on Special:Log and associated tools/interfaces. This is far from complete, but the basic functionality is in there.
Dan
parents:
diff
changeset
|
275 |
$output->footer(); |
905
1e40b33f2e3e
Log displayer should support some actions besides edit now
Dan
parents:
901
diff
changeset
|
276 |
} |
1e40b33f2e3e
Log displayer should support some actions besides edit now
Dan
parents:
901
diff
changeset
|
277 |
|
909
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
278 |
function speciallog_generate_breadcrumbs($criteria) |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
279 |
{ |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
280 |
global $db, $session, $paths, $template, $plugins; // Common objects |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
281 |
global $lang; |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
282 |
|
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
283 |
if ( count($criteria) == 0 ) |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
284 |
{ |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
285 |
return $lang->get('log_msg_no_filters'); |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
286 |
} |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
287 |
|
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
288 |
$html = array(); |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
289 |
foreach ( $criteria as $criterion ) |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
290 |
{ |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
291 |
list($type, $value) = $criterion; |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
292 |
switch($type) |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
293 |
{ |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
294 |
case 'user': |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
295 |
$rank_info = $session->get_user_rank($value); |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
296 |
$user_link = '<a href="' . makeUrlNS('User', $value, false, true) . '" style="' . $rank_info['rank_style'] . '" title="' . htmlspecialchars($lang->get($rank_info['rank_title'])) . '">'; |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
297 |
$user_link .= htmlspecialchars(str_replace('_', ' ', $value)) . '</a>'; |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
298 |
|
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
299 |
$crumb = $lang->get('log_breadcrumb_author', array('user' => $user_link)); |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
300 |
break; |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
301 |
case 'page': |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
302 |
$crumb = $lang->get('log_breadcrumb_page', array('page' => '<a href="' . makeUrl($value, false, true) . '">' . htmlspecialchars(get_page_title($value)) . '</a>')); |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
303 |
break; |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
304 |
case 'action': |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
305 |
$crumb = $lang->get('log_breadcrumb_action', array('action' => htmlspecialchars($lang->get("log_action_{$value}")))); |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
306 |
break; |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
307 |
case 'within': |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
308 |
$value = intval($value); |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
309 |
if ( $value % 31536000 == 0 ) |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
310 |
{ |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
311 |
$n = $value / 31536000; |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
312 |
$value = "$n " . $lang->get( $n > 1 ? 'etc_unit_years' : 'etc_unit_year' ); |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
313 |
} |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
314 |
else if ( $value % 2592000 == 0 ) |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
315 |
{ |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
316 |
$n = $value / 2592000; |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
317 |
$value = "$n " . $lang->get( $n > 1 ? 'etc_unit_months' : 'etc_unit_month' ); |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
318 |
} |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
319 |
else if ( $value % 604800 == 0 ) |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
320 |
{ |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
321 |
$n = $value / 604800; |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
322 |
$value = "$n " . $lang->get( $n > 1 ? 'etc_unit_weeks' : 'etc_unit_week' ); |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
323 |
} |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
324 |
else if ( $value % 86400 == 0 ) |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
325 |
{ |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
326 |
$n = $value / 86400; |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
327 |
$value = "$n " . $lang->get( $n > 1 ? 'etc_unit_days' : 'etc_unit_day' ); |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
328 |
} |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
329 |
else |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
330 |
{ |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
331 |
$value = "$value " . $lang->get( $value > 1 ? 'etc_unit_seconds' : 'etc_unit_second' ); |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
332 |
} |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
333 |
$crumb = $lang->get('log_breadcrumb_within', array('time' => $value)); |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
334 |
break; |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
335 |
} |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
336 |
$html[] = $crumb . ' ' . speciallog_crumb_remove_link($criterion); |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
337 |
} |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
338 |
return implode(' » ', $html); |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
339 |
} |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
340 |
|
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
341 |
function speciallog_crumb_remove_link($criterion) |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
342 |
{ |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
343 |
global $db, $session, $paths, $template, $plugins; // Common objects |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
344 |
global $lang; |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
345 |
|
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
346 |
list($type, $value) = $criterion; |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
347 |
|
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
348 |
$params = explode('/', dirtify_page_id($paths->getAllParams())); |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
349 |
foreach ( $params as $i => $param ) |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
350 |
{ |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
351 |
if ( $param === "$type=$value" ) |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
352 |
{ |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
353 |
unset($params[$i]); |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
354 |
break; |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
355 |
} |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
356 |
else if ( $type === 'within' ) |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
357 |
{ |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
358 |
list($ptype, $pvalue) = explode('=', $param); |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
359 |
if ( $ptype !== 'within' ) |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
360 |
continue; |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
361 |
|
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
362 |
$lastchar = substr($pvalue, -1); |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
363 |
$amt = intval($pvalue); |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
364 |
switch($lastchar) |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
365 |
{ |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
366 |
case 'd': |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
367 |
$amt = $amt * 86400; |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
368 |
break; |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
369 |
case 'w': |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
370 |
$amt = $amt * 604800; |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
371 |
break; |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
372 |
case 'm': |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
373 |
$amt = $amt * 2592000; |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
374 |
break; |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
375 |
case 'y': |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
376 |
$amt = $amt * 31536000; |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
377 |
break; |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
378 |
} |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
379 |
if ( $amt === $value ) |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
380 |
{ |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
381 |
unset($params[$i]); |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
382 |
break; |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
383 |
} |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
384 |
} |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
385 |
} |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
386 |
if ( count($params) > 0 ) |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
387 |
{ |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
388 |
$params = implode('/', $params); |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
389 |
$url = makeUrlNS('Special', "Log/$params", false, true); |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
390 |
} |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
391 |
else |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
392 |
{ |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
393 |
$url = makeUrlNS('Special', "Log", false, true); |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
394 |
} |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
395 |
|
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
396 |
return '<sup><a href="' . $url . '">(x)</a></sup>'; |
94c1ff984286
Finished core of log display interface including filter management. There is still a bit of a to-do list, especially regarding rollbacks and reuploads.
Dan
parents:
905
diff
changeset
|
397 |
} |