author | Dan |
Fri, 28 Dec 2007 16:52:03 -0500 | |
changeset 342 | ac34de920762 |
parent 334 | c72b545f1304 |
child 345 | 4ccdfeee9a11 |
permissions | -rw-r--r-- |
75 | 1 |
<?php |
2 |
||
3 |
/* |
|
4 |
* Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between |
|
317 | 5 |
* Version 1.0.3 (Dyrad) |
75 | 6 |
* Copyright (C) 2006-2007 Dan Fuhry |
7 |
* |
|
8 |
* This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License |
|
9 |
* as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. |
|
10 |
* |
|
11 |
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied |
|
12 |
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. |
|
13 |
*/ |
|
14 |
||
15 |
function page_Admin_PageGroups() |
|
16 |
{ |
|
17 |
global $db, $session, $paths, $template, $plugins; // Common objects |
|
18 |
if ( $session->auth_level < USER_LEVEL_ADMIN || $session->user_level < USER_LEVEL_ADMIN ) |
|
19 |
{ |
|
20 |
echo '<h3>Error: Not authenticated</h3><p>It looks like your administration session is invalid or you are not authorized to access this administration page. Please <a href="' . makeUrlNS('Special', 'Login/' . $paths->nslist['Special'] . 'Administration', 'level=' . USER_LEVEL_ADMIN, true) . '">re-authenticate</a> to continue.</p>'; |
|
21 |
return; |
|
22 |
} |
|
23 |
||
24 |
if ( isset($_POST['action']) ) |
|
25 |
{ |
|
26 |
if ( isset($_POST['action']['create']) || isset($_POST['action']['create_stage2']) ) |
|
27 |
{ |
|
28 |
switch ( isset($_POST['action']['create_stage2']) ) |
|
29 |
{ |
|
30 |
case true: |
|
31 |
if ( empty($_POST['pg_name']) || empty($_POST['group_type']) ) |
|
32 |
{ |
|
33 |
echo '<div class="error-box">Please enter a name for the page group.</div>'; |
|
34 |
return; |
|
35 |
} |
|
36 |
if ( $_POST['group_type'] == PAGE_GRP_TAGGED && empty($_POST['member_tag']) ) |
|
37 |
{ |
|
38 |
echo '<div class="error-box">Please enter a page tag.</div>'; |
|
39 |
return; |
|
40 |
} |
|
41 |
if ( $_POST['group_type'] == PAGE_GRP_CATLINK && empty($_POST['member_cat']) ) |
|
42 |
{ |
|
43 |
echo '<div class="error-box">Please create a category page before linking a page group to a category.</div>'; |
|
44 |
return; |
|
45 |
} |
|
46 |
if ( $_POST['group_type'] == PAGE_GRP_NORMAL && empty($_POST['member_page_0']) ) |
|
47 |
{ |
|
48 |
echo '<div class="error-box">Please specify at least one page to place in this group.</div>'; |
|
49 |
return; |
|
50 |
} |
|
156
edbff85d43e8
Feature add: new page group type: regular expression match (PCRE)
Dan
parents:
142
diff
changeset
|
51 |
if ( $_POST['group_type'] == PAGE_GRP_REGEX && empty($_POST['regex']) ) |
edbff85d43e8
Feature add: new page group type: regular expression match (PCRE)
Dan
parents:
142
diff
changeset
|
52 |
{ |
edbff85d43e8
Feature add: new page group type: regular expression match (PCRE)
Dan
parents:
142
diff
changeset
|
53 |
echo '<div class="error-box">Please specify a regular expression to match page IDs against.</div>'; |
edbff85d43e8
Feature add: new page group type: regular expression match (PCRE)
Dan
parents:
142
diff
changeset
|
54 |
return; |
edbff85d43e8
Feature add: new page group type: regular expression match (PCRE)
Dan
parents:
142
diff
changeset
|
55 |
} |
edbff85d43e8
Feature add: new page group type: regular expression match (PCRE)
Dan
parents:
142
diff
changeset
|
56 |
if ( $_POST['group_type'] != PAGE_GRP_TAGGED && $_POST['group_type'] != PAGE_GRP_CATLINK && $_POST['group_type'] != PAGE_GRP_NORMAL && $_POST['group_type'] != PAGE_GRP_REGEX ) |
75 | 57 |
{ |
58 |
echo '<div class="error-box">Umm, you sent an invalid group type. I\'d put a real error message here but this will only be shown if you try to hack the system.</div>'; |
|
59 |
return; |
|
60 |
} |
|
61 |
// All checks passed, create the group |
|
62 |
switch($_POST['group_type']) |
|
63 |
{ |
|
64 |
case PAGE_GRP_TAGGED: |
|
65 |
$name = $db->escape($_POST['pg_name']); |
|
66 |
$tag = $db->escape($_POST['member_tag']); |
|
67 |
$sql = 'INSERT INTO '.table_prefix.'page_groups(pg_type,pg_name,pg_target) VALUES(' . PAGE_GRP_TAGGED . ', \'' . $name . '\', \'' . $tag . '\');'; |
|
68 |
$q = $db->sql_query($sql); |
|
69 |
if ( !$q ) |
|
70 |
$db->_die(); |
|
71 |
break; |
|
72 |
case PAGE_GRP_CATLINK: |
|
73 |
$name = $db->escape($_POST['pg_name']); |
|
74 |
$cat = $db->escape($_POST['member_cat']); |
|
75 |
$sql = 'INSERT INTO '.table_prefix.'page_groups(pg_type,pg_name,pg_target) VALUES(' . PAGE_GRP_CATLINK . ', \'' . $name . '\', \'' . $cat . '\');'; |
|
76 |
$q = $db->sql_query($sql); |
|
77 |
if ( !$q ) |
|
78 |
$db->_die(); |
|
79 |
break; |
|
80 |
case PAGE_GRP_NORMAL: |
|
81 |
$name = $db->escape($_POST['pg_name']); |
|
82 |
$sql = 'INSERT INTO '.table_prefix.'page_groups(pg_type,pg_name) VALUES(' . PAGE_GRP_NORMAL . ', \'' . $name . '\');'; |
|
83 |
$q = $db->sql_query($sql); |
|
84 |
if ( !$q ) |
|
85 |
$db->_die(); |
|
86 |
||
87 |
$ins_id = $db->insert_id(); |
|
88 |
||
89 |
// Page list |
|
90 |
$keys = array_keys($_POST); |
|
91 |
$arr_pages = array(); |
|
92 |
foreach ( $keys as $val ) |
|
93 |
{ |
|
94 |
if ( preg_match('/^member_page_([0-9]+?)$/', $val) && !empty($_POST[$val]) && isPage($_POST[$val]) ) |
|
95 |
{ |
|
96 |
$arr_pages[] = $_POST[$val]; |
|
97 |
} |
|
98 |
} |
|
99 |
$arr_sql = array(); |
|
100 |
foreach ( $arr_pages as $page ) |
|
101 |
{ |
|
102 |
list($id, $ns) = RenderMan::strToPageID($page); |
|
103 |
$id = sanitize_page_id($id); |
|
104 |
$arr_sql[] = '(' . $ins_id . ',\'' . $db->escape($id) . '\', \'' . $ns . '\')'; |
|
105 |
} |
|
106 |
$sql = 'INSERT INTO '.table_prefix.'page_group_members(pg_id,page_id,namespace) VALUES' . implode(',', $arr_sql) . ';'; |
|
107 |
$q = $db->sql_query($sql); |
|
108 |
if ( !$q ) |
|
109 |
$db->_die(); |
|
110 |
break; |
|
156
edbff85d43e8
Feature add: new page group type: regular expression match (PCRE)
Dan
parents:
142
diff
changeset
|
111 |
case PAGE_GRP_REGEX: |
edbff85d43e8
Feature add: new page group type: regular expression match (PCRE)
Dan
parents:
142
diff
changeset
|
112 |
$name = $db->escape($_POST['pg_name']); |
edbff85d43e8
Feature add: new page group type: regular expression match (PCRE)
Dan
parents:
142
diff
changeset
|
113 |
$regex = $db->escape($_POST['regex']); |
edbff85d43e8
Feature add: new page group type: regular expression match (PCRE)
Dan
parents:
142
diff
changeset
|
114 |
$sql = 'INSERT INTO '.table_prefix.'page_groups(pg_type,pg_name,pg_target) VALUES(' . PAGE_GRP_REGEX . ', \'' . $name . '\', \'' . $regex . '\');'; |
edbff85d43e8
Feature add: new page group type: regular expression match (PCRE)
Dan
parents:
142
diff
changeset
|
115 |
$q = $db->sql_query($sql); |
edbff85d43e8
Feature add: new page group type: regular expression match (PCRE)
Dan
parents:
142
diff
changeset
|
116 |
if ( !$q ) |
edbff85d43e8
Feature add: new page group type: regular expression match (PCRE)
Dan
parents:
142
diff
changeset
|
117 |
$db->_die(); |
edbff85d43e8
Feature add: new page group type: regular expression match (PCRE)
Dan
parents:
142
diff
changeset
|
118 |
break; |
75 | 119 |
} |
120 |
echo '<div class="info-box">The page group "' . htmlspecialchars($_POST['pg_name']) . '" has been created.</div>'; |
|
121 |
break; |
|
122 |
} |
|
123 |
// A little Javascript magic |
|
124 |
?> |
|
125 |
<script language="javascript" type="text/javascript"> |
|
126 |
function pg_create_typeset(selector) |
|
127 |
{ |
|
128 |
var pg_normal = <?php echo PAGE_GRP_NORMAL; ?>; |
|
129 |
var pg_tagged = <?php echo PAGE_GRP_TAGGED; ?>; |
|
130 |
var pg_catlink = <?php echo PAGE_GRP_CATLINK; ?>; |
|
156
edbff85d43e8
Feature add: new page group type: regular expression match (PCRE)
Dan
parents:
142
diff
changeset
|
131 |
var pg_regex = <?php echo PAGE_GRP_REGEX; ?>; |
75 | 132 |
var selection = false; |
133 |
// Get selection |
|
134 |
for ( var i = 0; i < selector.childNodes.length; i++ ) |
|
135 |
{ |
|
136 |
var child = selector.childNodes[i]; |
|
137 |
if ( !child || child.tagName != 'OPTION' ) |
|
138 |
{ |
|
139 |
continue; |
|
140 |
} |
|
141 |
if ( child.selected ) |
|
142 |
{ |
|
143 |
selection = child.value; |
|
144 |
} |
|
145 |
} |
|
146 |
if ( !selection ) |
|
147 |
{ |
|
148 |
alert('Cannot get field value'); |
|
149 |
return true; |
|
150 |
} |
|
151 |
selection = parseInt(selection); |
|
156
edbff85d43e8
Feature add: new page group type: regular expression match (PCRE)
Dan
parents:
142
diff
changeset
|
152 |
if ( selection != pg_normal && selection != pg_tagged && selection != pg_catlink && selection != pg_regex ) |
75 | 153 |
{ |
154 |
alert('Invalid field value'); |
|
155 |
return true; |
|
156 |
} |
|
157 |
||
158 |
// We have the selection and it's validated; show the appropriate field group |
|
159 |
||
160 |
if ( selection == pg_normal ) |
|
161 |
{ |
|
162 |
document.getElementById('pg_create_title_catlink').style.display = 'none'; |
|
163 |
document.getElementById('pg_create_catlink_1').style.display = 'none'; |
|
164 |
document.getElementById('pg_create_catlink_2').style.display = 'none'; |
|
165 |
||
166 |
document.getElementById('pg_create_title_tagged').style.display = 'none'; |
|
167 |
document.getElementById('pg_create_tagged_1').style.display = 'none'; |
|
168 |
document.getElementById('pg_create_tagged_2').style.display = 'none'; |
|
169 |
||
170 |
document.getElementById('pg_create_title_normal').style.display = 'inline'; |
|
171 |
document.getElementById('pg_create_normal_1').style.display = 'block'; |
|
172 |
document.getElementById('pg_create_normal_2').style.display = 'block'; |
|
156
edbff85d43e8
Feature add: new page group type: regular expression match (PCRE)
Dan
parents:
142
diff
changeset
|
173 |
|
edbff85d43e8
Feature add: new page group type: regular expression match (PCRE)
Dan
parents:
142
diff
changeset
|
174 |
document.getElementById('pg_create_title_regex').style.display = 'none'; |
edbff85d43e8
Feature add: new page group type: regular expression match (PCRE)
Dan
parents:
142
diff
changeset
|
175 |
document.getElementById('pg_create_regex_1').style.display = 'none'; |
edbff85d43e8
Feature add: new page group type: regular expression match (PCRE)
Dan
parents:
142
diff
changeset
|
176 |
document.getElementById('pg_create_regex_2').style.display = 'none'; |
75 | 177 |
} |
178 |
else if ( selection == pg_catlink ) |
|
179 |
{ |
|
180 |
document.getElementById('pg_create_title_catlink').style.display = 'inline'; |
|
181 |
document.getElementById('pg_create_catlink_1').style.display = 'block'; |
|
182 |
document.getElementById('pg_create_catlink_2').style.display = 'block'; |
|
183 |
||
184 |
document.getElementById('pg_create_title_tagged').style.display = 'none'; |
|
185 |
document.getElementById('pg_create_tagged_1').style.display = 'none'; |
|
186 |
document.getElementById('pg_create_tagged_2').style.display = 'none'; |
|
187 |
||
188 |
document.getElementById('pg_create_title_normal').style.display = 'none'; |
|
189 |
document.getElementById('pg_create_normal_1').style.display = 'none'; |
|
190 |
document.getElementById('pg_create_normal_2').style.display = 'none'; |
|
156
edbff85d43e8
Feature add: new page group type: regular expression match (PCRE)
Dan
parents:
142
diff
changeset
|
191 |
|
edbff85d43e8
Feature add: new page group type: regular expression match (PCRE)
Dan
parents:
142
diff
changeset
|
192 |
document.getElementById('pg_create_title_regex').style.display = 'none'; |
edbff85d43e8
Feature add: new page group type: regular expression match (PCRE)
Dan
parents:
142
diff
changeset
|
193 |
document.getElementById('pg_create_regex_1').style.display = 'none'; |
edbff85d43e8
Feature add: new page group type: regular expression match (PCRE)
Dan
parents:
142
diff
changeset
|
194 |
document.getElementById('pg_create_regex_2').style.display = 'none'; |
75 | 195 |
} |
196 |
else if ( selection == pg_tagged ) |
|
197 |
{ |
|
198 |
document.getElementById('pg_create_title_catlink').style.display = 'none'; |
|
199 |
document.getElementById('pg_create_catlink_1').style.display = 'none'; |
|
200 |
document.getElementById('pg_create_catlink_2').style.display = 'none'; |
|
201 |
||
202 |
document.getElementById('pg_create_title_tagged').style.display = 'inline'; |
|
203 |
document.getElementById('pg_create_tagged_1').style.display = 'block'; |
|
204 |
document.getElementById('pg_create_tagged_2').style.display = 'block'; |
|
205 |
||
206 |
document.getElementById('pg_create_title_normal').style.display = 'none'; |
|
207 |
document.getElementById('pg_create_normal_1').style.display = 'none'; |
|
208 |
document.getElementById('pg_create_normal_2').style.display = 'none'; |
|
156
edbff85d43e8
Feature add: new page group type: regular expression match (PCRE)
Dan
parents:
142
diff
changeset
|
209 |
|
edbff85d43e8
Feature add: new page group type: regular expression match (PCRE)
Dan
parents:
142
diff
changeset
|
210 |
document.getElementById('pg_create_title_regex').style.display = 'none'; |
edbff85d43e8
Feature add: new page group type: regular expression match (PCRE)
Dan
parents:
142
diff
changeset
|
211 |
document.getElementById('pg_create_regex_1').style.display = 'none'; |
edbff85d43e8
Feature add: new page group type: regular expression match (PCRE)
Dan
parents:
142
diff
changeset
|
212 |
document.getElementById('pg_create_regex_2').style.display = 'none'; |
edbff85d43e8
Feature add: new page group type: regular expression match (PCRE)
Dan
parents:
142
diff
changeset
|
213 |
} |
edbff85d43e8
Feature add: new page group type: regular expression match (PCRE)
Dan
parents:
142
diff
changeset
|
214 |
else if ( selection == pg_regex ) |
edbff85d43e8
Feature add: new page group type: regular expression match (PCRE)
Dan
parents:
142
diff
changeset
|
215 |
{ |
edbff85d43e8
Feature add: new page group type: regular expression match (PCRE)
Dan
parents:
142
diff
changeset
|
216 |
document.getElementById('pg_create_title_catlink').style.display = 'none'; |
edbff85d43e8
Feature add: new page group type: regular expression match (PCRE)
Dan
parents:
142
diff
changeset
|
217 |
document.getElementById('pg_create_catlink_1').style.display = 'none'; |
edbff85d43e8
Feature add: new page group type: regular expression match (PCRE)
Dan
parents:
142
diff
changeset
|
218 |
document.getElementById('pg_create_catlink_2').style.display = 'none'; |
edbff85d43e8
Feature add: new page group type: regular expression match (PCRE)
Dan
parents:
142
diff
changeset
|
219 |
|
edbff85d43e8
Feature add: new page group type: regular expression match (PCRE)
Dan
parents:
142
diff
changeset
|
220 |
document.getElementById('pg_create_title_tagged').style.display = 'none'; |
edbff85d43e8
Feature add: new page group type: regular expression match (PCRE)
Dan
parents:
142
diff
changeset
|
221 |
document.getElementById('pg_create_tagged_1').style.display = 'none'; |
edbff85d43e8
Feature add: new page group type: regular expression match (PCRE)
Dan
parents:
142
diff
changeset
|
222 |
document.getElementById('pg_create_tagged_2').style.display = 'none'; |
edbff85d43e8
Feature add: new page group type: regular expression match (PCRE)
Dan
parents:
142
diff
changeset
|
223 |
|
edbff85d43e8
Feature add: new page group type: regular expression match (PCRE)
Dan
parents:
142
diff
changeset
|
224 |
document.getElementById('pg_create_title_normal').style.display = 'none'; |
edbff85d43e8
Feature add: new page group type: regular expression match (PCRE)
Dan
parents:
142
diff
changeset
|
225 |
document.getElementById('pg_create_normal_1').style.display = 'none'; |
edbff85d43e8
Feature add: new page group type: regular expression match (PCRE)
Dan
parents:
142
diff
changeset
|
226 |
document.getElementById('pg_create_normal_2').style.display = 'none'; |
edbff85d43e8
Feature add: new page group type: regular expression match (PCRE)
Dan
parents:
142
diff
changeset
|
227 |
|
edbff85d43e8
Feature add: new page group type: regular expression match (PCRE)
Dan
parents:
142
diff
changeset
|
228 |
document.getElementById('pg_create_title_regex').style.display = 'inline'; |
edbff85d43e8
Feature add: new page group type: regular expression match (PCRE)
Dan
parents:
142
diff
changeset
|
229 |
document.getElementById('pg_create_regex_1').style.display = 'block'; |
edbff85d43e8
Feature add: new page group type: regular expression match (PCRE)
Dan
parents:
142
diff
changeset
|
230 |
document.getElementById('pg_create_regex_2').style.display = 'block'; |
75 | 231 |
} |
232 |
||
233 |
} |
|
234 |
||
235 |
// Set to pg_normal on page load |
|
236 |
var pg_createform_init = function() |
|
237 |
{ |
|
238 |
document.getElementById('pg_create_title_catlink').style.display = 'none'; |
|
239 |
document.getElementById('pg_create_catlink_1').style.display = 'none'; |
|
240 |
document.getElementById('pg_create_catlink_2').style.display = 'none'; |
|
241 |
||
242 |
document.getElementById('pg_create_title_tagged').style.display = 'none'; |
|
243 |
document.getElementById('pg_create_tagged_1').style.display = 'none'; |
|
244 |
document.getElementById('pg_create_tagged_2').style.display = 'none'; |
|
245 |
||
156
edbff85d43e8
Feature add: new page group type: regular expression match (PCRE)
Dan
parents:
142
diff
changeset
|
246 |
document.getElementById('pg_create_title_regex').style.display = 'none'; |
edbff85d43e8
Feature add: new page group type: regular expression match (PCRE)
Dan
parents:
142
diff
changeset
|
247 |
document.getElementById('pg_create_regex_1').style.display = 'none'; |
edbff85d43e8
Feature add: new page group type: regular expression match (PCRE)
Dan
parents:
142
diff
changeset
|
248 |
document.getElementById('pg_create_regex_2').style.display = 'none'; |
edbff85d43e8
Feature add: new page group type: regular expression match (PCRE)
Dan
parents:
142
diff
changeset
|
249 |
|
75 | 250 |
document.getElementById('pg_create_title_normal').style.display = 'inline'; |
251 |
document.getElementById('pg_create_normal_1').style.display = 'block'; |
|
252 |
document.getElementById('pg_create_normal_2').style.display = 'block'; |
|
253 |
} |
|
254 |
||
255 |
addOnloadHook(pg_createform_init); |
|
256 |
||
257 |
function pg_create_more_fields() |
|
258 |
{ |
|
259 |
var targettd = document.getElementById('pg_create_normal_2'); |
|
260 |
var id = 0; |
|
261 |
for ( var i = 0; i < targettd.childNodes.length; i++ ) |
|
262 |
{ |
|
263 |
var child = targettd.childNodes[i]; |
|
264 |
if ( child.tagName == 'INPUT' ) |
|
265 |
{ |
|
266 |
if ( child.type == 'button' ) |
|
267 |
{ |
|
268 |
var newInp = document.createElement('input'); |
|
269 |
// <input type="text" name="member_page_1" id="pg_create_member_1" onkeyup="return ajaxPageNameComplete(this);" size="30" /><br /> |
|
270 |
newInp.type = 'text'; |
|
271 |
newInp.name = 'member_page_' + id; |
|
272 |
newInp.id = 'pg_create_member_' + id; |
|
273 |
newInp.onkeyup = function(e) { return ajaxPageNameComplete(this); }; |
|
274 |
newInp.size = '30'; |
|
275 |
newInp.style.marginTop = '3px'; |
|
276 |
targettd.insertBefore(newInp, child); |
|
277 |
targettd.insertBefore(document.createElement('br'), child); |
|
278 |
break; |
|
279 |
} |
|
280 |
else // if ( child.type == 'text' ) |
|
281 |
{ |
|
282 |
id++; |
|
283 |
} |
|
284 |
} |
|
285 |
} |
|
286 |
} |
|
287 |
||
288 |
</script> |
|
289 |
<?php |
|
290 |
||
291 |
// Build category list |
|
292 |
$q = $db->sql_query('SELECT name,urlname FROM '.table_prefix.'pages WHERE namespace=\'Category\';'); |
|
293 |
if ( !$q ) |
|
294 |
$db->_die(); |
|
295 |
||
296 |
if ( $db->numrows() < 1 ) |
|
297 |
{ |
|
298 |
$catlist = 'There aren\'t any categories on this site.'; |
|
299 |
} |
|
300 |
else |
|
301 |
{ |
|
302 |
$catlist = '<select name="member_cat">'; |
|
303 |
while ( $row = $db->fetchrow() ) |
|
304 |
{ |
|
305 |
$catlist .= '<option value="' . htmlspecialchars($row['urlname']) . '">' . htmlspecialchars($row['name']) . '</option>'; |
|
306 |
} |
|
307 |
$catlist .= '</select>'; |
|
308 |
} |
|
309 |
||
117
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
81
diff
changeset
|
310 |
echo '<script type="text/javascript"> |
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
81
diff
changeset
|
311 |
var __pg_edit_submitAuthorized = true; |
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
81
diff
changeset
|
312 |
</script>'; |
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
81
diff
changeset
|
313 |
|
75 | 314 |
echo '<form action="'.makeUrl($paths->nslist['Special'].'Administration', 'module='.$paths->cpage['module']).'" method="post" onsubmit="if(!submitAuthorized || !__pg_edit_submitAuthorized) return false;" enctype="multipart/form-data">'; |
315 |
||
316 |
echo '<div class="tblholder"> |
|
317 |
<table border="0" cellspacing="1" cellpadding="4"> |
|
318 |
<tr> |
|
319 |
<th colspan="2">Create page group</th> |
|
320 |
</tr>'; |
|
321 |
||
322 |
// Name |
|
323 |
echo '<tr> |
|
324 |
<td class="row2"> |
|
325 |
Group name:<br /> |
|
326 |
<small>This should be short, descriptive, and human-readable.</small> |
|
327 |
</td> |
|
328 |
<td class="row1"> |
|
329 |
<input type="text" name="pg_name" size="30" /> |
|
330 |
</td> |
|
331 |
</tr>'; |
|
332 |
||
333 |
// Group type |
|
334 |
echo '<tr> |
|
335 |
<td class="row2"> |
|
336 |
Group type: |
|
337 |
</td> |
|
338 |
<td class="row1"> |
|
339 |
<select name="group_type" onchange="pg_create_typeset(this);"> |
|
340 |
<option value="' . PAGE_GRP_NORMAL . '" selected="selected">Static group of pages</option> |
|
341 |
<option value="' . PAGE_GRP_TAGGED . '">Group of pages with one tag</option> |
|
342 |
<option value="' . PAGE_GRP_CATLINK . '">Link to category</option> |
|
156
edbff85d43e8
Feature add: new page group type: regular expression match (PCRE)
Dan
parents:
142
diff
changeset
|
343 |
<option value="' . PAGE_GRP_REGEX . '">Perl-compatible regular expression (advanced)</option> |
75 | 344 |
</select> |
345 |
</td> |
|
346 |
</tr>'; |
|
347 |
||
348 |
// Titles |
|
349 |
echo '<tr> |
|
350 |
<th colspan="2"> |
|
351 |
<span id="pg_create_title_normal"> |
|
352 |
Static group of pages |
|
353 |
</span> |
|
354 |
<span id="pg_create_title_tagged"> |
|
355 |
Group of commonly tagged pages |
|
356 |
</span> |
|
357 |
<span id="pg_create_title_catlink"> |
|
358 |
Mirror a category |
|
359 |
</span> |
|
156
edbff85d43e8
Feature add: new page group type: regular expression match (PCRE)
Dan
parents:
142
diff
changeset
|
360 |
<span id="pg_create_title_regex"> |
edbff85d43e8
Feature add: new page group type: regular expression match (PCRE)
Dan
parents:
142
diff
changeset
|
361 |
Filter through a regular expression |
edbff85d43e8
Feature add: new page group type: regular expression match (PCRE)
Dan
parents:
142
diff
changeset
|
362 |
</span> |
75 | 363 |
</th> |
364 |
</tr>'; |
|
365 |
||
366 |
echo '<tr> |
|
367 |
<td class="row2"> |
|
368 |
<div id="pg_create_normal_1"> |
|
369 |
Member pages:<br /> |
|
370 |
<small>Click the "plus" button to add more fields.</small> |
|
371 |
</div> |
|
372 |
<div id="pg_create_catlink_1"> |
|
373 |
Include pages in this category:<br /> |
|
374 |
<small>Pages in subcategories are <u>not</u> included, however subcategory pages themselves are.</small> |
|
375 |
</div> |
|
376 |
<div id="pg_create_tagged_1"> |
|
377 |
Include pages with this tag: |
|
378 |
</div> |
|
156
edbff85d43e8
Feature add: new page group type: regular expression match (PCRE)
Dan
parents:
142
diff
changeset
|
379 |
<div id="pg_create_regex_1"> |
edbff85d43e8
Feature add: new page group type: regular expression match (PCRE)
Dan
parents:
142
diff
changeset
|
380 |
Regular expression:<br /> |
edbff85d43e8
Feature add: new page group type: regular expression match (PCRE)
Dan
parents:
142
diff
changeset
|
381 |
<small>Be sure to include the starting and ending delimiters and any flags you might need.<br /> |
edbff85d43e8
Feature add: new page group type: regular expression match (PCRE)
Dan
parents:
142
diff
changeset
|
382 |
These pages might help: <a href="http://us.php.net/manual/en/reference.pcre.pattern.modifiers.php">Pattern modifiers</a> • |
edbff85d43e8
Feature add: new page group type: regular expression match (PCRE)
Dan
parents:
142
diff
changeset
|
383 |
<a href="http://us.php.net/manual/en/reference.pcre.pattern.syntax.php">Pattern syntax</a><br /> |
edbff85d43e8
Feature add: new page group type: regular expression match (PCRE)
Dan
parents:
142
diff
changeset
|
384 |
Examples: <tt>/^(Special|Admin):/i</tt> • <tt>/^Image:([0-9]+)$/</tt><br /> |
edbff85d43e8
Feature add: new page group type: regular expression match (PCRE)
Dan
parents:
142
diff
changeset
|
385 |
Developers, remember that this will be matched against the full page identifier string. This means that <tt>/^About_Enano$/</tt> |
edbff85d43e8
Feature add: new page group type: regular expression match (PCRE)
Dan
parents:
142
diff
changeset
|
386 |
will NOT match the page Special:About_Enano.</small> |
75 | 387 |
</td>'; |
388 |
||
389 |
echo ' <td class="row1"> |
|
390 |
<div id="pg_create_normal_2" /> |
|
391 |
<input type="text" style="margin-top: 3px;" name="member_page_0" id="pg_create_member_0" onkeyup="return ajaxPageNameComplete(this);" size="30" /><br /> |
|
392 |
<input type="text" style="margin-top: 3px;" name="member_page_1" id="pg_create_member_1" onkeyup="return ajaxPageNameComplete(this);" size="30" /><br /> |
|
393 |
<input type="text" style="margin-top: 3px;" name="member_page_2" id="pg_create_member_2" onkeyup="return ajaxPageNameComplete(this);" size="30" /><br /> |
|
394 |
<input type="text" style="margin-top: 3px;" name="member_page_3" id="pg_create_member_3" onkeyup="return ajaxPageNameComplete(this);" size="30" /><br /> |
|
395 |
<input type="text" style="margin-top: 3px;" name="member_page_4" id="pg_create_member_4" onkeyup="return ajaxPageNameComplete(this);" size="30" /><br /> |
|
396 |
<input type="button" onclick="pg_create_more_fields(); return false;" style="margin-top: 5px;" value=" + " /> |
|
397 |
</div> |
|
398 |
<div id="pg_create_tagged_2"> |
|
399 |
<input type="text" name="member_tag" size="30" /> |
|
400 |
</div> |
|
401 |
<div id="pg_create_catlink_2"> |
|
402 |
' . $catlist . ' |
|
403 |
</div> |
|
156
edbff85d43e8
Feature add: new page group type: regular expression match (PCRE)
Dan
parents:
142
diff
changeset
|
404 |
<div id="pg_create_regex_2"> |
edbff85d43e8
Feature add: new page group type: regular expression match (PCRE)
Dan
parents:
142
diff
changeset
|
405 |
<input type="text" name="regex" size="60" /> |
edbff85d43e8
Feature add: new page group type: regular expression match (PCRE)
Dan
parents:
142
diff
changeset
|
406 |
</div> |
75 | 407 |
</td> |
408 |
</tr>'; |
|
409 |
||
410 |
// Submit button |
|
411 |
echo '<tr> |
|
412 |
<th class="subhead" colspan="2"><input type="submit" name="action[create_stage2]" value="Create page group" style="font-weight: bold;" /> <input type="submit" name="action[noop]" value="Cancel" style="font-weight: normal;" /></th> |
|
413 |
</tr>'; |
|
414 |
||
415 |
echo '</table> |
|
416 |
</div>'; |
|
417 |
||
418 |
echo '</form>'; |
|
419 |
return; |
|
420 |
} |
|
421 |
else if ( isset($_POST['action']['del']) ) |
|
422 |
{ |
|
423 |
// Confirmation to delete a group (this is really only a stub) |
|
424 |
||
425 |
$delete_id = array_keys($_POST['action']['del']); |
|
426 |
$delete_id = intval($delete_id[0]); |
|
427 |
||
428 |
if ( !empty($delete_id) ) |
|
429 |
{ |
|
430 |
echo '<form action="'.makeUrl($paths->nslist['Special'].'Administration', 'module='.$paths->cpage['module']).'" method="post" onsubmit="if(!submitAuthorized) return false;" enctype="multipart/form-data">'; |
|
431 |
echo '<input type="hidden" name="delete_id" value="' . $delete_id . '" />'; |
|
432 |
echo '<div class="tblholder">'; |
|
433 |
echo ' <table border="0" cellspacing="1" cellpadding="4">'; |
|
434 |
echo ' <tr><th>Confirm deletion</th></tr>'; |
|
435 |
echo ' <tr><td class="row2" style="text-align: center; padding: 20px 0;">Are you sure you want to delete this page group?</td></tr>'; |
|
436 |
echo ' <tr><td class="row1" style="text-align: center;">'; |
|
437 |
echo ' <input type="submit" name="action[del_confirm]" value="Yes, delete group" style="font-weight: bold;" />'; |
|
438 |
echo ' <input type="submit" name="action[noop]" value="Cancel" style="font-weight: normal;" />'; |
|
439 |
echo ' </td></tr>'; |
|
440 |
echo ' </table>'; |
|
441 |
echo '</form>'; |
|
442 |
||
443 |
return; |
|
444 |
} |
|
445 |
} |
|
446 |
else if ( isset($_POST['action']['del_confirm']) ) |
|
447 |
{ |
|
448 |
$delete_id = intval($_POST['delete_id']); |
|
449 |
if ( empty($delete_id) ) |
|
450 |
{ |
|
451 |
echo 'Hack attempt'; |
|
452 |
return; |
|
453 |
} |
|
454 |
// Obtain group name |
|
455 |
$q = $db->sql_query('SELECT pg_name FROM '.table_prefix.'page_groups WHERE pg_id=' . $delete_id . ';'); |
|
456 |
if ( !$q ) |
|
457 |
$db->_die(); |
|
458 |
if ( $db->numrows() < 1 ) |
|
459 |
{ |
|
460 |
echo 'Page group dun exist.'; |
|
461 |
return; |
|
462 |
} |
|
463 |
$row = $db->fetchrow(); |
|
464 |
$db->free_result(); |
|
465 |
$pg_name = $row['pg_name']; |
|
466 |
unset($row); |
|
467 |
// Delete the group |
|
468 |
$q = $db->sql_query('DELETE FROM '.table_prefix.'page_groups WHERE pg_id=' . $delete_id . ';'); |
|
469 |
if ( !$q ) |
|
470 |
$db->_die(); |
|
471 |
$q = $db->sql_query('DELETE FROM '.table_prefix.'page_group_members WHERE pg_id=' . $delete_id . ';'); |
|
472 |
if ( !$q ) |
|
473 |
$db->_die(); |
|
81
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
474 |
echo "<div class='info-box'>The group ".'"'.htmlspecialchars("$pg_name").'"'." has been deleted.</div>"; |
75 | 475 |
} |
476 |
else if ( isset($_POST['action']['edit']) && !isset($_POST['action']['noop']) ) |
|
477 |
{ |
|
478 |
if ( isset($_POST['action']['edit_save']) ) |
|
479 |
{ |
|
480 |
} |
|
481 |
||
482 |
if ( isset($_POST['action']['edit']['add_page']) && isset($_GET['src']) && $_GET['src'] == 'ajax' ) |
|
483 |
{ |
|
484 |
$return = array('successful' => false); |
|
485 |
||
486 |
// |
|
487 |
// Add the specified page to the group |
|
488 |
// |
|
489 |
||
490 |
// Get ID of the group |
|
491 |
$edit_id = intval($_POST['pg_id']); |
|
492 |
if ( !$edit_id ) |
|
493 |
{ |
|
494 |
$return = array('mode' => 'error', 'text' => 'Hack attempt'); |
|
334
c72b545f1304
More localization work. Resolved major issue with JSON parser not parsing files over ~50KB. Switched JSON parser to the one from the Zend Framework (BSD licensed). Forced to split enano.json into five different files.
Dan
parents:
326
diff
changeset
|
495 |
echo enano_json_encode($return); |
75 | 496 |
return; |
497 |
} |
|
498 |
||
499 |
// Run some validation - check that page exists and that it's not already in the group |
|
500 |
$page = $_POST['new_page']; |
|
501 |
if ( empty($page) ) |
|
502 |
{ |
|
503 |
$return = array('mode' => 'error', 'text' => 'Please enter a page title.'); |
|
334
c72b545f1304
More localization work. Resolved major issue with JSON parser not parsing files over ~50KB. Switched JSON parser to the one from the Zend Framework (BSD licensed). Forced to split enano.json into five different files.
Dan
parents:
326
diff
changeset
|
504 |
echo enano_json_encode($return); |
75 | 505 |
return; |
506 |
} |
|
507 |
||
81
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
508 |
/* |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
509 |
// We're gonna allow adding nonexistent pages for now |
75 | 510 |
if ( !isPage($page) ) |
511 |
{ |
|
512 |
$return = array('mode' => 'error', 'text' => 'The page you are trying to add (' . htmlspecialchars($page) . ') does not exist.'); |
|
334
c72b545f1304
More localization work. Resolved major issue with JSON parser not parsing files over ~50KB. Switched JSON parser to the one from the Zend Framework (BSD licensed). Forced to split enano.json into five different files.
Dan
parents:
326
diff
changeset
|
513 |
echo enano_json_encode($return); |
75 | 514 |
return; |
515 |
} |
|
81
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
516 |
*/ |
75 | 517 |
|
518 |
list($page_id, $namespace) = RenderMan::strToPageID($page); |
|
519 |
$page_id = sanitize_page_id($page_id); |
|
520 |
||
81
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
521 |
if ( !isset($paths->namespace[$namespace]) ) |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
522 |
{ |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
523 |
$return = array('mode' => 'error', 'text' => 'Invalid namespace return from RenderMan::strToPageID()'); |
334
c72b545f1304
More localization work. Resolved major issue with JSON parser not parsing files over ~50KB. Switched JSON parser to the one from the Zend Framework (BSD licensed). Forced to split enano.json into five different files.
Dan
parents:
326
diff
changeset
|
524 |
echo enano_json_encode($return); |
81
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
525 |
return; |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
526 |
} |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
527 |
|
75 | 528 |
$q = $db->sql_query('SELECT "x" FROM '.table_prefix.'page_group_members WHERE pg_id=' . $edit_id . ' AND page_id=\'' . $db->escape($page_id) . '\' AND namespace=\'' . $namespace . '\';'); |
529 |
if ( !$q ) |
|
530 |
{ |
|
531 |
$return = array('mode' => 'error', 'text' => $db->get_error()); |
|
334
c72b545f1304
More localization work. Resolved major issue with JSON parser not parsing files over ~50KB. Switched JSON parser to the one from the Zend Framework (BSD licensed). Forced to split enano.json into five different files.
Dan
parents:
326
diff
changeset
|
532 |
echo enano_json_encode($return); |
75 | 533 |
return; |
534 |
} |
|
535 |
if ( $db->numrows() > 0 ) |
|
536 |
{ |
|
537 |
$return = array('mode' => 'error', 'text' => 'The page you are trying to add is already in this group.'); |
|
334
c72b545f1304
More localization work. Resolved major issue with JSON parser not parsing files over ~50KB. Switched JSON parser to the one from the Zend Framework (BSD licensed). Forced to split enano.json into five different files.
Dan
parents:
326
diff
changeset
|
538 |
echo enano_json_encode($return); |
75 | 539 |
return; |
540 |
} |
|
541 |
||
542 |
$q = $db->sql_query('INSERT INTO '.table_prefix.'page_group_members(pg_id, page_id, namespace) VALUES(' . $edit_id . ', \'' . $db->escape($page_id) . '\', \'' . $namespace . '\');'); |
|
543 |
if ( !$q ) |
|
544 |
{ |
|
545 |
$return = array('mode' => 'error', 'text' => $db->get_error()); |
|
334
c72b545f1304
More localization work. Resolved major issue with JSON parser not parsing files over ~50KB. Switched JSON parser to the one from the Zend Framework (BSD licensed). Forced to split enano.json into five different files.
Dan
parents:
326
diff
changeset
|
546 |
echo enano_json_encode($return); |
75 | 547 |
return; |
548 |
} |
|
549 |
||
550 |
$title = "($namespace) " . get_page_title($paths->nslist[$namespace] . $page_id); |
|
551 |
||
552 |
$return = array('mode' => 'info', 'text' => 'The page has been added to the specified group.', 'successful' => true, 'title' => $title, 'member_id' => $db->insert_id()); |
|
553 |
||
334
c72b545f1304
More localization work. Resolved major issue with JSON parser not parsing files over ~50KB. Switched JSON parser to the one from the Zend Framework (BSD licensed). Forced to split enano.json into five different files.
Dan
parents:
326
diff
changeset
|
554 |
echo enano_json_encode($return); |
75 | 555 |
return; |
556 |
} |
|
557 |
||
81
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
558 |
if ( isset($_POST['action']['edit_save']) && isset($_POST['pg_name']) ) |
75 | 559 |
{ |
560 |
$edit_id = $_POST['action']['edit']; |
|
81
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
561 |
$edit_id = intval($edit_id); |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
562 |
if ( !empty($edit_id) ) |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
563 |
{ |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
564 |
// Update group name |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
565 |
$new_name = $_POST['pg_name']; |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
566 |
if ( empty($new_name) ) |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
567 |
{ |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
568 |
echo '<div class="error-box">Please enter a valid name for this group.</div>'; |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
569 |
} |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
570 |
else |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
571 |
{ |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
572 |
$q = $db->sql_query('SELECT pg_name FROM '.table_prefix.'page_groups WHERE pg_id=' . $edit_id . ';'); |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
573 |
if ( !$q ) |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
574 |
$db->_die(); |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
575 |
$row = $db->fetchrow(); |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
576 |
$db->free_result(); |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
577 |
if ( $new_name != $row['pg_name'] ) |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
578 |
{ |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
579 |
$new_name = $db->escape(trim($new_name)); |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
580 |
$q = $db->sql_query('UPDATE '.table_prefix.'page_groups SET pg_name=\'' . $new_name . '\' WHERE pg_id=' . $edit_id . ';'); |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
581 |
if ( !$q ) |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
582 |
$db->_die(); |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
583 |
else |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
584 |
echo '<div class="info-box">The group name was updated successfully.</div>'; |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
585 |
} |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
586 |
if ( $_POST['pg_type'] == PAGE_GRP_TAGGED ) |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
587 |
{ |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
588 |
$target = $_POST['pg_target']; |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
589 |
$target = sanitize_tag($target); |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
590 |
if ( empty($target) ) |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
591 |
{ |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
592 |
echo '<div class="error-box">Please enter a valid tag.</div>'; |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
593 |
} |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
594 |
else |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
595 |
{ |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
596 |
$target = $db->escape($target); |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
597 |
$q = $db->sql_query('UPDATE '.table_prefix.'page_groups SET pg_target=\'' . $target . '\' WHERE pg_id=' . $edit_id . ';'); |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
598 |
if ( !$q ) |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
599 |
$db->_die(); |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
600 |
else |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
601 |
echo '<div class="info-box">The affecting tag was updated.</div>'; |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
602 |
} |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
603 |
} |
183
91127e62f38f
Fixed some regular expressions in HTML optimization algorithm; regex page groups can be edited now (oops)
Dan
parents:
156
diff
changeset
|
604 |
else if ( $_POST['pg_type'] == PAGE_GRP_REGEX ) |
91127e62f38f
Fixed some regular expressions in HTML optimization algorithm; regex page groups can be edited now (oops)
Dan
parents:
156
diff
changeset
|
605 |
{ |
91127e62f38f
Fixed some regular expressions in HTML optimization algorithm; regex page groups can be edited now (oops)
Dan
parents:
156
diff
changeset
|
606 |
$target = $_POST['pg_target']; |
91127e62f38f
Fixed some regular expressions in HTML optimization algorithm; regex page groups can be edited now (oops)
Dan
parents:
156
diff
changeset
|
607 |
if ( empty($target) ) |
91127e62f38f
Fixed some regular expressions in HTML optimization algorithm; regex page groups can be edited now (oops)
Dan
parents:
156
diff
changeset
|
608 |
{ |
91127e62f38f
Fixed some regular expressions in HTML optimization algorithm; regex page groups can be edited now (oops)
Dan
parents:
156
diff
changeset
|
609 |
echo '<div class="error-box">Please enter an expression to match against..</div>'; |
91127e62f38f
Fixed some regular expressions in HTML optimization algorithm; regex page groups can be edited now (oops)
Dan
parents:
156
diff
changeset
|
610 |
} |
91127e62f38f
Fixed some regular expressions in HTML optimization algorithm; regex page groups can be edited now (oops)
Dan
parents:
156
diff
changeset
|
611 |
else |
91127e62f38f
Fixed some regular expressions in HTML optimization algorithm; regex page groups can be edited now (oops)
Dan
parents:
156
diff
changeset
|
612 |
{ |
91127e62f38f
Fixed some regular expressions in HTML optimization algorithm; regex page groups can be edited now (oops)
Dan
parents:
156
diff
changeset
|
613 |
$target = $db->escape($target); |
91127e62f38f
Fixed some regular expressions in HTML optimization algorithm; regex page groups can be edited now (oops)
Dan
parents:
156
diff
changeset
|
614 |
$q = $db->sql_query('UPDATE '.table_prefix.'page_groups SET pg_target=\'' . $target . '\' WHERE pg_id=' . $edit_id . ';'); |
91127e62f38f
Fixed some regular expressions in HTML optimization algorithm; regex page groups can be edited now (oops)
Dan
parents:
156
diff
changeset
|
615 |
if ( !$q ) |
91127e62f38f
Fixed some regular expressions in HTML optimization algorithm; regex page groups can be edited now (oops)
Dan
parents:
156
diff
changeset
|
616 |
$db->_die(); |
91127e62f38f
Fixed some regular expressions in HTML optimization algorithm; regex page groups can be edited now (oops)
Dan
parents:
156
diff
changeset
|
617 |
else |
91127e62f38f
Fixed some regular expressions in HTML optimization algorithm; regex page groups can be edited now (oops)
Dan
parents:
156
diff
changeset
|
618 |
echo '<div class="info-box">The expression to match against was updated.</div>'; |
91127e62f38f
Fixed some regular expressions in HTML optimization algorithm; regex page groups can be edited now (oops)
Dan
parents:
156
diff
changeset
|
619 |
} |
91127e62f38f
Fixed some regular expressions in HTML optimization algorithm; regex page groups can be edited now (oops)
Dan
parents:
156
diff
changeset
|
620 |
} |
81
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
621 |
else if ( $_POST['pg_type'] == PAGE_GRP_CATLINK ) |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
622 |
{ |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
623 |
$target = $_POST['pg_target']; |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
624 |
if ( empty($target) ) |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
625 |
{ |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
626 |
echo '<div class="error-box">No category ID specified on POST URI.</div>'; |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
627 |
} |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
628 |
else |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
629 |
{ |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
630 |
$target = $db->escape($target); |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
631 |
$q = $db->sql_query('UPDATE '.table_prefix.'page_groups SET pg_target=\'' . $target . '\' WHERE pg_id=' . $edit_id . ';'); |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
632 |
if ( !$q ) |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
633 |
$db->_die(); |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
634 |
else |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
635 |
echo '<div class="info-box">The affecting category was updated.</div>'; |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
636 |
} |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
637 |
} |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
638 |
} |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
639 |
} |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
640 |
} |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
641 |
else if ( isset($_POST['action']['edit_save']) ) |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
642 |
{ |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
643 |
$edit_id = $_POST['action']['edit']; |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
644 |
$edit_id = intval($edit_id); |
75 | 645 |
} |
646 |
else |
|
647 |
{ |
|
648 |
$edit_id = array_keys($_POST['action']['edit']); |
|
649 |
$edit_id = intval($edit_id[0]); |
|
650 |
} |
|
651 |
||
652 |
if ( empty($edit_id) ) |
|
653 |
{ |
|
654 |
echo 'Hack attempt'; |
|
655 |
return; |
|
656 |
} |
|
657 |
||
81
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
658 |
if ( isset($_POST['action']['edit_save']['do_rm']) && !isset($_POST['pg_name']) ) |
75 | 659 |
{ |
660 |
$vals = array_keys($_POST['action']['edit_save']['rm']); |
|
661 |
$good = array(); |
|
662 |
foreach ( $vals as $id ) |
|
663 |
{ |
|
664 |
if ( strval(intval($id)) == $id ) |
|
665 |
$good[] = $id; |
|
666 |
} |
|
81
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
667 |
$subquery = ( count($good) > 0 ) ? 'pg_member_id=' . implode(' OR pg_member_id=', $good) : "'foo'='bar'"; |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
668 |
if ( $subquery == "'foo'='bar'" ) |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
669 |
{ |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
670 |
echo '<div class="warning-box">No pages were selected for deletion, and thus none were deleted.</div>'; |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
671 |
} |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
672 |
else |
75 | 673 |
{ |
81
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
674 |
$sql = 'DELETE FROM '.table_prefix."page_group_members WHERE ( $subquery ) AND pg_id=$edit_id;"; |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
675 |
if ( !$db->sql_query($sql) ) |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
676 |
{ |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
677 |
$db->_die(); |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
678 |
} |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
679 |
echo '<div class="info-box">The requested page group members have been deleted.</div>'; |
75 | 680 |
} |
681 |
} |
|
682 |
||
683 |
// Fetch information about page group |
|
684 |
$q = $db->sql_query('SELECT pg_name, pg_type, pg_target FROM '.table_prefix.'page_groups WHERE pg_id=' . $edit_id . ';'); |
|
685 |
if ( !$q ) |
|
686 |
$db->_die(); |
|
687 |
||
688 |
if ( $db->numrows() < 1 ) |
|
689 |
{ |
|
690 |
echo 'Bad request - can\'t load page group from database.'; |
|
691 |
return; |
|
692 |
} |
|
693 |
||
694 |
$row = $db->fetchrow(); |
|
695 |
$db->free_result(); |
|
696 |
||
697 |
echo '<form name="pg_edit_frm" action="'.makeUrl($paths->nslist['Special'].'Administration', 'module='.$paths->cpage['module']).'" method="post" onsubmit="if(!submitAuthorized) return false;" enctype="multipart/form-data">'; |
|
698 |
echo '<input type="hidden" name="action[edit]" value="' . $edit_id . '" />'; |
|
81
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
699 |
echo '<input type="hidden" name="pg_type" value="' . $row['pg_type'] . '" />'; |
75 | 700 |
echo '<div class="tblholder"> |
701 |
<table border="0" cellspacing="1" cellpadding="4"> |
|
702 |
<tr> |
|
703 |
<th colspan="3">Editing page group: ' . htmlspecialchars($row['pg_name']) . '</th> |
|
704 |
</tr>'; |
|
705 |
// Group name |
|
706 |
||
707 |
echo ' <tr> |
|
708 |
<td class="row2">Group name:</td> |
|
709 |
<td class="row1" colspan="2"><input type="text" name="pg_name" value="' . htmlspecialchars($row['pg_name']) . '" size="30" /></td> |
|
710 |
</tr>'; |
|
711 |
||
712 |
$ajax_page_add = false; |
|
713 |
||
714 |
// This is where the going gets tricky. |
|
715 |
// For static groups, we need to have each page listed out with a removal button, and a form to add new pages. |
|
716 |
// For category links, we need a select box with each category in it, and |
|
717 |
// For tag sets, just a text box to enter a new tag. |
|
718 |
||
719 |
// You can guess which one I dreaded. |
|
720 |
||
721 |
switch ( $row['pg_type'] ) |
|
722 |
{ |
|
723 |
case PAGE_GRP_NORMAL: |
|
81
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
724 |
|
75 | 725 |
// You have guessed correct. |
726 |
// *Sits in chair for 10 minutes listening to the radio in an effort to put off writing the code you see below* |
|
727 |
||
728 |
echo '<tr><th colspan="3" class="subhead"><input type="submit" name="action[edit_save]" value="Save group name" /></th></tr>'; |
|
81
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
729 |
echo '</table></div>'; |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
730 |
echo '</form>'; |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
731 |
echo '<form name="pg_static_rm_frm" action="'.makeUrl($paths->nslist['Special'].'Administration', 'module='.$paths->cpage['module']).'" method="post" enctype="multipart/form-data">'; |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
732 |
echo '<input type="hidden" name="action[edit]" value="' . $edit_id . '" />'; |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
733 |
echo '<div class="tblholder"> |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
734 |
<table border="0" cellspacing="1" cellpadding="4"> |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
735 |
<tr> |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
736 |
<th colspan="3">Remove pages from this group</th> |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
737 |
</tr>'; |
75 | 738 |
|
739 |
$q = $db->sql_query('SELECT m.pg_member_id,m.page_id,m.namespace FROM '.table_prefix.'page_group_members AS m |
|
740 |
LEFT JOIN '.table_prefix.'pages AS p |
|
741 |
ON ( p.urlname = m.page_id AND p.namespace = m.namespace ) |
|
742 |
WHERE m.pg_id=' . $edit_id . ';'); |
|
743 |
||
744 |
if ( !$q ) |
|
745 |
$db->_die(); |
|
746 |
||
747 |
$delim = ceil( $db->numrows() / 2 ); |
|
748 |
if ( $delim < 5 ) |
|
749 |
{ |
|
750 |
$delim = 0xFFFFFFFE; |
|
751 |
// stupid hack |
|
752 |
$colspan = '2" id="pg_edit_tackon2me'; |
|
753 |
} |
|
754 |
else |
|
755 |
{ |
|
756 |
$colspan = "1"; |
|
757 |
} |
|
758 |
||
759 |
echo '<tr><td class="row2" rowspan="2"><b>Remove</b> pages:</td><td class="row1" colspan="' . $colspan . '">'; |
|
760 |
$i = 0; |
|
761 |
||
762 |
while ( $row = $db->fetchrow() ) |
|
763 |
{ |
|
764 |
$i++; |
|
765 |
if ( $i == $delim ) |
|
766 |
{ |
|
767 |
echo '</td><td class="row1" id="pg_edit_tackon2me">'; |
|
768 |
} |
|
769 |
$page_name = '(' . $row['namespace'] . ') ' . get_page_title($paths->nslist[$row['namespace']] . $row['page_id']); |
|
770 |
echo '<label><input type="checkbox" name="action[edit_save][rm][' . $row['pg_member_id'] . ']" /> ' . htmlspecialchars($page_name) . '</label><br />'; |
|
771 |
} |
|
772 |
||
773 |
echo '</td></tr>'; |
|
774 |
echo '<tr><th colspan="2" class="subhead" style="width: 70%;"><input type="submit" name="action[edit_save][do_rm]" value="Remove selected" /></th></tr>'; |
|
775 |
||
776 |
// More javascript magic! |
|
777 |
?> |
|
778 |
<script type="text/javascript"> |
|
80
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
75
diff
changeset
|
779 |
var __pg_edit_submitAuthorized = true; |
75 | 780 |
var __ol_pg_edit_setup = function() |
781 |
{ |
|
782 |
var input = document.getElementById('inptext_pg_add_member'); |
|
783 |
input.onkeyup = function(e) { ajaxPageNameComplete(this); }; |
|
784 |
input.onkeypress = function(e) { if ( e.keyCode == 13 ) { setTimeout('__pg_edit_ajaxadd(document.getElementById(\'' + this.id + '\'));', 500); } }; |
|
785 |
} |
|
786 |
addOnloadHook(__ol_pg_edit_setup); |
|
787 |
var __pg_edit_objcache = false; |
|
788 |
function __pg_edit_ajaxadd(obj) |
|
789 |
{ |
|
790 |
if ( __pg_edit_objcache ) |
|
791 |
return false; |
|
792 |
__pg_edit_objcache = obj; |
|
793 |
||
794 |
if ( obj.nextSibling ) |
|
795 |
{ |
|
796 |
if ( obj.nextSibling.tagName == 'DIV' ) |
|
797 |
{ |
|
798 |
obj.parentNode.removeChild(obj.nextSibling); |
|
799 |
} |
|
800 |
} |
|
801 |
||
802 |
// set width on parent, to prevent wrapping of ajax loading image |
|
803 |
var w = $(obj).Width(); |
|
804 |
w = w + 24; |
|
805 |
obj.parentNode.style.width = w + 'px'; |
|
806 |
||
807 |
// append the ajaxy loading image |
|
808 |
var img = document.createElement('img'); |
|
809 |
img.src = scriptPath + '/images/loading.gif'; |
|
810 |
img.style.marginLeft = '4px'; |
|
811 |
insertAfter(obj.parentNode, img, obj); |
|
812 |
||
813 |
var url = makeUrlNS('Admin', 'PageGroups', 'src=ajax'); |
|
814 |
var page_add = escape(obj.value); |
|
815 |
var pg_id = document.forms.pg_edit_frm['action[edit]'].value; |
|
816 |
ajaxPost(url, 'action[edit][add_page]=&pg_id=' + pg_id + '&new_page=' + page_add, function() |
|
817 |
{ |
|
818 |
if ( ajax.readyState == 4 ) |
|
819 |
{ |
|
820 |
var obj = __pg_edit_objcache; |
|
821 |
__pg_edit_objcache = false; |
|
822 |
||
823 |
// kill the loading graphic |
|
824 |
obj.parentNode.removeChild(obj.nextSibling); |
|
825 |
||
826 |
var resptext = String(ajax.responseText + ''); |
|
827 |
if ( resptext.substr(0, 1) != '{' ) |
|
828 |
{ |
|
829 |
// This ain't JSON baby. |
|
830 |
alert('Invalid JSON response:\n' + resptext); |
|
831 |
return false; |
|
832 |
} |
|
833 |
var json = parseJSON(resptext); |
|
834 |
||
835 |
var div = document.createElement('div'); |
|
836 |
if ( json.mode == 'info' ) |
|
837 |
{ |
|
838 |
div.className = 'info-box-mini'; |
|
839 |
} |
|
840 |
else if ( json.mode == 'error' ) |
|
841 |
{ |
|
842 |
div.className = 'error-box-mini'; |
|
843 |
} |
|
844 |
div.appendChild(document.createTextNode(json.text)); |
|
845 |
insertAfter(obj.parentNode, div, obj); |
|
846 |
||
847 |
if ( json.successful ) |
|
848 |
{ |
|
849 |
var td = document.getElementById('pg_edit_tackon2me'); |
|
850 |
var lbl = document.createElement('label'); |
|
851 |
var check = document.createElement('input'); |
|
852 |
check.type = 'checkbox'; |
|
853 |
check.name = 'action[edit_save][rm][' + json.member_id + ']'; |
|
854 |
lbl.appendChild(check); |
|
855 |
lbl.appendChild(document.createTextNode(' ' + json.title)); |
|
856 |
td.appendChild(lbl); |
|
857 |
td.appendChild(document.createElement('br')); |
|
858 |
} |
|
859 |
||
860 |
} |
|
861 |
}); |
|
862 |
} |
|
863 |
</script> |
|
864 |
<?php |
|
865 |
||
866 |
$ajax_page_add = true; |
|
867 |
||
868 |
break; |
|
80
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
75
diff
changeset
|
869 |
case PAGE_GRP_TAGGED: |
81
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
870 |
echo '<tr> |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
871 |
<td class="row2"> |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
872 |
Include pages with this tag: |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
873 |
</td> |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
874 |
<td class="row1"> |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
875 |
<input type="text" name="pg_target" value="' . htmlspecialchars($row['pg_target']) . '" size="30" /> |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
876 |
</td> |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
877 |
</tr>'; |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
878 |
break; |
183
91127e62f38f
Fixed some regular expressions in HTML optimization algorithm; regex page groups can be edited now (oops)
Dan
parents:
156
diff
changeset
|
879 |
case PAGE_GRP_REGEX: |
91127e62f38f
Fixed some regular expressions in HTML optimization algorithm; regex page groups can be edited now (oops)
Dan
parents:
156
diff
changeset
|
880 |
echo '<tr> |
91127e62f38f
Fixed some regular expressions in HTML optimization algorithm; regex page groups can be edited now (oops)
Dan
parents:
156
diff
changeset
|
881 |
<td class="row2"> |
91127e62f38f
Fixed some regular expressions in HTML optimization algorithm; regex page groups can be edited now (oops)
Dan
parents:
156
diff
changeset
|
882 |
Regular expression to use:<br /> |
91127e62f38f
Fixed some regular expressions in HTML optimization algorithm; regex page groups can be edited now (oops)
Dan
parents:
156
diff
changeset
|
883 |
<small>Be sure to include the starting and ending delimiters and any flags you might need.<br /> |
91127e62f38f
Fixed some regular expressions in HTML optimization algorithm; regex page groups can be edited now (oops)
Dan
parents:
156
diff
changeset
|
884 |
These pages might help: <a href="http://us.php.net/manual/en/reference.pcre.pattern.modifiers.php">Pattern modifiers</a> • |
91127e62f38f
Fixed some regular expressions in HTML optimization algorithm; regex page groups can be edited now (oops)
Dan
parents:
156
diff
changeset
|
885 |
<a href="http://us.php.net/manual/en/reference.pcre.pattern.syntax.php">Pattern syntax</a><br /> |
91127e62f38f
Fixed some regular expressions in HTML optimization algorithm; regex page groups can be edited now (oops)
Dan
parents:
156
diff
changeset
|
886 |
Examples: <tt>/^(Special|Admin):/i</tt> • <tt>/^Image:([0-9]+)$/</tt><br /> |
91127e62f38f
Fixed some regular expressions in HTML optimization algorithm; regex page groups can be edited now (oops)
Dan
parents:
156
diff
changeset
|
887 |
Developers, remember that this will be matched against the full page identifier string. This means that <tt>/^About_Enano$/</tt> |
91127e62f38f
Fixed some regular expressions in HTML optimization algorithm; regex page groups can be edited now (oops)
Dan
parents:
156
diff
changeset
|
888 |
will NOT match the page Special:About_Enano.</small> |
91127e62f38f
Fixed some regular expressions in HTML optimization algorithm; regex page groups can be edited now (oops)
Dan
parents:
156
diff
changeset
|
889 |
</td> |
91127e62f38f
Fixed some regular expressions in HTML optimization algorithm; regex page groups can be edited now (oops)
Dan
parents:
156
diff
changeset
|
890 |
<td class="row1"> |
91127e62f38f
Fixed some regular expressions in HTML optimization algorithm; regex page groups can be edited now (oops)
Dan
parents:
156
diff
changeset
|
891 |
<input type="text" name="pg_target" value="' . htmlspecialchars($row['pg_target']) . '" size="30" /> |
91127e62f38f
Fixed some regular expressions in HTML optimization algorithm; regex page groups can be edited now (oops)
Dan
parents:
156
diff
changeset
|
892 |
</td> |
91127e62f38f
Fixed some regular expressions in HTML optimization algorithm; regex page groups can be edited now (oops)
Dan
parents:
156
diff
changeset
|
893 |
</tr>'; |
91127e62f38f
Fixed some regular expressions in HTML optimization algorithm; regex page groups can be edited now (oops)
Dan
parents:
156
diff
changeset
|
894 |
break; |
81
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
895 |
case PAGE_GRP_CATLINK: |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
896 |
|
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
897 |
// Build category list |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
898 |
$q = $db->sql_query('SELECT name,urlname FROM '.table_prefix.'pages WHERE namespace=\'Category\';'); |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
899 |
if ( !$q ) |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
900 |
$db->_die(); |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
901 |
|
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
902 |
if ( $db->numrows() < 1 ) |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
903 |
{ |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
904 |
$catlist = 'There aren\'t any categories on this site.'; |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
905 |
} |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
906 |
else |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
907 |
{ |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
908 |
$catlist = '<select name="pg_target">'; |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
909 |
while ( $catrow = $db->fetchrow() ) |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
910 |
{ |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
911 |
$selected = ( $catrow['urlname'] == $row['pg_target'] ) ? ' selected="selected"' : ''; |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
912 |
$catlist .= '<option value="' . htmlspecialchars($catrow['urlname']) . '"' . $selected . '>' . htmlspecialchars($catrow['name']) . '</option>'; |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
913 |
} |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
914 |
$catlist .= '</select>'; |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
915 |
} |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
916 |
|
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
917 |
echo '<tr> |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
918 |
<td class="row2"> |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
919 |
Include pages that are in this category:<br /> |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
920 |
<small><b>Reminder:</b> Enano does not automatically place any access controls on the category. If you |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
921 |
don\'t want users to be able to freely add and remove pages from the category (assuming Wiki Mode is enabled |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
922 |
for the category) then you need to enable protection on the category using the button on the more options menu. |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
923 |
</small> |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
924 |
</td> |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
925 |
<td class="row1"> |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
926 |
' . $catlist . ' |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
927 |
</td> |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
928 |
</tr>'; |
d7fc25acd3f3
Replaced the menu in the admin theme with something much more visually pleasureable; minor fix in Special:UploadFile; finished patching a couple of XSS problems from Banshee; finished Admin:PageGroups; removed unneeded code in flyin.js; finished tag system (except tag cloud); 1.0.1 release candidate
Dan
parents:
80
diff
changeset
|
929 |
|
80
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
75
diff
changeset
|
930 |
break; |
75 | 931 |
} |
932 |
||
933 |
if ( $ajax_page_add ) |
|
934 |
{ |
|
935 |
echo '<tr><th colspan="3"><input type="submit" name="action[noop]" value="Cancel all changes" /></th></tr>'; |
|
936 |
} |
|
937 |
else |
|
938 |
{ |
|
80
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
75
diff
changeset
|
939 |
echo '<tr><th colspan="3" class="subhead"> |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
75
diff
changeset
|
940 |
<input type="submit" name="action[edit_save]" value="Save and update" /> |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
75
diff
changeset
|
941 |
<input type="submit" name="action[noop]" value="Cancel all changes" /> |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
75
diff
changeset
|
942 |
</th></tr>'; |
75 | 943 |
} |
944 |
||
945 |
echo ' </table> |
|
946 |
</div>'; |
|
947 |
echo '</form>'; |
|
948 |
||
80
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
75
diff
changeset
|
949 |
if ( $ajax_page_add ) |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
75
diff
changeset
|
950 |
{ |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
75
diff
changeset
|
951 |
// This needs to be outside of the form. |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
75
diff
changeset
|
952 |
echo '<div class="tblholder"><table border="0" cellspacing="1" cellpadding="4"><tr>'; |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
75
diff
changeset
|
953 |
echo '<th colspan="2">On-the-fly tools</th></tr>'; |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
75
diff
changeset
|
954 |
echo '<tr>'; |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
75
diff
changeset
|
955 |
// Add pages AJAX form |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
75
diff
changeset
|
956 |
echo '<td class="row2">Add page:<br /><small>You can add multiple pages by entering part of a page title, and it will be auto-completed. Press Enter to quickly add the page. This only works if you a really up-to-date browser.</small></td>'; |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
75
diff
changeset
|
957 |
echo '<td class="row1"><input type="text" size="30" name="pg_add_member" id="inptext_pg_add_member" /></td>'; |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
75
diff
changeset
|
958 |
echo '</tr></table></div>'; |
cb7dde69c301
Improved and enabled HTML optimization algorithm; enabled gzip compression; added but did not test at all the tag cloud class in includes/tagcloud.php, this is still very preliminary and not ready for any type of production use
Dan
parents:
75
diff
changeset
|
959 |
} |
75 | 960 |
|
961 |
return; |
|
962 |
} |
|
963 |
else if ( isset($_POST['action']['noop']) ) |
|
964 |
{ |
|
965 |
// Do nothing - skip to main form (noop is usually invoked by a cancel button in a form above) |
|
966 |
} |
|
967 |
else |
|
968 |
{ |
|
969 |
echo '<div class="error-box">Invalid format of $_POST[action].</div>'; |
|
970 |
} |
|
971 |
} |
|
972 |
// No action defined - show default menu |
|
973 |
||
974 |
echo '<h2>Manage page groups</h2>'; |
|
975 |
echo '<p>Enano\'s page grouping system allows you to build sets of pages that can be controlled by a single ACL rule. This makes managing features such as a members-only section of your site a lot easier. If you don\'t use the ACL system, you probably don\'t need to use page groups.</p>'; |
|
976 |
||
977 |
$q = $db->sql_query('SELECT pg_id, pg_type, pg_name, pg_target FROM '.table_prefix.'page_groups;'); |
|
978 |
if ( !$q ) |
|
979 |
$db->_die(); |
|
980 |
||
981 |
echo '<form action="'.makeUrl($paths->nslist['Special'].'Administration', 'module='.$paths->cpage['module']).'" method="post" onsubmit="if(!submitAuthorized) return false;" enctype="multipart/form-data">'; |
|
982 |
||
983 |
echo '<div class="tblholder"> |
|
984 |
<table border="0" cellspacing="1" cellpadding="4"> |
|
985 |
<tr> |
|
986 |
<th>Group name</th> |
|
987 |
<th>Type</th> |
|
988 |
<th>Target</th> |
|
989 |
<th colspan="2">Actions</th> |
|
990 |
</tr>'; |
|
991 |
||
992 |
if ( $row = $db->fetchrow() ) |
|
993 |
{ |
|
994 |
do |
|
995 |
{ |
|
996 |
$name = htmlspecialchars($row['pg_name']); |
|
997 |
$type = 'Invalid'; |
|
998 |
switch ( $row['pg_type'] ) |
|
999 |
{ |
|
1000 |
case PAGE_GRP_CATLINK: |
|
1001 |
$type = 'Link to category'; |
|
1002 |
break; |
|
1003 |
case PAGE_GRP_TAGGED: |
|
1004 |
$type = 'Set of tagged pages'; |
|
1005 |
break; |
|
1006 |
case PAGE_GRP_NORMAL: |
|
1007 |
$type = 'Static set of pages'; |
|
1008 |
break; |
|
156
edbff85d43e8
Feature add: new page group type: regular expression match (PCRE)
Dan
parents:
142
diff
changeset
|
1009 |
case PAGE_GRP_REGEX: |
edbff85d43e8
Feature add: new page group type: regular expression match (PCRE)
Dan
parents:
142
diff
changeset
|
1010 |
$type = 'Regular expression match'; |
edbff85d43e8
Feature add: new page group type: regular expression match (PCRE)
Dan
parents:
142
diff
changeset
|
1011 |
break; |
75 | 1012 |
} |
1013 |
$target = ''; |
|
1014 |
if ( $row['pg_type'] == PAGE_GRP_TAGGED ) |
|
1015 |
{ |
|
1016 |
$target = 'Tag: ' . htmlspecialchars($row['pg_target']); |
|
1017 |
} |
|
1018 |
else if ( $row['pg_type'] == PAGE_GRP_CATLINK ) |
|
1019 |
{ |
|
1020 |
$target = 'Category: ' . htmlspecialchars(get_page_title($paths->nslist['Category'] . sanitize_page_id($row['pg_target']))); |
|
1021 |
} |
|
156
edbff85d43e8
Feature add: new page group type: regular expression match (PCRE)
Dan
parents:
142
diff
changeset
|
1022 |
else if ( $row['pg_type'] == PAGE_GRP_REGEX ) |
edbff85d43e8
Feature add: new page group type: regular expression match (PCRE)
Dan
parents:
142
diff
changeset
|
1023 |
{ |
edbff85d43e8
Feature add: new page group type: regular expression match (PCRE)
Dan
parents:
142
diff
changeset
|
1024 |
$target = 'Expression: <tt>' . htmlspecialchars($row['pg_target']) . '</tt>'; |
edbff85d43e8
Feature add: new page group type: regular expression match (PCRE)
Dan
parents:
142
diff
changeset
|
1025 |
} |
75 | 1026 |
$btn_edit = '<input type="submit" name="action[edit][' . $row['pg_id'] . ']" value="Edit" />'; |
1027 |
$btn_del = '<input type="submit" name="action[del][' . $row['pg_id'] . ']" value="Delete" />'; |
|
1028 |
// stupid jEdit bug/hack |
|
1029 |
$quot = '"'; |
|
1030 |
echo "<tr> |
|
1031 |
<td class={$quot}row1{$quot}>$name</td> |
|
1032 |
<td class={$quot}row2{$quot}>$type</td> |
|
1033 |
<td class={$quot}row1{$quot}>$target</td> |
|
1034 |
<td class={$quot}row3{$quot} style={$quot}text-align: center;{$quot}>$btn_edit</td> |
|
1035 |
<td class={$quot}row3{$quot} style={$quot}text-align: center;{$quot}>$btn_del</td> |
|
1036 |
</tr>"; |
|
1037 |
} |
|
1038 |
while ( $row = $db->fetchrow() ); |
|
1039 |
} |
|
1040 |
else |
|
1041 |
{ |
|
1042 |
echo ' <tr><td class="row3" colspan="5" style="text-align: center;">No page groups defined.</td></tr>'; |
|
1043 |
} |
|
1044 |
||
1045 |
echo ' <tr> |
|
1046 |
<th class="subhead" colspan="5"> |
|
1047 |
<input type="submit" name="action[create]" value="Create new group" /> |
|
1048 |
</th> |
|
1049 |
</tr>'; |
|
1050 |
||
1051 |
echo ' </table> |
|
1052 |
</div>'; |
|
1053 |
||
1054 |
echo '</form>'; |
|
1055 |
||
1056 |
} |
|
1057 |
||
1058 |
?> |