author | Dan |
Wed, 20 Feb 2008 14:38:39 -0500 | |
changeset 436 | 242353360e37 |
parent 426 | f5718d7c2a6a |
child 501 | 9367161b2457 |
permissions | -rw-r--r-- |
0 | 1 |
<?php |
2 |
/* |
|
343
eefe9ab7fe7c
Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
335
diff
changeset
|
3 |
Plugin Name: plugin_specialpagefuncs_title |
0 | 4 |
Plugin URI: http://enanocms.org/ |
343
eefe9ab7fe7c
Localized the first parts of the admin panel. As a consequence, also wrote a brand new Admin:PageManager that doesn't suck like the old one did.
Dan
parents:
335
diff
changeset
|
5 |
Description: plugin_specialpagefuncs_desc |
0 | 6 |
Author: Dan Fuhry |
387
92664d2efab8
Rebranded source code as 1.1.1; added TinyMCE ACL rule as per Vadi's request: http://forum.enanocms.org/viewtopic.php?f=7&t=54
Dan
parents:
345
diff
changeset
|
7 |
Version: 1.1.1 |
0 | 8 |
Author URI: http://enanocms.org/ |
9 |
*/ |
|
10 |
||
11 |
/* |
|
12 |
* Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between |
|
426 | 13 |
* Version 1.1.2 (Caoineag alpha 2) |
0 | 14 |
* Copyright (C) 2006-2007 Dan Fuhry |
15 |
* |
|
16 |
* This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License |
|
17 |
* as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. |
|
18 |
* |
|
19 |
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied |
|
20 |
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. |
|
21 |
*/ |
|
22 |
||
23 |
global $db, $session, $paths, $template, $plugins; // Common objects |
|
24 |
||
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
|
25 |
$plugins->attachHook('session_started', ' |
0 | 26 |
global $paths; |
27 |
$paths->add_page(Array( |
|
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
|
28 |
\'name\'=>\'specialpage_create_page\', |
0 | 29 |
\'urlname\'=>\'CreatePage\', |
30 |
\'namespace\'=>\'Special\', |
|
31 |
\'special\'=>0,\'visible\'=>1,\'comments_on\'=>0,\'protected\'=>1,\'delvotes\'=>0,\'delvote_ips\'=>\'\', |
|
32 |
)); |
|
33 |
||
34 |
$paths->add_page(Array( |
|
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
|
35 |
\'name\'=>\'specialpage_all_pages\', |
0 | 36 |
\'urlname\'=>\'AllPages\', |
37 |
\'namespace\'=>\'Special\', |
|
38 |
\'special\'=>0,\'visible\'=>1,\'comments_on\'=>0,\'protected\'=>1,\'delvotes\'=>0,\'delvote_ips\'=>\'\', |
|
39 |
)); |
|
40 |
||
41 |
$paths->add_page(Array( |
|
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
|
42 |
\'name\'=>\'specialpage_special_pages\', |
0 | 43 |
\'urlname\'=>\'SpecialPages\', |
44 |
\'namespace\'=>\'Special\', |
|
45 |
\'special\'=>0,\'visible\'=>1,\'comments_on\'=>0,\'protected\'=>1,\'delvotes\'=>0,\'delvote_ips\'=>\'\', |
|
46 |
)); |
|
47 |
||
48 |
$paths->add_page(Array( |
|
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
|
49 |
\'name\'=>\'specialpage_about_enano\', |
0 | 50 |
\'urlname\'=>\'About_Enano\', |
51 |
\'namespace\'=>\'Special\', |
|
52 |
\'special\'=>0,\'visible\'=>1,\'comments_on\'=>0,\'protected\'=>1,\'delvotes\'=>0,\'delvote_ips\'=>\'\', |
|
53 |
)); |
|
54 |
||
55 |
$paths->add_page(Array( |
|
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
|
56 |
\'name\'=>\'specialpage_gnu_gpl\', |
0 | 57 |
\'urlname\'=>\'GNU_General_Public_License\', |
58 |
\'namespace\'=>\'Special\', |
|
59 |
\'special\'=>0,\'visible\'=>1,\'comments_on\'=>0,\'protected\'=>1,\'delvotes\'=>0,\'delvote_ips\'=>\'\', |
|
60 |
)); |
|
83 | 61 |
|
62 |
$paths->add_page(Array( |
|
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
|
63 |
\'name\'=>\'specialpage_tag_cloud\', |
83 | 64 |
\'urlname\'=>\'TagCloud\', |
65 |
\'namespace\'=>\'Special\', |
|
66 |
\'special\'=>0,\'visible\'=>1,\'comments_on\'=>0,\'protected\'=>1,\'delvotes\'=>0,\'delvote_ips\'=>\'\', |
|
67 |
)); |
|
0 | 68 |
'); |
69 |
||
70 |
// function names are IMPORTANT!!! The name pattern is: page_<namespace ID>_<page URLname, without namespace> |
|
71 |
||
22
d0314575e2f0
More preliminary l10n work; userpage portal style basics implemented
Dan
parents:
0
diff
changeset
|
72 |
function page_Special_CreatePage() |
d0314575e2f0
More preliminary l10n work; userpage portal style basics implemented
Dan
parents:
0
diff
changeset
|
73 |
{ |
0 | 74 |
global $db, $session, $paths, $template, $plugins; // Common objects |
335
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
334
diff
changeset
|
75 |
global $lang; |
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
334
diff
changeset
|
76 |
|
426 | 77 |
$whitelist_ns = array('Article', 'User', 'Help', 'Template', 'Category', 'Project'); |
78 |
$code = $plugins->setHook('page_create_ns_whitelist'); |
|
79 |
foreach ( $code as $cmd ) |
|
80 |
{ |
|
81 |
eval($cmd); |
|
82 |
} |
|
83 |
||
84 |
$errors = array(); |
|
85 |
||
86 |
switch ( isset($_POST['page_title']) ) |
|
87 |
{ |
|
88 |
case true: |
|
89 |
// "Create page" was clicked |
|
90 |
||
91 |
// |
|
92 |
// VALIDATION CODE |
|
93 |
// |
|
94 |
||
95 |
// Check namespace |
|
96 |
$namespace = ( isset($_POST['namespace']) ) ? $_POST['namespace'] : 'Article'; |
|
97 |
if ( !in_array($namespace, $whitelist_ns) ) |
|
98 |
{ |
|
99 |
$errors[] = $lang->get('pagetools_create_err_invalid_namespace'); |
|
100 |
} |
|
101 |
||
102 |
// Check title and figure out urlname |
|
103 |
$title = $_POST['page_title']; |
|
104 |
$urlname = $_POST['page_title']; |
|
105 |
if ( @$_POST['custom_url'] === 'yes' && isset($_POST['urlname']) ) |
|
106 |
{ |
|
107 |
$urlname = $_POST['urlname']; |
|
108 |
} |
|
109 |
$urlname = sanitize_page_id($urlname); |
|
110 |
if ( $urlname == '.00' || empty($urlname) ) |
|
111 |
{ |
|
112 |
$errors[] = $lang->get('pagetools_create_err_invalid_urlname'); |
|
113 |
} |
|
114 |
||
115 |
// Validate page existence |
|
116 |
$pathskey = $paths->nslist[$namespace] . $urlname; |
|
117 |
if ( isPage($pathskey) ) |
|
118 |
{ |
|
119 |
$errors[] = $lang->get('pagetools_create_err_already_exists'); |
|
120 |
} |
|
121 |
||
122 |
// Validate permissions |
|
123 |
$perms = $session->fetch_page_acl($urlname, $namespace); |
|
124 |
if ( !$perms->get_permissions('create_page') ) |
|
125 |
{ |
|
126 |
$errors[] = $lang->get('pagetools_create_err_no_permission'); |
|
127 |
} |
|
128 |
||
129 |
// Run hooks |
|
130 |
$code = $plugins->setHook('page_create_request'); |
|
131 |
foreach ( $code as $cmd ) |
|
132 |
{ |
|
133 |
eval($cmd); |
|
134 |
} |
|
135 |
||
136 |
// Create the page |
|
137 |
if ( count($errors) < 1 ) |
|
138 |
{ |
|
139 |
$page = new PageProcessor($urlname, $namespace); |
|
140 |
$page->create_page($title); |
|
141 |
if ( $error = $page->pop_error() ) |
|
142 |
{ |
|
143 |
do |
|
144 |
{ |
|
145 |
$errors[] = $error; |
|
146 |
} |
|
147 |
while ( $error = $page->pop_error() ); |
|
148 |
} |
|
149 |
else |
|
150 |
{ |
|
151 |
redirect(makeUrlNS($namespace, $urlname) . '#do:edit', '', '', 0); |
|
152 |
return true; |
|
153 |
} |
|
154 |
} |
|
155 |
||
156 |
break; |
|
157 |
} |
|
158 |
||
159 |
$template->header(); |
|
160 |
||
161 |
echo $lang->get('pagetools_create_blurb'); |
|
162 |
||
163 |
if ( count($errors) > 0 ) |
|
164 |
{ |
|
165 |
echo '<div class="error-box">' . implode("<br />\n ", $errors) . '</div>'; |
|
166 |
} |
|
167 |
||
168 |
?> |
|
169 |
<enano:no-opt> |
|
170 |
<script type="text/javascript"> |
|
171 |
function cpGenPreviewUrl() |
|
172 |
{ |
|
173 |
var frm = document.forms['create_form']; |
|
174 |
var radio_custom = frm.getElementsByTagName('input')[2]; |
|
175 |
var use_custom_url = radio_custom.checked; |
|
176 |
if ( use_custom_url ) |
|
177 |
{ |
|
178 |
var title_src = frm.urlname.value; |
|
179 |
} |
|
180 |
else |
|
181 |
{ |
|
182 |
var title_src = frm.page_title.value; |
|
183 |
} |
|
184 |
var url = window.location.protocol + '//' + window.location.hostname + contentPath + namespace_list[frm.namespace.value] + sanitize_page_id(title_src); |
|
185 |
document.getElementById('createpage_url_preview').firstChild.nodeValue = url; |
|
186 |
} |
|
187 |
</script> |
|
188 |
</enano:no-opt> |
|
189 |
<?php |
|
190 |
||
191 |
echo '<form action="' . makeUrlNS('Special', 'CreatePage') . '" method="post" name="create_form">'; |
|
192 |
||
193 |
echo '<p>'; |
|
194 |
echo $lang->get('pagetools_create_field_title'); |
|
195 |
echo ' <input onkeyup="cpGenPreviewUrl();" type="text" name="page_title" size="40" tabindex="1" />'; |
|
196 |
echo '</p>'; |
|
197 |
||
198 |
echo '<p>'; |
|
199 |
echo $lang->get('pagetools_create_field_namespace'); |
|
200 |
echo ' <select onchange="cpGenPreviewUrl();" name="namespace" tabindex="2">'; |
|
201 |
foreach ( $paths->nslist as $ns => $ns_prefix ) |
|
202 |
{ |
|
203 |
if ( !in_array($ns, $whitelist_ns) ) |
|
204 |
continue; |
|
205 |
$lang_string = 'onpage_lbl_page_' . strtolower($ns); |
|
206 |
$str = $lang->get($lang_string); |
|
207 |
if ( $str == $lang_string ) |
|
208 |
$str = $ns; |
|
209 |
||
210 |
echo '<option value="' . $ns . '">' . ucwords($str) . '</option>'; |
|
211 |
} |
|
212 |
echo '</select>'; |
|
213 |
echo '</p>'; |
|
214 |
||
215 |
echo '<fieldset>'; |
|
216 |
echo '<legend>' . $lang->get('pagetools_create_group_advanced') . '</legend>'; |
|
217 |
||
218 |
echo '<p>'; |
|
219 |
echo '<label><input tabindex="3" type="radio" name="custom_url" value="no" checked="checked" onclick="cpGenPreviewUrl(); document.getElementById(\'createpage_custom_url\').style.display = \'none\';" /> ' . $lang->get('pagetools_create_field_url_auto') . '</label>'; |
|
220 |
echo '</p>'; |
|
221 |
||
222 |
echo '<p>'; |
|
223 |
echo '<label><input tabindex="3" type="radio" name="custom_url" value="yes" onclick="cpGenPreviewUrl(); document.getElementById(\'createpage_custom_url\').style.display = \'block\';" /> ' . $lang->get('pagetools_create_field_url_manual') . '</label>'; |
|
224 |
echo '</p>'; |
|
225 |
||
226 |
echo '<p id="createpage_custom_url" style="display: none; margin-left: 2em;">'; |
|
227 |
echo $lang->get('pagetools_create_field_url'); |
|
228 |
echo ' <input onkeyup="cpGenPreviewUrl();" tabindex="4" type="text" name="urlname" value="" size="40" />'; |
|
229 |
echo '</p>'; |
|
230 |
||
231 |
echo '<p>'; |
|
232 |
echo $lang->get('pagetools_create_field_preview') . ' <tt id="createpage_url_preview"> </tt><br />'; |
|
233 |
echo '<small>' . $lang->get('pagetools_create_field_preview_hint') . '</small>'; |
|
234 |
echo '</p>'; |
|
235 |
||
236 |
echo '</fieldset>'; |
|
237 |
||
238 |
echo '<p>'; |
|
239 |
echo '<input tabindex="5" type="submit" value="' . $lang->get('pagetools_create_btn_create') . '" />'; |
|
240 |
echo '</p>'; |
|
241 |
||
242 |
echo '</form>'; |
|
243 |
||
244 |
echo '<script type="text/javascript">cpGenPreviewUrl();</script>'; |
|
245 |
||
246 |
$template->footer(); |
|
247 |
} |
|
248 |
||
249 |
function page_Special_CreatePage_Old() |
|
250 |
{ |
|
251 |
global $db, $session, $paths, $template, $plugins; // Common objects |
|
252 |
global $lang; |
|
253 |
||
0 | 254 |
if ( isset($_POST['do']) ) |
255 |
{ |
|
256 |
$p = $_POST['pagename']; |
|
257 |
$k = array_keys($paths->nslist); |
|
258 |
for ( $i = 0; $i < sizeof( $paths->nslist ); $i++ ) |
|
259 |
{ |
|
260 |
$ln = strlen( $paths->nslist[$k[$i]] ); |
|
261 |
if ( substr($p, 0, $ln) == $paths->nslist[$k[$i]] ) |
|
262 |
{ |
|
263 |
$namespace = $k[$i]; |
|
264 |
} |
|
265 |
} |
|
266 |
if ( $namespace == 'Special' || ( $namespace == 'System' && $session->user_level < USER_LEVEL_ADMIN ) || $namespace == 'Admin') |
|
267 |
{ |
|
268 |
$template->header(); |
|
269 |
||
335
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
334
diff
changeset
|
270 |
echo '<h3>' . $lang->get('pagetools_create_err_title') . '</h3> |
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
334
diff
changeset
|
271 |
<p>' . $lang->get('pagetools_create_err_name_invalid', array('page_name' => htmlspecialchars($p))) . '</p>'; |
0 | 272 |
|
273 |
$template->footer(); |
|
274 |
$db->close(); |
|
275 |
||
276 |
exit; |
|
277 |
} |
|
278 |
$name = $db->escape(str_replace('_', ' ', $p)); |
|
22
d0314575e2f0
More preliminary l10n work; userpage portal style basics implemented
Dan
parents:
0
diff
changeset
|
279 |
$urlname = str_replace(' ', '_', $p); |
0 | 280 |
$namespace = $_POST['namespace']; |
281 |
if ( $namespace == 'Special' || ( $namespace == 'System' && $session->user_level < USER_LEVEL_ADMIN ) || $namespace == 'Admin') |
|
282 |
{ |
|
283 |
$template->header(); |
|
284 |
||
335
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
334
diff
changeset
|
285 |
echo '<h3>' . $lang->get('pagetools_create_err_title') . '</h3> |
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
334
diff
changeset
|
286 |
<p>' . $lang->get('pagetools_create_err_name_invalid', array('page_name' => htmlspecialchars($paths->nslist[$namespace].$p))) . '</p>'; |
0 | 287 |
|
288 |
$template->footer(); |
|
289 |
$db->close(); |
|
290 |
||
291 |
exit; |
|
292 |
} |
|
315
f49e3c8b638c
Fixed focus of AJAX login form fields in IE; removed stale/unused call to $template->makeParserText() in paginate_array(); added hook page_create_request to possibly help control creation of pages of certain namespaces from plugins; fixed critical bug in user CP that prevented plugins from adding custom CP modules
Dan
parents:
285
diff
changeset
|
293 |
$code = $plugins->setHook('page_create_request'); |
f49e3c8b638c
Fixed focus of AJAX login form fields in IE; removed stale/unused call to $template->makeParserText() in paginate_array(); added hook page_create_request to possibly help control creation of pages of certain namespaces from plugins; fixed critical bug in user CP that prevented plugins from adding custom CP modules
Dan
parents:
285
diff
changeset
|
294 |
foreach ( $code as $cmd ) |
f49e3c8b638c
Fixed focus of AJAX login form fields in IE; removed stale/unused call to $template->makeParserText() in paginate_array(); added hook page_create_request to possibly help control creation of pages of certain namespaces from plugins; fixed critical bug in user CP that prevented plugins from adding custom CP modules
Dan
parents:
285
diff
changeset
|
295 |
{ |
f49e3c8b638c
Fixed focus of AJAX login form fields in IE; removed stale/unused call to $template->makeParserText() in paginate_array(); added hook page_create_request to possibly help control creation of pages of certain namespaces from plugins; fixed critical bug in user CP that prevented plugins from adding custom CP modules
Dan
parents:
285
diff
changeset
|
296 |
eval($cmd); |
f49e3c8b638c
Fixed focus of AJAX login form fields in IE; removed stale/unused call to $template->makeParserText() in paginate_array(); added hook page_create_request to possibly help control creation of pages of certain namespaces from plugins; fixed critical bug in user CP that prevented plugins from adding custom CP modules
Dan
parents:
285
diff
changeset
|
297 |
} |
194
bf0fdec102e9
SECURITY: Fixed possible SQL injection in PageUtils page protection; general cleanup of PageUtils; blocked using Project: prefix for page URL strings
Dan
parents:
192
diff
changeset
|
298 |
if ( substr($urlname, 0, 8) == 'Project:' ) |
bf0fdec102e9
SECURITY: Fixed possible SQL injection in PageUtils page protection; general cleanup of PageUtils; blocked using Project: prefix for page URL strings
Dan
parents:
192
diff
changeset
|
299 |
{ |
bf0fdec102e9
SECURITY: Fixed possible SQL injection in PageUtils page protection; general cleanup of PageUtils; blocked using Project: prefix for page URL strings
Dan
parents:
192
diff
changeset
|
300 |
$template->header(); |
bf0fdec102e9
SECURITY: Fixed possible SQL injection in PageUtils page protection; general cleanup of PageUtils; blocked using Project: prefix for page URL strings
Dan
parents:
192
diff
changeset
|
301 |
|
335
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
334
diff
changeset
|
302 |
echo '<h3>' . $lang->get('pagetools_create_err_title') . '</h3> |
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
334
diff
changeset
|
303 |
<p>' . $lang->get('pagetools_create_err_project_shortcut', array('page_name' => htmlspecialchars($p))) . '</p>'; |
194
bf0fdec102e9
SECURITY: Fixed possible SQL injection in PageUtils page protection; general cleanup of PageUtils; blocked using Project: prefix for page URL strings
Dan
parents:
192
diff
changeset
|
304 |
|
bf0fdec102e9
SECURITY: Fixed possible SQL injection in PageUtils page protection; general cleanup of PageUtils; blocked using Project: prefix for page URL strings
Dan
parents:
192
diff
changeset
|
305 |
$template->footer(); |
bf0fdec102e9
SECURITY: Fixed possible SQL injection in PageUtils page protection; general cleanup of PageUtils; blocked using Project: prefix for page URL strings
Dan
parents:
192
diff
changeset
|
306 |
$db->close(); |
bf0fdec102e9
SECURITY: Fixed possible SQL injection in PageUtils page protection; general cleanup of PageUtils; blocked using Project: prefix for page URL strings
Dan
parents:
192
diff
changeset
|
307 |
|
bf0fdec102e9
SECURITY: Fixed possible SQL injection in PageUtils page protection; general cleanup of PageUtils; blocked using Project: prefix for page URL strings
Dan
parents:
192
diff
changeset
|
308 |
exit; |
bf0fdec102e9
SECURITY: Fixed possible SQL injection in PageUtils page protection; general cleanup of PageUtils; blocked using Project: prefix for page URL strings
Dan
parents:
192
diff
changeset
|
309 |
} |
0 | 310 |
|
311 |
$tn = $paths->nslist[$_POST['namespace']] . $urlname; |
|
312 |
if ( isset($paths->pages[$tn]) ) |
|
313 |
{ |
|
335
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
334
diff
changeset
|
314 |
die_friendly($lang->get('pagetools_create_err_title'), '<p>' . $lang->get('pagetools_create_err_already_exist') . '</p>'); |
0 | 315 |
} |
316 |
||
317 |
if ( $paths->nslist[$namespace] == substr($urlname, 0, strlen($paths->nslist[$namespace]) ) ) |
|
318 |
{ |
|
319 |
$urlname = substr($urlname, strlen($paths->nslist[$namespace]), strlen($urlname)); |
|
320 |
} |
|
321 |
||
322 |
$k = array_keys( $paths->nslist ); |
|
323 |
if(!in_array($_POST['namespace'], $k)) |
|
324 |
{ |
|
325 |
$db->_die('An SQL injection attempt was caught at '.dirname(__FILE__).':'.__LINE__.'.'); |
|
326 |
} |
|
327 |
||
112
008b1c42be72
Rewrote all code related to delvote_ips column to use serialize()
Dan
parents:
91
diff
changeset
|
328 |
$ips = array( |
008b1c42be72
Rewrote all code related to delvote_ips column to use serialize()
Dan
parents:
91
diff
changeset
|
329 |
'ip' => array(), |
008b1c42be72
Rewrote all code related to delvote_ips column to use serialize()
Dan
parents:
91
diff
changeset
|
330 |
'u' => array() |
008b1c42be72
Rewrote all code related to delvote_ips column to use serialize()
Dan
parents:
91
diff
changeset
|
331 |
); |
008b1c42be72
Rewrote all code related to delvote_ips column to use serialize()
Dan
parents:
91
diff
changeset
|
332 |
$ips = $db->escape(serialize($ips)); |
008b1c42be72
Rewrote all code related to delvote_ips column to use serialize()
Dan
parents:
91
diff
changeset
|
333 |
|
22
d0314575e2f0
More preliminary l10n work; userpage portal style basics implemented
Dan
parents:
0
diff
changeset
|
334 |
$urlname = sanitize_page_id($urlname); |
d0314575e2f0
More preliminary l10n work; userpage portal style basics implemented
Dan
parents:
0
diff
changeset
|
335 |
$urlname = $db->escape($urlname); |
d0314575e2f0
More preliminary l10n work; userpage portal style basics implemented
Dan
parents:
0
diff
changeset
|
336 |
|
0 | 337 |
$perms = $session->fetch_page_acl($urlname, $namespace); |
338 |
if ( !$perms->get_permissions('create_page') ) |
|
335
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
334
diff
changeset
|
339 |
die_friendly($lang->get('pagetools_create_err_title'), '<p>An access control rule is preventing you from creating pages.</p>'); |
0 | 340 |
|
345
4ccdfeee9a11
WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents:
343
diff
changeset
|
341 |
$q = $db->sql_query('INSERT INTO '.table_prefix.'logs(time_id,date_string,log_type,action,author,page_id,namespace) VALUES('.time().', \''.enano_date('d M Y h:i a').'\', \'page\', \'create\', \''.$session->username.'\', \''.$urlname.'\', \''.$_POST['namespace'].'\');'); |
0 | 342 |
if ( !$q ) |
343 |
{ |
|
344 |
$db->_die('The page log could not be updated.'); |
|
345 |
} |
|
346 |
||
112
008b1c42be72
Rewrote all code related to delvote_ips column to use serialize()
Dan
parents:
91
diff
changeset
|
347 |
$q = $db->sql_query('INSERT INTO '.table_prefix.'pages(name,urlname,namespace,delvote_ips) VALUES(\''.$name.'\', \''.$urlname.'\', \''.$_POST['namespace'].'\',\'' . $ips . '\');'); |
0 | 348 |
if ( !$q ) |
349 |
{ |
|
350 |
$db->_die('The page entry could not be inserted.'); |
|
351 |
} |
|
157
6df5f7a55a30
Creating pages doesn't insert that crappy javascript hack anymore
Dan
parents:
132
diff
changeset
|
352 |
$q = $db->sql_query('INSERT INTO '.table_prefix.'page_text(page_id,namespace,page_text) VALUES(\''.$urlname.'\', \''.$_POST['namespace'].'\', \''.'\');'); |
0 | 353 |
if ( !$q ) |
354 |
{ |
|
355 |
$db->_die('The page text entry could not be inserted.'); |
|
356 |
} |
|
357 |
||
157
6df5f7a55a30
Creating pages doesn't insert that crappy javascript hack anymore
Dan
parents:
132
diff
changeset
|
358 |
header('Location: '.makeUrlNS($_POST['namespace'], sanitize_page_id($p)) . '#do:edit'); |
0 | 359 |
exit; |
360 |
} |
|
361 |
$template->header(); |
|
285
7846d45bd250
Changed all urlname/page_id columns to varchar(255) because 63 characters just isn't long enough
Dan
parents:
194
diff
changeset
|
362 |
/* |
0 | 363 |
if ( !$session->get_permissions('create_page') ) |
364 |
{ |
|
365 |
echo 'Wiki mode is disabled, only admins can create pages.'; |
|
366 |
||
367 |
$template->footer(); |
|
368 |
$db->close(); |
|
369 |
||
370 |
exit; |
|
371 |
} |
|
285
7846d45bd250
Changed all urlname/page_id columns to varchar(255) because 63 characters just isn't long enough
Dan
parents:
194
diff
changeset
|
372 |
*/ |
335
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
334
diff
changeset
|
373 |
echo '<p>' . $lang->get('pagetools_create_blurb') . '</p>'; |
0 | 374 |
?> |
375 |
<form action="" method="post"> |
|
376 |
<p> |
|
377 |
<select name="namespace"> |
|
378 |
<?php |
|
379 |
$k = array_keys($paths->nslist); |
|
380 |
for ( $i = 0; $i < sizeof($k); $i++ ) |
|
381 |
{ |
|
382 |
if ( $paths->nslist[$k[$i]] == '' ) |
|
383 |
{ |
|
335
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
334
diff
changeset
|
384 |
$s = $lang->get('pagetools_create_namespace_none'); |
0 | 385 |
} |
386 |
else |
|
387 |
{ |
|
388 |
$s = $paths->nslist[$k[$i]]; |
|
389 |
} |
|
390 |
if ( ( $k[$i] != 'System' || $session->user_level >= USER_LEVEL_ADMIN ) && $k[$i] != 'Admin' && $k[$i] != 'Special') |
|
391 |
{ |
|
392 |
echo '<option value="'.$k[$i].'">'.$s.'</option>'; |
|
393 |
} |
|
394 |
} |
|
395 |
?> |
|
396 |
</select> <input type="text" name="pagename" /></p> |
|
335
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
334
diff
changeset
|
397 |
<p><input type="submit" name="do" value="<?php echo $lang->get('pagetools_create_btn_create'); ?>" /></p> |
0 | 398 |
</form> |
399 |
<?php |
|
400 |
$template->footer(); |
|
401 |
} |
|
402 |
||
116
77c75179bb95
Made most special pages "visible"; fixup for non-existent special page redirect in paths.php; rewrote Special:AllPages to have pagination (WiP, Special:SpecialPages is possibly next, depending on whether paginate_array works or not)
Dan
parents:
112
diff
changeset
|
403 |
function PagelistingFormatter($id, $row) |
77c75179bb95
Made most special pages "visible"; fixup for non-existent special page redirect in paths.php; rewrote Special:AllPages to have pagination (WiP, Special:SpecialPages is possibly next, depending on whether paginate_array works or not)
Dan
parents:
112
diff
changeset
|
404 |
{ |
77c75179bb95
Made most special pages "visible"; fixup for non-existent special page redirect in paths.php; rewrote Special:AllPages to have pagination (WiP, Special:SpecialPages is possibly next, depending on whether paginate_array works or not)
Dan
parents:
112
diff
changeset
|
405 |
global $db, $session, $paths, $template, $plugins; // Common objects |
77c75179bb95
Made most special pages "visible"; fixup for non-existent special page redirect in paths.php; rewrote Special:AllPages to have pagination (WiP, Special:SpecialPages is possibly next, depending on whether paginate_array works or not)
Dan
parents:
112
diff
changeset
|
406 |
static $rowtracker = 0; |
77c75179bb95
Made most special pages "visible"; fixup for non-existent special page redirect in paths.php; rewrote Special:AllPages to have pagination (WiP, Special:SpecialPages is possibly next, depending on whether paginate_array works or not)
Dan
parents:
112
diff
changeset
|
407 |
static $tdclass = 'row2'; |
77c75179bb95
Made most special pages "visible"; fixup for non-existent special page redirect in paths.php; rewrote Special:AllPages to have pagination (WiP, Special:SpecialPages is possibly next, depending on whether paginate_array works or not)
Dan
parents:
112
diff
changeset
|
408 |
static $per_row = 2; |
117
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
116
diff
changeset
|
409 |
static $first = true; |
116
77c75179bb95
Made most special pages "visible"; fixup for non-existent special page redirect in paths.php; rewrote Special:AllPages to have pagination (WiP, Special:SpecialPages is possibly next, depending on whether paginate_array works or not)
Dan
parents:
112
diff
changeset
|
410 |
$return = ''; |
117
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
116
diff
changeset
|
411 |
if ( $id === false && $row === false ) |
116
77c75179bb95
Made most special pages "visible"; fixup for non-existent special page redirect in paths.php; rewrote Special:AllPages to have pagination (WiP, Special:SpecialPages is possibly next, depending on whether paginate_array works or not)
Dan
parents:
112
diff
changeset
|
412 |
{ |
77c75179bb95
Made most special pages "visible"; fixup for non-existent special page redirect in paths.php; rewrote Special:AllPages to have pagination (WiP, Special:SpecialPages is possibly next, depending on whether paginate_array works or not)
Dan
parents:
112
diff
changeset
|
413 |
$rowtracker = 0; |
117
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
116
diff
changeset
|
414 |
$first = true; |
116
77c75179bb95
Made most special pages "visible"; fixup for non-existent special page redirect in paths.php; rewrote Special:AllPages to have pagination (WiP, Special:SpecialPages is possibly next, depending on whether paginate_array works or not)
Dan
parents:
112
diff
changeset
|
415 |
return false; |
77c75179bb95
Made most special pages "visible"; fixup for non-existent special page redirect in paths.php; rewrote Special:AllPages to have pagination (WiP, Special:SpecialPages is possibly next, depending on whether paginate_array works or not)
Dan
parents:
112
diff
changeset
|
416 |
} |
77c75179bb95
Made most special pages "visible"; fixup for non-existent special page redirect in paths.php; rewrote Special:AllPages to have pagination (WiP, Special:SpecialPages is possibly next, depending on whether paginate_array works or not)
Dan
parents:
112
diff
changeset
|
417 |
$rowtracker++; |
117
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
116
diff
changeset
|
418 |
if ( $rowtracker == $per_row || $first ) |
116
77c75179bb95
Made most special pages "visible"; fixup for non-existent special page redirect in paths.php; rewrote Special:AllPages to have pagination (WiP, Special:SpecialPages is possibly next, depending on whether paginate_array works or not)
Dan
parents:
112
diff
changeset
|
419 |
{ |
77c75179bb95
Made most special pages "visible"; fixup for non-existent special page redirect in paths.php; rewrote Special:AllPages to have pagination (WiP, Special:SpecialPages is possibly next, depending on whether paginate_array works or not)
Dan
parents:
112
diff
changeset
|
420 |
$rowtracker = 0; |
77c75179bb95
Made most special pages "visible"; fixup for non-existent special page redirect in paths.php; rewrote Special:AllPages to have pagination (WiP, Special:SpecialPages is possibly next, depending on whether paginate_array works or not)
Dan
parents:
112
diff
changeset
|
421 |
$tdclass = ( $tdclass == 'row2' ) ? 'row1' : 'row2'; |
77c75179bb95
Made most special pages "visible"; fixup for non-existent special page redirect in paths.php; rewrote Special:AllPages to have pagination (WiP, Special:SpecialPages is possibly next, depending on whether paginate_array works or not)
Dan
parents:
112
diff
changeset
|
422 |
} |
117
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
116
diff
changeset
|
423 |
if ( $rowtracker == 0 && !$first ) |
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
116
diff
changeset
|
424 |
$return .= "</tr>\n<tr>"; |
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
116
diff
changeset
|
425 |
|
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
116
diff
changeset
|
426 |
$first = false; |
116
77c75179bb95
Made most special pages "visible"; fixup for non-existent special page redirect in paths.php; rewrote Special:AllPages to have pagination (WiP, Special:SpecialPages is possibly next, depending on whether paginate_array works or not)
Dan
parents:
112
diff
changeset
|
427 |
|
77c75179bb95
Made most special pages "visible"; fixup for non-existent special page redirect in paths.php; rewrote Special:AllPages to have pagination (WiP, Special:SpecialPages is possibly next, depending on whether paginate_array works or not)
Dan
parents:
112
diff
changeset
|
428 |
preg_match('/^ns=(' . implode('|', array_keys($paths->nslist)) . ');pid=(.*?)$/i', $id, $match); |
77c75179bb95
Made most special pages "visible"; fixup for non-existent special page redirect in paths.php; rewrote Special:AllPages to have pagination (WiP, Special:SpecialPages is possibly next, depending on whether paginate_array works or not)
Dan
parents:
112
diff
changeset
|
429 |
$namespace =& $match[1]; |
77c75179bb95
Made most special pages "visible"; fixup for non-existent special page redirect in paths.php; rewrote Special:AllPages to have pagination (WiP, Special:SpecialPages is possibly next, depending on whether paginate_array works or not)
Dan
parents:
112
diff
changeset
|
430 |
$page_id =& $match[2]; |
77c75179bb95
Made most special pages "visible"; fixup for non-existent special page redirect in paths.php; rewrote Special:AllPages to have pagination (WiP, Special:SpecialPages is possibly next, depending on whether paginate_array works or not)
Dan
parents:
112
diff
changeset
|
431 |
$page_id = sanitize_page_id($page_id); |
77c75179bb95
Made most special pages "visible"; fixup for non-existent special page redirect in paths.php; rewrote Special:AllPages to have pagination (WiP, Special:SpecialPages is possibly next, depending on whether paginate_array works or not)
Dan
parents:
112
diff
changeset
|
432 |
|
77c75179bb95
Made most special pages "visible"; fixup for non-existent special page redirect in paths.php; rewrote Special:AllPages to have pagination (WiP, Special:SpecialPages is possibly next, depending on whether paginate_array works or not)
Dan
parents:
112
diff
changeset
|
433 |
$url = makeUrlNS($namespace, $page_id); |
77c75179bb95
Made most special pages "visible"; fixup for non-existent special page redirect in paths.php; rewrote Special:AllPages to have pagination (WiP, Special:SpecialPages is possibly next, depending on whether paginate_array works or not)
Dan
parents:
112
diff
changeset
|
434 |
$url = htmlspecialchars($url); |
77c75179bb95
Made most special pages "visible"; fixup for non-existent special page redirect in paths.php; rewrote Special:AllPages to have pagination (WiP, Special:SpecialPages is possibly next, depending on whether paginate_array works or not)
Dan
parents:
112
diff
changeset
|
435 |
|
77c75179bb95
Made most special pages "visible"; fixup for non-existent special page redirect in paths.php; rewrote Special:AllPages to have pagination (WiP, Special:SpecialPages is possibly next, depending on whether paginate_array works or not)
Dan
parents:
112
diff
changeset
|
436 |
$link = '<a href="' . $url . '">' . htmlspecialchars($row['name']) . '</a>'; |
77c75179bb95
Made most special pages "visible"; fixup for non-existent special page redirect in paths.php; rewrote Special:AllPages to have pagination (WiP, Special:SpecialPages is possibly next, depending on whether paginate_array works or not)
Dan
parents:
112
diff
changeset
|
437 |
$td = '<td class="' . $tdclass . '" style="width: 50%;">' . $link . '</td>'; |
77c75179bb95
Made most special pages "visible"; fixup for non-existent special page redirect in paths.php; rewrote Special:AllPages to have pagination (WiP, Special:SpecialPages is possibly next, depending on whether paginate_array works or not)
Dan
parents:
112
diff
changeset
|
438 |
|
77c75179bb95
Made most special pages "visible"; fixup for non-existent special page redirect in paths.php; rewrote Special:AllPages to have pagination (WiP, Special:SpecialPages is possibly next, depending on whether paginate_array works or not)
Dan
parents:
112
diff
changeset
|
439 |
$return .= $td; |
77c75179bb95
Made most special pages "visible"; fixup for non-existent special page redirect in paths.php; rewrote Special:AllPages to have pagination (WiP, Special:SpecialPages is possibly next, depending on whether paginate_array works or not)
Dan
parents:
112
diff
changeset
|
440 |
|
77c75179bb95
Made most special pages "visible"; fixup for non-existent special page redirect in paths.php; rewrote Special:AllPages to have pagination (WiP, Special:SpecialPages is possibly next, depending on whether paginate_array works or not)
Dan
parents:
112
diff
changeset
|
441 |
return $return; |
77c75179bb95
Made most special pages "visible"; fixup for non-existent special page redirect in paths.php; rewrote Special:AllPages to have pagination (WiP, Special:SpecialPages is possibly next, depending on whether paginate_array works or not)
Dan
parents:
112
diff
changeset
|
442 |
} |
77c75179bb95
Made most special pages "visible"; fixup for non-existent special page redirect in paths.php; rewrote Special:AllPages to have pagination (WiP, Special:SpecialPages is possibly next, depending on whether paginate_array works or not)
Dan
parents:
112
diff
changeset
|
443 |
|
0 | 444 |
function page_Special_AllPages() |
445 |
{ |
|
446 |
// This should be an easy one |
|
447 |
global $db, $session, $paths, $template, $plugins; // Common objects |
|
335
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
334
diff
changeset
|
448 |
global $lang; |
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
334
diff
changeset
|
449 |
|
0 | 450 |
$template->header(); |
451 |
$sz = sizeof( $paths->pages ) / 2; |
|
335
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
334
diff
changeset
|
452 |
echo '<p>' . $lang->get('pagetools_allpages_blurb') . '</p>'; |
116
77c75179bb95
Made most special pages "visible"; fixup for non-existent special page redirect in paths.php; rewrote Special:AllPages to have pagination (WiP, Special:SpecialPages is possibly next, depending on whether paginate_array works or not)
Dan
parents:
112
diff
changeset
|
453 |
|
77c75179bb95
Made most special pages "visible"; fixup for non-existent special page redirect in paths.php; rewrote Special:AllPages to have pagination (WiP, Special:SpecialPages is possibly next, depending on whether paginate_array works or not)
Dan
parents:
112
diff
changeset
|
454 |
$q = $db->sql_query('SELECT COUNT(urlname) FROM '.table_prefix.'pages WHERE visible!=0;'); |
77c75179bb95
Made most special pages "visible"; fixup for non-existent special page redirect in paths.php; rewrote Special:AllPages to have pagination (WiP, Special:SpecialPages is possibly next, depending on whether paginate_array works or not)
Dan
parents:
112
diff
changeset
|
455 |
if ( !$q ) |
77c75179bb95
Made most special pages "visible"; fixup for non-existent special page redirect in paths.php; rewrote Special:AllPages to have pagination (WiP, Special:SpecialPages is possibly next, depending on whether paginate_array works or not)
Dan
parents:
112
diff
changeset
|
456 |
$db->_die(); |
77c75179bb95
Made most special pages "visible"; fixup for non-existent special page redirect in paths.php; rewrote Special:AllPages to have pagination (WiP, Special:SpecialPages is possibly next, depending on whether paginate_array works or not)
Dan
parents:
112
diff
changeset
|
457 |
$row = $db->fetchrow_num(); |
77c75179bb95
Made most special pages "visible"; fixup for non-existent special page redirect in paths.php; rewrote Special:AllPages to have pagination (WiP, Special:SpecialPages is possibly next, depending on whether paginate_array works or not)
Dan
parents:
112
diff
changeset
|
458 |
$count = $row[0]; |
117
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
116
diff
changeset
|
459 |
|
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
116
diff
changeset
|
460 |
switch($count % 4) |
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
116
diff
changeset
|
461 |
{ |
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
116
diff
changeset
|
462 |
case 0: |
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
116
diff
changeset
|
463 |
case 2: |
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
116
diff
changeset
|
464 |
// even number of results; do nothing |
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
116
diff
changeset
|
465 |
$last_cell = ''; |
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
116
diff
changeset
|
466 |
break; |
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
116
diff
changeset
|
467 |
case 1: |
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
116
diff
changeset
|
468 |
// odd number of results and odd number of rows, use row1 |
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
116
diff
changeset
|
469 |
$last_cell = '<td class="row1"></td>'; |
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
116
diff
changeset
|
470 |
break; |
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
116
diff
changeset
|
471 |
case 3: |
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
116
diff
changeset
|
472 |
// odd number of results and even number of rows, use row2 |
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
116
diff
changeset
|
473 |
$last_cell = '<td class="row2"></td>'; |
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
116
diff
changeset
|
474 |
break; |
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
116
diff
changeset
|
475 |
} |
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
116
diff
changeset
|
476 |
|
116
77c75179bb95
Made most special pages "visible"; fixup for non-existent special page redirect in paths.php; rewrote Special:AllPages to have pagination (WiP, Special:SpecialPages is possibly next, depending on whether paginate_array works or not)
Dan
parents:
112
diff
changeset
|
477 |
$db->free_result(); |
77c75179bb95
Made most special pages "visible"; fixup for non-existent special page redirect in paths.php; rewrote Special:AllPages to have pagination (WiP, Special:SpecialPages is possibly next, depending on whether paginate_array works or not)
Dan
parents:
112
diff
changeset
|
478 |
|
77c75179bb95
Made most special pages "visible"; fixup for non-existent special page redirect in paths.php; rewrote Special:AllPages to have pagination (WiP, Special:SpecialPages is possibly next, depending on whether paginate_array works or not)
Dan
parents:
112
diff
changeset
|
479 |
$q = $db->sql_unbuffered_query('SELECT CONCAT("ns=",namespace,";pid=",urlname) AS identifier, name FROM '.table_prefix.'pages WHERE visible!=0 ORDER BY name ASC;'); |
77c75179bb95
Made most special pages "visible"; fixup for non-existent special page redirect in paths.php; rewrote Special:AllPages to have pagination (WiP, Special:SpecialPages is possibly next, depending on whether paginate_array works or not)
Dan
parents:
112
diff
changeset
|
480 |
if ( !$q ) |
77c75179bb95
Made most special pages "visible"; fixup for non-existent special page redirect in paths.php; rewrote Special:AllPages to have pagination (WiP, Special:SpecialPages is possibly next, depending on whether paginate_array works or not)
Dan
parents:
112
diff
changeset
|
481 |
$db->_die(); |
77c75179bb95
Made most special pages "visible"; fixup for non-existent special page redirect in paths.php; rewrote Special:AllPages to have pagination (WiP, Special:SpecialPages is possibly next, depending on whether paginate_array works or not)
Dan
parents:
112
diff
changeset
|
482 |
|
77c75179bb95
Made most special pages "visible"; fixup for non-existent special page redirect in paths.php; rewrote Special:AllPages to have pagination (WiP, Special:SpecialPages is possibly next, depending on whether paginate_array works or not)
Dan
parents:
112
diff
changeset
|
483 |
$offset = ( isset($_GET['offset']) ) ? intval($_GET['offset']) : 0; |
77c75179bb95
Made most special pages "visible"; fixup for non-existent special page redirect in paths.php; rewrote Special:AllPages to have pagination (WiP, Special:SpecialPages is possibly next, depending on whether paginate_array works or not)
Dan
parents:
112
diff
changeset
|
484 |
|
77c75179bb95
Made most special pages "visible"; fixup for non-existent special page redirect in paths.php; rewrote Special:AllPages to have pagination (WiP, Special:SpecialPages is possibly next, depending on whether paginate_array works or not)
Dan
parents:
112
diff
changeset
|
485 |
// reset formatter |
77c75179bb95
Made most special pages "visible"; fixup for non-existent special page redirect in paths.php; rewrote Special:AllPages to have pagination (WiP, Special:SpecialPages is possibly next, depending on whether paginate_array works or not)
Dan
parents:
112
diff
changeset
|
486 |
PagelistingFormatter(false, false); |
77c75179bb95
Made most special pages "visible"; fixup for non-existent special page redirect in paths.php; rewrote Special:AllPages to have pagination (WiP, Special:SpecialPages is possibly next, depending on whether paginate_array works or not)
Dan
parents:
112
diff
changeset
|
487 |
|
77c75179bb95
Made most special pages "visible"; fixup for non-existent special page redirect in paths.php; rewrote Special:AllPages to have pagination (WiP, Special:SpecialPages is possibly next, depending on whether paginate_array works or not)
Dan
parents:
112
diff
changeset
|
488 |
$result = paginate( |
77c75179bb95
Made most special pages "visible"; fixup for non-existent special page redirect in paths.php; rewrote Special:AllPages to have pagination (WiP, Special:SpecialPages is possibly next, depending on whether paginate_array works or not)
Dan
parents:
112
diff
changeset
|
489 |
$q, // result resource |
77c75179bb95
Made most special pages "visible"; fixup for non-existent special page redirect in paths.php; rewrote Special:AllPages to have pagination (WiP, Special:SpecialPages is possibly next, depending on whether paginate_array works or not)
Dan
parents:
112
diff
changeset
|
490 |
'{identifier}', // formatting template |
77c75179bb95
Made most special pages "visible"; fixup for non-existent special page redirect in paths.php; rewrote Special:AllPages to have pagination (WiP, Special:SpecialPages is possibly next, depending on whether paginate_array works or not)
Dan
parents:
112
diff
changeset
|
491 |
$count, // # of results |
77c75179bb95
Made most special pages "visible"; fixup for non-existent special page redirect in paths.php; rewrote Special:AllPages to have pagination (WiP, Special:SpecialPages is possibly next, depending on whether paginate_array works or not)
Dan
parents:
112
diff
changeset
|
492 |
makeUrlNS('Special', 'AllPages', 'offset=%s'), // result URL |
77c75179bb95
Made most special pages "visible"; fixup for non-existent special page redirect in paths.php; rewrote Special:AllPages to have pagination (WiP, Special:SpecialPages is possibly next, depending on whether paginate_array works or not)
Dan
parents:
112
diff
changeset
|
493 |
$offset, // start offset |
77c75179bb95
Made most special pages "visible"; fixup for non-existent special page redirect in paths.php; rewrote Special:AllPages to have pagination (WiP, Special:SpecialPages is possibly next, depending on whether paginate_array works or not)
Dan
parents:
112
diff
changeset
|
494 |
40, // results per page |
77c75179bb95
Made most special pages "visible"; fixup for non-existent special page redirect in paths.php; rewrote Special:AllPages to have pagination (WiP, Special:SpecialPages is possibly next, depending on whether paginate_array works or not)
Dan
parents:
112
diff
changeset
|
495 |
array( 'identifier' => 'PagelistingFormatter' ), // hooks |
77c75179bb95
Made most special pages "visible"; fixup for non-existent special page redirect in paths.php; rewrote Special:AllPages to have pagination (WiP, Special:SpecialPages is possibly next, depending on whether paginate_array works or not)
Dan
parents:
112
diff
changeset
|
496 |
'<div class="tblholder"> |
77c75179bb95
Made most special pages "visible"; fixup for non-existent special page redirect in paths.php; rewrote Special:AllPages to have pagination (WiP, Special:SpecialPages is possibly next, depending on whether paginate_array works or not)
Dan
parents:
112
diff
changeset
|
497 |
<table border="0" cellspacing="1" cellpadding="4"> |
77c75179bb95
Made most special pages "visible"; fixup for non-existent special page redirect in paths.php; rewrote Special:AllPages to have pagination (WiP, Special:SpecialPages is possibly next, depending on whether paginate_array works or not)
Dan
parents:
112
diff
changeset
|
498 |
<tr>', // print at start |
117
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
116
diff
changeset
|
499 |
' ' . $last_cell . '</tr> |
116
77c75179bb95
Made most special pages "visible"; fixup for non-existent special page redirect in paths.php; rewrote Special:AllPages to have pagination (WiP, Special:SpecialPages is possibly next, depending on whether paginate_array works or not)
Dan
parents:
112
diff
changeset
|
500 |
</table> |
77c75179bb95
Made most special pages "visible"; fixup for non-existent special page redirect in paths.php; rewrote Special:AllPages to have pagination (WiP, Special:SpecialPages is possibly next, depending on whether paginate_array works or not)
Dan
parents:
112
diff
changeset
|
501 |
</div>' // print at end |
77c75179bb95
Made most special pages "visible"; fixup for non-existent special page redirect in paths.php; rewrote Special:AllPages to have pagination (WiP, Special:SpecialPages is possibly next, depending on whether paginate_array works or not)
Dan
parents:
112
diff
changeset
|
502 |
); |
77c75179bb95
Made most special pages "visible"; fixup for non-existent special page redirect in paths.php; rewrote Special:AllPages to have pagination (WiP, Special:SpecialPages is possibly next, depending on whether paginate_array works or not)
Dan
parents:
112
diff
changeset
|
503 |
|
77c75179bb95
Made most special pages "visible"; fixup for non-existent special page redirect in paths.php; rewrote Special:AllPages to have pagination (WiP, Special:SpecialPages is possibly next, depending on whether paginate_array works or not)
Dan
parents:
112
diff
changeset
|
504 |
echo $result; |
77c75179bb95
Made most special pages "visible"; fixup for non-existent special page redirect in paths.php; rewrote Special:AllPages to have pagination (WiP, Special:SpecialPages is possibly next, depending on whether paginate_array works or not)
Dan
parents:
112
diff
changeset
|
505 |
|
0 | 506 |
$template->footer(); |
507 |
} |
|
508 |
||
509 |
function page_Special_SpecialPages() |
|
510 |
{ |
|
511 |
// This should be an easy one |
|
512 |
global $db, $session, $paths, $template, $plugins; // Common objects |
|
345
4ccdfeee9a11
WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents:
343
diff
changeset
|
513 |
global $lang; |
4ccdfeee9a11
WiP commit for admin panel localization. All modules up to Admin:UserManager (working down the list) are localized except Admin:ThemeManager, which is due for a rewrite
Dan
parents:
343
diff
changeset
|
514 |
|
0 | 515 |
$template->header(); |
516 |
$sz = sizeof($paths->pages) / 2; |
|
335
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
334
diff
changeset
|
517 |
echo '<p>' . $lang->get('pagetools_specialpages_blurb') . '</p><div class="tblholder"><table border="0" width="100%" cellspacing="1" cellpadding="4">'; |
0 | 518 |
$cclass='row1'; |
519 |
for ( $i = 0; $i < $sz; $i = $i) |
|
520 |
{ |
|
521 |
if ( $cclass == 'row1' ) |
|
522 |
{ |
|
523 |
$cclass = 'row3'; |
|
524 |
} |
|
525 |
else if ( $cclass == 'row3') |
|
526 |
{ |
|
527 |
$cclass='row1'; |
|
528 |
} |
|
529 |
echo '<tr>'; |
|
530 |
for ( $j = 0; $j < 2; $j = $j ) |
|
531 |
{ |
|
532 |
if ( $i < $sz && $paths->pages[$i]['namespace'] == 'Special' && $paths->pages[$i]['visible'] == 1) |
|
533 |
{ |
|
534 |
echo '<td style="width: 50%" class="'.$cclass.'"><a href="'.makeUrl($paths->pages[$i]['urlname']).'">'; |
|
535 |
echo $paths->pages[$i]['name'].'</a></td>'; |
|
536 |
$j++; |
|
537 |
} |
|
538 |
else if ( $i >= $sz ) |
|
539 |
{ |
|
540 |
echo '<td style="width: 50%" class="row2"></td>'; |
|
541 |
$j++; |
|
542 |
} |
|
543 |
$i++; |
|
544 |
} |
|
545 |
echo '</tr>'; |
|
546 |
} |
|
547 |
echo '</table></div>'; |
|
548 |
$template->footer(); |
|
549 |
} |
|
550 |
||
551 |
function page_Special_About_Enano() |
|
552 |
{ |
|
553 |
global $db, $session, $paths, $template, $plugins; // Common objects |
|
221
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
554 |
global $lang; |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
555 |
|
0 | 556 |
$platform = 'Unknown'; |
557 |
$uname = @file_get_contents('/proc/sys/kernel/ostype'); |
|
558 |
if($uname == "Linux\n") |
|
559 |
$platform = 'Linux'; |
|
560 |
else if(file_exists('/hurd/pfinet')) // I have a little experience with GNU/Hurd :-) http://hurdvm.enanocms.org/ |
|
561 |
$platform = 'GNU/Hurd'; |
|
562 |
else if(file_exists('C:\Windows\system32\ntoskrnl.exe')) |
|
563 |
$platform = 'Windows NT'; |
|
564 |
else if(file_exists('C:\Windows\system\krnl386.exe')) |
|
565 |
$platform = 'Windows 9x/DOS'; |
|
566 |
else if(file_exists('/bin/bash')) |
|
567 |
$platform = 'Other GNU/Mac OS X'; |
|
568 |
else if(is_dir('/bin')) |
|
569 |
$platform = 'Other POSIX'; |
|
570 |
$template->header(); |
|
571 |
?> |
|
572 |
<br /> |
|
573 |
<div class="tblholder"> |
|
574 |
<table border="0" cellspacing="1" cellpadding="4"> |
|
335
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
334
diff
changeset
|
575 |
<tr><th colspan="2" style="text-align: left;"><?php echo $lang->get('meta_enano_about_th'); ?></th></tr> |
221
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
576 |
<tr><td colspan="2" class="row3"> |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
577 |
<?php |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
578 |
echo $lang->get('meta_enano_about_poweredby'); |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
579 |
$subst = array( |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
580 |
'gpl_link' => makeUrlNS('Special', 'GNU_General_Public_License') |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
581 |
); |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
582 |
echo $lang->get('meta_enano_about_gpl', $subst); |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
583 |
if ( $lang->lang_code != 'eng' ): |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
584 |
// Do not remove this block of code. Doing so is a violation of the GPL. (A copy of the GPL in other languages |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
585 |
// must be accompanied by a copy of the English GPL.) |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
586 |
?> |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
587 |
<h3>(English)</h3> |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
588 |
<p> |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
589 |
This website is powered by <a href="http://enanocms.org/">Enano</a>, the lightweight and open source CMS that everyone can use. |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
590 |
Enano is copyright © 2006-2007 Dan Fuhry. For legal information, along with a list of libraries that Enano uses, please |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
591 |
see <a href="http://enanocms.org/Legal_information">Legal Information</a>. |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
592 |
</p> |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
593 |
<p> |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
594 |
The developers and maintainers of Enano strongly believe that software should not only be free to use, but free to be modified, |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
595 |
distributed, and used to create derivative works. For more information about Free Software, check out the |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
596 |
<a href="http://en.wikipedia.org/wiki/Free_Software" onclick="window.open(this.href); return false;">Wikipedia page</a> or |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
597 |
the <a href="http://www.fsf.org/" onclick="window.open(this.href); return false;">Free Software Foundation's</a> homepage. |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
598 |
</p> |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
599 |
<p> |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
600 |
This program is Free Software; you can redistribute it and/or modify it under the terms of the GNU General Public License |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
601 |
as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
602 |
</p> |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
603 |
<p> |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
604 |
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
605 |
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
606 |
</p> |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
607 |
<p> |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
608 |
You should have received <a href="<?php echo makeUrlNS('Special', 'GNU_General_Public_License'); ?>">a copy of |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
609 |
the GNU General Public License</a> along with this program; if not, write to: |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
610 |
</p> |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
611 |
<p style="margin-left 2em;"> |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
612 |
Free Software Foundation, Inc.,<br /> |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
613 |
51 Franklin Street, Fifth Floor<br /> |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
614 |
Boston, MA 02110-1301, USA |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
615 |
</p> |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
616 |
<p> |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
617 |
Alternatively, you can <a href="http://www.gnu.org/licenses/old-licenses/gpl-2.0.html">read it online</a>. |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
618 |
</p> |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
619 |
<?php |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
620 |
endif; |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
621 |
?> |
0 | 622 |
</td></tr> |
623 |
<tr> |
|
624 |
<td class="row2" colspan="2"> |
|
53 | 625 |
<table border="0" style="margin: 0 auto; background: none; width: 100%;" cellpadding="5"> |
0 | 626 |
<tr> |
53 | 627 |
<td style="text-align: center;"> |
87
570f68c3fe36
Redid stupid fading button code and fixed several RC2 bugs in the upgrade schema; 1.0.1 release candidate
Dan
parents:
85
diff
changeset
|
628 |
<?php echo $template->fading_button; ?> |
0 | 629 |
</td> |
630 |
<td style="text-align: center;"> |
|
631 |
<a href="http://www.php.net/" onclick="window.open(this.href); return false;" style="background: none; padding: 0;"> |
|
632 |
<img alt="Written in PHP" src="<?php echo scriptPath; ?>/images/about-powered-php.png" style="border-width: 0px;" width="88" height="31" /> |
|
633 |
</a> |
|
634 |
</td> |
|
635 |
<td style="text-align: center;"> |
|
322
5f1cd51bf1be
Many changes. Installer with PostgreSQL is broken badly and will be for some time.
Dan
parents:
317
diff
changeset
|
636 |
<?php |
5f1cd51bf1be
Many changes. Installer with PostgreSQL is broken badly and will be for some time.
Dan
parents:
317
diff
changeset
|
637 |
switch(ENANO_DBLAYER) |
5f1cd51bf1be
Many changes. Installer with PostgreSQL is broken badly and will be for some time.
Dan
parents:
317
diff
changeset
|
638 |
{ |
5f1cd51bf1be
Many changes. Installer with PostgreSQL is broken badly and will be for some time.
Dan
parents:
317
diff
changeset
|
639 |
case 'MYSQL': |
5f1cd51bf1be
Many changes. Installer with PostgreSQL is broken badly and will be for some time.
Dan
parents:
317
diff
changeset
|
640 |
?> |
5f1cd51bf1be
Many changes. Installer with PostgreSQL is broken badly and will be for some time.
Dan
parents:
317
diff
changeset
|
641 |
<a href="http://www.mysql.com/" onclick="window.open(this.href); return false;" style="background: none; padding: 0;"> |
5f1cd51bf1be
Many changes. Installer with PostgreSQL is broken badly and will be for some time.
Dan
parents:
317
diff
changeset
|
642 |
<img alt="Database engine powered by MySQL" src="<?php echo scriptPath; ?>/images/about-powered-mysql.png" style="border-width: 0px;" width="88" height="31" /> |
5f1cd51bf1be
Many changes. Installer with PostgreSQL is broken badly and will be for some time.
Dan
parents:
317
diff
changeset
|
643 |
</a> |
5f1cd51bf1be
Many changes. Installer with PostgreSQL is broken badly and will be for some time.
Dan
parents:
317
diff
changeset
|
644 |
<?php |
5f1cd51bf1be
Many changes. Installer with PostgreSQL is broken badly and will be for some time.
Dan
parents:
317
diff
changeset
|
645 |
break; |
5f1cd51bf1be
Many changes. Installer with PostgreSQL is broken badly and will be for some time.
Dan
parents:
317
diff
changeset
|
646 |
case 'PGSQL': |
5f1cd51bf1be
Many changes. Installer with PostgreSQL is broken badly and will be for some time.
Dan
parents:
317
diff
changeset
|
647 |
?> |
5f1cd51bf1be
Many changes. Installer with PostgreSQL is broken badly and will be for some time.
Dan
parents:
317
diff
changeset
|
648 |
<a href="http://www.postgresql.org/" onclick="window.open(this.href); return false;" style="background: none; padding: 0;"> |
5f1cd51bf1be
Many changes. Installer with PostgreSQL is broken badly and will be for some time.
Dan
parents:
317
diff
changeset
|
649 |
<img alt="Database engine powered by PostgreSQL" src="<?php echo scriptPath; ?>/images/about-powered-pgsql.png" style="border-width: 0px;" width="90" height="30" /> |
5f1cd51bf1be
Many changes. Installer with PostgreSQL is broken badly and will be for some time.
Dan
parents:
317
diff
changeset
|
650 |
</a> |
5f1cd51bf1be
Many changes. Installer with PostgreSQL is broken badly and will be for some time.
Dan
parents:
317
diff
changeset
|
651 |
<?php |
5f1cd51bf1be
Many changes. Installer with PostgreSQL is broken badly and will be for some time.
Dan
parents:
317
diff
changeset
|
652 |
break; |
5f1cd51bf1be
Many changes. Installer with PostgreSQL is broken badly and will be for some time.
Dan
parents:
317
diff
changeset
|
653 |
} |
5f1cd51bf1be
Many changes. Installer with PostgreSQL is broken badly and will be for some time.
Dan
parents:
317
diff
changeset
|
654 |
?> |
0 | 655 |
</td> |
656 |
</tr> |
|
657 |
</table> |
|
658 |
</td> |
|
659 |
</tr> |
|
221
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
660 |
<tr><td style="width: 100px;" class="row1"><?php echo $lang->get('meta_enano_about_lbl_enanoversion'); ?></td><td class="row1"><?php echo enano_version(true) . ' (' . enano_codename() . ')'; ?></td></tr> |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
661 |
<tr><td style="width: 100px;" class="row2"><?php echo $lang->get('meta_enano_about_lbl_webserver'); ?></td><td class="row2"><?php if(isset($_SERVER['SERVER_SOFTWARE'])) echo $_SERVER['SERVER_SOFTWARE']; else echo 'Unable to determine web server software.'; ?></td></tr> |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
662 |
<tr><td style="width: 100px;" class="row1"><?php echo $lang->get('meta_enano_about_lbl_serverplatform'); ?></td><td class="row1"><?php echo $platform; ?></td></tr> |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
663 |
<tr><td style="width: 100px;" class="row2"><?php echo $lang->get('meta_enano_about_lbl_phpversion'); ?></td><td class="row2"><?php echo PHP_VERSION; ?></td></tr> |
322
5f1cd51bf1be
Many changes. Installer with PostgreSQL is broken badly and will be for some time.
Dan
parents:
317
diff
changeset
|
664 |
<?php |
5f1cd51bf1be
Many changes. Installer with PostgreSQL is broken badly and will be for some time.
Dan
parents:
317
diff
changeset
|
665 |
switch(ENANO_DBLAYER) |
5f1cd51bf1be
Many changes. Installer with PostgreSQL is broken badly and will be for some time.
Dan
parents:
317
diff
changeset
|
666 |
{ |
5f1cd51bf1be
Many changes. Installer with PostgreSQL is broken badly and will be for some time.
Dan
parents:
317
diff
changeset
|
667 |
case 'MYSQL': |
5f1cd51bf1be
Many changes. Installer with PostgreSQL is broken badly and will be for some time.
Dan
parents:
317
diff
changeset
|
668 |
?> |
326 | 669 |
<tr><td style="width: 100px;" class="row1"><?php echo $lang->get('meta_enano_about_lbl_mysqlversion'); ?></td><td class="row1"><?php echo mysql_get_server_info($db->_conn); ?></td></tr> |
322
5f1cd51bf1be
Many changes. Installer with PostgreSQL is broken badly and will be for some time.
Dan
parents:
317
diff
changeset
|
670 |
<?php |
5f1cd51bf1be
Many changes. Installer with PostgreSQL is broken badly and will be for some time.
Dan
parents:
317
diff
changeset
|
671 |
break; |
5f1cd51bf1be
Many changes. Installer with PostgreSQL is broken badly and will be for some time.
Dan
parents:
317
diff
changeset
|
672 |
case 'PGSQL': |
5f1cd51bf1be
Many changes. Installer with PostgreSQL is broken badly and will be for some time.
Dan
parents:
317
diff
changeset
|
673 |
$pg_serverdata = pg_version($db->_conn); |
5f1cd51bf1be
Many changes. Installer with PostgreSQL is broken badly and will be for some time.
Dan
parents:
317
diff
changeset
|
674 |
$pg_version = $pg_serverdata['server']; |
5f1cd51bf1be
Many changes. Installer with PostgreSQL is broken badly and will be for some time.
Dan
parents:
317
diff
changeset
|
675 |
?> |
326 | 676 |
<tr><td style="width: 100px;" class="row1"><?php echo $lang->get('meta_enano_about_lbl_pgsqlversion'); ?></td><td class="row1"><?php echo $pg_version; ?></td></tr> |
322
5f1cd51bf1be
Many changes. Installer with PostgreSQL is broken badly and will be for some time.
Dan
parents:
317
diff
changeset
|
677 |
<?php |
5f1cd51bf1be
Many changes. Installer with PostgreSQL is broken badly and will be for some time.
Dan
parents:
317
diff
changeset
|
678 |
break; |
5f1cd51bf1be
Many changes. Installer with PostgreSQL is broken badly and will be for some time.
Dan
parents:
317
diff
changeset
|
679 |
} |
5f1cd51bf1be
Many changes. Installer with PostgreSQL is broken badly and will be for some time.
Dan
parents:
317
diff
changeset
|
680 |
?> |
0 | 681 |
</table> |
682 |
</div> |
|
683 |
<?php |
|
684 |
$template->footer(); |
|
685 |
} |
|
686 |
||
687 |
function page_Special_GNU_General_Public_License() |
|
688 |
{ |
|
689 |
global $db, $session, $paths, $template, $plugins; // Common objects |
|
335
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
334
diff
changeset
|
690 |
global $lang; |
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
334
diff
changeset
|
691 |
|
0 | 692 |
$template->header(); |
335
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
334
diff
changeset
|
693 |
if(file_exists(ENANO_ROOT . '/GPL')) |
0 | 694 |
{ |
335
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
334
diff
changeset
|
695 |
echo '<p>' . $lang->get('pagetools_gpl_blurb', array('about_url' => makeUrlNS('Special', 'About_Enano'))) . '</p>'; |
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
334
diff
changeset
|
696 |
|
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
334
diff
changeset
|
697 |
if ( $lang->lang_code != 'eng' ): |
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
334
diff
changeset
|
698 |
// Do not remove this block of code. Doing so is a violation of the GPL. (A copy of the GPL in other languages |
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
334
diff
changeset
|
699 |
// must be accompanied by a copy of the English GPL.) |
0 | 700 |
echo '<p>The following text represents the license that the <a href="'.makeUrlNS('Special', 'About_Enano').'">Enano</a> content management system is under. To make it easier to read, the text has been wiki-formatted; in no other way has it been changed.</p>'; |
335
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
334
diff
changeset
|
701 |
endif; |
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
334
diff
changeset
|
702 |
|
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
334
diff
changeset
|
703 |
if ( file_exists(ENANO_ROOT . "/GPL_{$lang->lang_code}") ) |
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
334
diff
changeset
|
704 |
{ |
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
334
diff
changeset
|
705 |
echo '<h2>' . $lang->get('pagetools_gpl_title_native') . '</h2>'; |
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
334
diff
changeset
|
706 |
echo '<p><a href="#gpl_english">' . $lang->get('pagetools_gpl_link_to_english') . ' / View the license in English' . '</a></p>'; |
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
334
diff
changeset
|
707 |
echo RenderMan::render( file_get_contents ( ENANO_ROOT . "/GPL_{$lang->lang_code}" ) ); |
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
334
diff
changeset
|
708 |
echo '<h2>' . $lang->get('pagetools_gpl_title_english') . ' / English version<a name="gpl_english" id="gpl_english"></a></h2>'; |
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
334
diff
changeset
|
709 |
} |
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
334
diff
changeset
|
710 |
|
73
0a74676a2f2f
Made the move to Loch Ness, and got some basic page grouping functionality working. TODO: fix some UI issues in Javascript ACL editor and change non-JS ACL editor to work with page groups too
Dan
parents:
69
diff
changeset
|
711 |
echo RenderMan::render( file_get_contents ( ENANO_ROOT . '/GPL' ) ); |
0 | 712 |
} |
713 |
else |
|
714 |
{ |
|
335
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
334
diff
changeset
|
715 |
echo '<p>' . $lang->get('pagetools_gpl_err_file_missing') . '</p>'; |
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
334
diff
changeset
|
716 |
if ( $lang->lang_code != 'eng') |
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
334
diff
changeset
|
717 |
// Also print out English version |
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
334
diff
changeset
|
718 |
// Do not remove the following line of code; doing so would be a violation of the GPL. |
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
334
diff
changeset
|
719 |
echo '<p>It appears that the file "GPL" is missing from your Enano installation. You may find a wiki-formatted copy of the GPL at: <a href="http://enanocms.org/GPL">http://enanocms.org/GPL</a>. In the mean time, you may wish to contact the site administration and ask them to replace the GPL file.</p>'; |
0 | 720 |
} |
721 |
$template->footer(); |
|
722 |
} |
|
723 |
||
83 | 724 |
function page_Special_TagCloud() |
725 |
{ |
|
726 |
global $db, $session, $paths, $template, $plugins; // Common objects |
|
335
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
334
diff
changeset
|
727 |
global $lang; |
83 | 728 |
|
729 |
$template->header(); |
|
730 |
||
731 |
if ( $tag = $paths->getParam(0) ) |
|
732 |
{ |
|
733 |
$tag = sanitize_tag($tag); |
|
734 |
$q = $db->sql_query('SELECT page_id, namespace FROM '.table_prefix.'tags WHERE tag_name=\'' . $db->escape($tag) . '\';'); |
|
735 |
if ( !$q ) |
|
736 |
$db->_die(); |
|
737 |
if ( $row = $db->fetchrow() ) |
|
738 |
{ |
|
739 |
echo '<div class="tblholder"> |
|
740 |
<table border="0" cellspacing="1" cellpadding="4">'; |
|
335
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
334
diff
changeset
|
741 |
echo '<tr><th colspan="2">' . $lang->get('pagetools_tagcloud_pagelist_th', array('tag' => htmlspecialchars($tag))) . '</th></tr>'; |
83 | 742 |
echo '<tr>'; |
743 |
$i = 0; |
|
744 |
$td_class = 'row1'; |
|
745 |
do |
|
746 |
{ |
|
747 |
if ( $i % 2 == 0 && $i > 1 ) |
|
748 |
{ |
|
749 |
$td_class = ( $td_class == 'row2' ) ? 'row1' : 'row2'; |
|
750 |
echo '</tr><tr>'; |
|
751 |
} |
|
752 |
$i++; |
|
753 |
$title = get_page_title_ns($row['page_id'], $row['namespace']); |
|
754 |
if ( $row['namespace'] != 'Article' && isset($paths->nslist[$row['namespace']]) ) |
|
755 |
$title = $paths->nslist[$row['namespace']] . $title; |
|
756 |
$url = makeUrlNS($row['namespace'], $row['page_id']); |
|
757 |
$class = ( isPage( $paths->nslist[$row['namespace']] . $row['page_id'] ) ) ? '' : ' class="wikilink-nonexistent"'; |
|
758 |
$link = '<a href="' . htmlspecialchars($url) . '"' . $class . '>' . htmlspecialchars($title) . '</a>'; |
|
759 |
echo "<td class=\"$td_class\" style=\"width: 50%;\">$link</td>"; |
|
760 |
// " workaround for jEdit highlighting bug |
|
761 |
} |
|
762 |
while ( $row = $db->fetchrow() ); |
|
763 |
while ( $i % 2 > 0 ) |
|
764 |
{ |
|
765 |
$i++; |
|
766 |
echo "<td class=\"$td_class\" style=\"width: 50%;\"></td>"; |
|
767 |
} |
|
768 |
// " workaround for jEdit highlighting bug |
|
769 |
echo '<tr> |
|
335
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
334
diff
changeset
|
770 |
<th colspan="2" class="subhead"><a href="' . makeUrlNS('Special', 'TagCloud') . '">« ' . $lang->get('pagetools_tagcloud_btn_return') . '</a></th> |
83 | 771 |
</tr>'; |
772 |
echo '</table>'; |
|
773 |
echo '</div>'; |
|
774 |
} |
|
775 |
} |
|
776 |
else |
|
777 |
{ |
|
778 |
$cloud = new TagCloud(); |
|
779 |
||
780 |
$q = $db->sql_query('SELECT tag_name FROM '.table_prefix.'tags;'); |
|
781 |
if ( !$q ) |
|
782 |
$db->_die(); |
|
783 |
if ( $db->numrows() < 1 ) |
|
784 |
{ |
|
335
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
334
diff
changeset
|
785 |
echo '<p>' . $lang->get('pagetools_tagcloud_msg_no_tags') . '</p>'; |
83 | 786 |
} |
787 |
else |
|
788 |
{ |
|
335
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
334
diff
changeset
|
789 |
echo '<h3>' . $lang->get('pagetools_tagcloud_blurb') . '</h3>'; |
83 | 790 |
while ( $row = $db->fetchrow() ) |
791 |
{ |
|
792 |
$cloud->add_word($row['tag_name']); |
|
793 |
} |
|
794 |
echo $cloud->make_html('normal'); |
|
335
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
334
diff
changeset
|
795 |
echo '<p>' . $lang->get('pagetools_tagcloud_instructions') . '</p>'; |
83 | 796 |
} |
797 |
} |
|
798 |
||
799 |
$template->footer(); |
|
800 |
} |
|
801 |
||
802 |
// tag cloud sidebar block |
|
803 |
function sidebar_add_tag_cloud() |
|
804 |
{ |
|
805 |
global $db, $session, $paths, $template, $plugins; // Common objects |
|
335
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
334
diff
changeset
|
806 |
global $lang; |
83 | 807 |
$cloud = new TagCloud(); |
808 |
||
809 |
$q = $db->sql_query('SELECT tag_name FROM '.table_prefix.'tags;'); |
|
810 |
if ( !$q ) |
|
811 |
$db->_die(); |
|
812 |
if ( $db->numrows() < 1 ) |
|
813 |
{ |
|
335
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
334
diff
changeset
|
814 |
$sb_html = $lang->get('pagetools_tagcloud_msg_no_tags'); |
83 | 815 |
} |
816 |
else |
|
817 |
{ |
|
818 |
while ( $row = $db->fetchrow() ) |
|
819 |
{ |
|
820 |
$cloud->add_word($row['tag_name']); |
|
821 |
} |
|
335
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
334
diff
changeset
|
822 |
$sb_html = $cloud->make_html('small', 'justify') . '<br /><a style="text-align: center;" href="' . makeUrlNS('Special', 'TagCloud') . '">' . $lang->get('pagetools_tagcloud_sidebar_btn_larger') . '</a>'; |
83 | 823 |
} |
335
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
334
diff
changeset
|
824 |
$template->sidebar_widget($lang->get('pagetools_tagcloud_sidebar_title'), "<div style='padding: 5px;'>$sb_html</div>"); |
83 | 825 |
} |
826 |
||
827 |
$plugins->attachHook('compile_template', 'sidebar_add_tag_cloud();'); |
|
828 |
||
0 | 829 |
?> |