author | Dan |
Wed, 29 Jul 2009 10:47:26 -0400 | |
changeset 1059 | f5d2bca33bb8 |
parent 967 | a267c5be7963 |
child 1081 | 745200a9cc2a |
permissions | -rw-r--r-- |
0 | 1 |
<?php |
519
94214ec0871c
Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
504
diff
changeset
|
2 |
/**!info** |
94214ec0871c
Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
504
diff
changeset
|
3 |
{ |
94214ec0871c
Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
504
diff
changeset
|
4 |
"Plugin Name" : "plugin_specialpagefuncs_title", |
94214ec0871c
Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
504
diff
changeset
|
5 |
"Plugin URI" : "http://enanocms.org/", |
94214ec0871c
Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
504
diff
changeset
|
6 |
"Description" : "plugin_specialpagefuncs_desc", |
94214ec0871c
Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
504
diff
changeset
|
7 |
"Author" : "Dan Fuhry", |
960
e74741b8360b
Added register_special_page() function, to make it much easier to create special pages. Also, rewrote Special:Memberlist to use more efficient fetch method and not use an unbuffered whole-table query.
Dan
parents:
953
diff
changeset
|
8 |
"Version" : "1.1.6", |
519
94214ec0871c
Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
504
diff
changeset
|
9 |
"Author URI" : "http://enanocms.org/" |
94214ec0871c
Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
504
diff
changeset
|
10 |
} |
94214ec0871c
Started work on the new plugin manager and associated management code. Very incomplete at this point and not usable.
Dan
parents:
504
diff
changeset
|
11 |
**!*/ |
0 | 12 |
|
13 |
/* |
|
14 |
* Enano - an open-source CMS capable of wiki functions, Drupal-like sidebar blocks, and everything in between |
|
801
eb8b23f11744
Two big commits in one day I know, but redid password storage to use HMAC-SHA1. Consolidated much AES processing to three core methods in session that should handle everything automagically. Installation works; upgrades should. Rebranded as 1.1.6.
Dan
parents:
761
diff
changeset
|
15 |
* Version 1.1.6 (Caoineag beta 1) |
536 | 16 |
* Copyright (C) 2006-2008 Dan Fuhry |
0 | 17 |
* |
18 |
* This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License |
|
19 |
* as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. |
|
20 |
* |
|
21 |
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied |
|
22 |
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. |
|
23 |
*/ |
|
24 |
||
25 |
global $db, $session, $paths, $template, $plugins; // Common objects |
|
26 |
||
593
4f9bec0d65c1
More optimization work. Moved special page init functions to common instead of common_post hook. Allowed paths to cache page metadata on filesystem. Phased out the redundancy in $paths->pages that paired a number with every urlname as foreach loops are allowed now (and have been for some time). Fixed missing includes for several functions. Rewrote str_replace_once to be a lot more efficient.
Dan
parents:
590
diff
changeset
|
27 |
// $plugins->attachHook('session_started', 'SpecialPageFuncs_paths_init();'); |
590
03a60844c7c5
Several optimization changes including getting rid of a few eval()s. Added placeholder functions for the theme manager, which should be working now
Dan
parents:
588
diff
changeset
|
28 |
|
03a60844c7c5
Several optimization changes including getting rid of a few eval()s. Added placeholder functions for the theme manager, which should be working now
Dan
parents:
588
diff
changeset
|
29 |
function SpecialPageFuncs_paths_init() |
03a60844c7c5
Several optimization changes including getting rid of a few eval()s. Added placeholder functions for the theme manager, which should be working now
Dan
parents:
588
diff
changeset
|
30 |
{ |
960
e74741b8360b
Added register_special_page() function, to make it much easier to create special pages. Also, rewrote Special:Memberlist to use more efficient fetch method and not use an unbuffered whole-table query.
Dan
parents:
953
diff
changeset
|
31 |
register_special_page('CreatePage', 'specialpage_create_page'); |
e74741b8360b
Added register_special_page() function, to make it much easier to create special pages. Also, rewrote Special:Memberlist to use more efficient fetch method and not use an unbuffered whole-table query.
Dan
parents:
953
diff
changeset
|
32 |
register_special_page('AllPages', 'specialpage_all_pages'); |
e74741b8360b
Added register_special_page() function, to make it much easier to create special pages. Also, rewrote Special:Memberlist to use more efficient fetch method and not use an unbuffered whole-table query.
Dan
parents:
953
diff
changeset
|
33 |
register_special_page('SpecialPages', 'specialpage_special_pages'); |
e74741b8360b
Added register_special_page() function, to make it much easier to create special pages. Also, rewrote Special:Memberlist to use more efficient fetch method and not use an unbuffered whole-table query.
Dan
parents:
953
diff
changeset
|
34 |
register_special_page('About_Enano', 'specialpage_about_enano'); |
e74741b8360b
Added register_special_page() function, to make it much easier to create special pages. Also, rewrote Special:Memberlist to use more efficient fetch method and not use an unbuffered whole-table query.
Dan
parents:
953
diff
changeset
|
35 |
register_special_page('GNU_General_Public_License', 'specialpage_gnu_gpl'); |
e74741b8360b
Added register_special_page() function, to make it much easier to create special pages. Also, rewrote Special:Memberlist to use more efficient fetch method and not use an unbuffered whole-table query.
Dan
parents:
953
diff
changeset
|
36 |
register_special_page('TagCloud', 'specialpage_tag_cloud'); |
e74741b8360b
Added register_special_page() function, to make it much easier to create special pages. Also, rewrote Special:Memberlist to use more efficient fetch method and not use an unbuffered whole-table query.
Dan
parents:
953
diff
changeset
|
37 |
register_special_page('Autofill', 'specialpage_autofill', false); |
590
03a60844c7c5
Several optimization changes including getting rid of a few eval()s. Added placeholder functions for the theme manager, which should be working now
Dan
parents:
588
diff
changeset
|
38 |
} |
0 | 39 |
|
40 |
// function names are IMPORTANT!!! The name pattern is: page_<namespace ID>_<page URLname, without namespace> |
|
41 |
||
22
d0314575e2f0
More preliminary l10n work; userpage portal style basics implemented
Dan
parents:
0
diff
changeset
|
42 |
function page_Special_CreatePage() |
d0314575e2f0
More preliminary l10n work; userpage portal style basics implemented
Dan
parents:
0
diff
changeset
|
43 |
{ |
0 | 44 |
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
|
45 |
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
|
46 |
|
426 | 47 |
$whitelist_ns = array('Article', 'User', 'Help', 'Template', 'Category', 'Project'); |
682
9523cc7d767c
Fixed System pages not being createable even with proper admin rights. This is hackish, it probably needs to have something implemented at the ACL level.
Dan
parents:
648
diff
changeset
|
48 |
if ( $session->user_level >= USER_LEVEL_ADMIN ) |
9523cc7d767c
Fixed System pages not being createable even with proper admin rights. This is hackish, it probably needs to have something implemented at the ACL level.
Dan
parents:
648
diff
changeset
|
49 |
{ |
9523cc7d767c
Fixed System pages not being createable even with proper admin rights. This is hackish, it probably needs to have something implemented at the ACL level.
Dan
parents:
648
diff
changeset
|
50 |
$whitelist_ns[] = 'System'; |
9523cc7d767c
Fixed System pages not being createable even with proper admin rights. This is hackish, it probably needs to have something implemented at the ACL level.
Dan
parents:
648
diff
changeset
|
51 |
} |
426 | 52 |
$code = $plugins->setHook('page_create_ns_whitelist'); |
53 |
foreach ( $code as $cmd ) |
|
54 |
{ |
|
55 |
eval($cmd); |
|
56 |
} |
|
57 |
||
58 |
$errors = array(); |
|
59 |
||
60 |
switch ( isset($_POST['page_title']) ) |
|
61 |
{ |
|
62 |
case true: |
|
63 |
// "Create page" was clicked |
|
64 |
||
65 |
// |
|
66 |
// VALIDATION CODE |
|
67 |
// |
|
68 |
||
69 |
// Check namespace |
|
70 |
$namespace = ( isset($_POST['namespace']) ) ? $_POST['namespace'] : 'Article'; |
|
71 |
if ( !in_array($namespace, $whitelist_ns) ) |
|
72 |
{ |
|
73 |
$errors[] = $lang->get('pagetools_create_err_invalid_namespace'); |
|
74 |
} |
|
75 |
||
76 |
// Check title and figure out urlname |
|
77 |
$title = $_POST['page_title']; |
|
78 |
$urlname = $_POST['page_title']; |
|
79 |
if ( @$_POST['custom_url'] === 'yes' && isset($_POST['urlname']) ) |
|
80 |
{ |
|
81 |
$urlname = $_POST['urlname']; |
|
82 |
} |
|
83 |
$urlname = sanitize_page_id($urlname); |
|
84 |
if ( $urlname == '.00' || empty($urlname) ) |
|
85 |
{ |
|
86 |
$errors[] = $lang->get('pagetools_create_err_invalid_urlname'); |
|
87 |
} |
|
88 |
||
89 |
// Validate page existence |
|
90 |
$pathskey = $paths->nslist[$namespace] . $urlname; |
|
91 |
if ( isPage($pathskey) ) |
|
92 |
{ |
|
93 |
$errors[] = $lang->get('pagetools_create_err_already_exists'); |
|
94 |
} |
|
95 |
||
96 |
// Validate permissions |
|
97 |
$perms = $session->fetch_page_acl($urlname, $namespace); |
|
98 |
if ( !$perms->get_permissions('create_page') ) |
|
99 |
{ |
|
100 |
$errors[] = $lang->get('pagetools_create_err_no_permission'); |
|
101 |
} |
|
102 |
||
103 |
// Run hooks |
|
104 |
$code = $plugins->setHook('page_create_request'); |
|
105 |
foreach ( $code as $cmd ) |
|
106 |
{ |
|
107 |
eval($cmd); |
|
108 |
} |
|
109 |
||
110 |
// Create the page |
|
111 |
if ( count($errors) < 1 ) |
|
112 |
{ |
|
113 |
$page = new PageProcessor($urlname, $namespace); |
|
114 |
$page->create_page($title); |
|
115 |
if ( $error = $page->pop_error() ) |
|
116 |
{ |
|
117 |
do |
|
118 |
{ |
|
119 |
$errors[] = $error; |
|
120 |
} |
|
121 |
while ( $error = $page->pop_error() ); |
|
122 |
} |
|
123 |
else |
|
124 |
{ |
|
125 |
redirect(makeUrlNS($namespace, $urlname) . '#do:edit', '', '', 0); |
|
126 |
return true; |
|
127 |
} |
|
128 |
} |
|
129 |
||
130 |
break; |
|
131 |
} |
|
132 |
||
133 |
$template->header(); |
|
134 |
||
135 |
echo $lang->get('pagetools_create_blurb'); |
|
136 |
||
137 |
if ( count($errors) > 0 ) |
|
138 |
{ |
|
139 |
echo '<div class="error-box">' . implode("<br />\n ", $errors) . '</div>'; |
|
140 |
} |
|
141 |
||
142 |
?> |
|
143 |
<enano:no-opt> |
|
144 |
<script type="text/javascript"> |
|
588
20484deb89cd
Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents:
581
diff
changeset
|
145 |
window.cpGenPreviewUrl = function() |
426 | 146 |
{ |
588
20484deb89cd
Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents:
581
diff
changeset
|
147 |
if ( typeof(load_component) != 'function' ) |
20484deb89cd
Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents:
581
diff
changeset
|
148 |
return false; |
20484deb89cd
Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents:
581
diff
changeset
|
149 |
|
426 | 150 |
var frm = document.forms['create_form']; |
151 |
var radio_custom = frm.getElementsByTagName('input')[2]; |
|
152 |
var use_custom_url = radio_custom.checked; |
|
153 |
if ( use_custom_url ) |
|
154 |
{ |
|
155 |
var title_src = frm.urlname.value; |
|
156 |
} |
|
157 |
else |
|
158 |
{ |
|
159 |
var title_src = frm.page_title.value; |
|
160 |
} |
|
161 |
var url = window.location.protocol + '//' + window.location.hostname + contentPath + namespace_list[frm.namespace.value] + sanitize_page_id(title_src); |
|
162 |
document.getElementById('createpage_url_preview').firstChild.nodeValue = url; |
|
163 |
} |
|
164 |
</script> |
|
165 |
</enano:no-opt> |
|
166 |
<?php |
|
167 |
||
168 |
echo '<form action="' . makeUrlNS('Special', 'CreatePage') . '" method="post" name="create_form">'; |
|
169 |
||
170 |
echo '<p>'; |
|
171 |
echo $lang->get('pagetools_create_field_title'); |
|
172 |
echo ' <input onkeyup="cpGenPreviewUrl();" type="text" name="page_title" size="40" tabindex="1" />'; |
|
173 |
echo '</p>'; |
|
174 |
||
175 |
echo '<p>'; |
|
176 |
echo $lang->get('pagetools_create_field_namespace'); |
|
177 |
echo ' <select onchange="cpGenPreviewUrl();" name="namespace" tabindex="2">'; |
|
178 |
foreach ( $paths->nslist as $ns => $ns_prefix ) |
|
179 |
{ |
|
180 |
if ( !in_array($ns, $whitelist_ns) ) |
|
181 |
continue; |
|
182 |
$lang_string = 'onpage_lbl_page_' . strtolower($ns); |
|
183 |
$str = $lang->get($lang_string); |
|
184 |
if ( $str == $lang_string ) |
|
185 |
$str = $ns; |
|
186 |
||
187 |
echo '<option value="' . $ns . '">' . ucwords($str) . '</option>'; |
|
188 |
} |
|
189 |
echo '</select>'; |
|
190 |
echo '</p>'; |
|
191 |
||
501
9367161b2457
Added support for an enano:expand=(closed|open) attribute on fieldsets to make them act like GTK expandable widgets; implementation is on Special:CreatePage
Dan
parents:
426
diff
changeset
|
192 |
echo '<fieldset enano:expand="closed">'; |
426 | 193 |
echo '<legend>' . $lang->get('pagetools_create_group_advanced') . '</legend>'; |
194 |
||
195 |
echo '<p>'; |
|
196 |
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>'; |
|
197 |
echo '</p>'; |
|
198 |
||
199 |
echo '<p>'; |
|
200 |
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>'; |
|
201 |
echo '</p>'; |
|
202 |
||
203 |
echo '<p id="createpage_custom_url" style="display: none; margin-left: 2em;">'; |
|
204 |
echo $lang->get('pagetools_create_field_url'); |
|
205 |
echo ' <input onkeyup="cpGenPreviewUrl();" tabindex="4" type="text" name="urlname" value="" size="40" />'; |
|
206 |
echo '</p>'; |
|
207 |
||
208 |
echo '<p>'; |
|
209 |
echo $lang->get('pagetools_create_field_preview') . ' <tt id="createpage_url_preview"> </tt><br />'; |
|
210 |
echo '<small>' . $lang->get('pagetools_create_field_preview_hint') . '</small>'; |
|
211 |
echo '</p>'; |
|
212 |
||
213 |
echo '</fieldset>'; |
|
214 |
||
215 |
echo '<p>'; |
|
216 |
echo '<input tabindex="5" type="submit" value="' . $lang->get('pagetools_create_btn_create') . '" />'; |
|
217 |
echo '</p>'; |
|
218 |
||
219 |
echo '</form>'; |
|
220 |
||
588
20484deb89cd
Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents:
581
diff
changeset
|
221 |
echo '<script type="text/javascript">addOnloadHook(cpGenPreviewUrl); addOnloadHook(function(){load_component(\'expander\')});</script>'; |
426 | 222 |
|
223 |
$template->footer(); |
|
224 |
} |
|
225 |
||
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
|
226 |
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
|
227 |
{ |
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
|
228 |
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
|
229 |
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
|
230 |
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
|
231 |
static $per_row = 2; |
117
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
116
diff
changeset
|
232 |
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
|
233 |
$return = ''; |
117
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
116
diff
changeset
|
234 |
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
|
235 |
{ |
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
|
236 |
$rowtracker = 0; |
117
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
116
diff
changeset
|
237 |
$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
|
238 |
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
|
239 |
} |
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
|
240 |
$rowtracker++; |
117
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
116
diff
changeset
|
241 |
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
|
242 |
{ |
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
|
243 |
$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
|
244 |
$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
|
245 |
} |
117
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
116
diff
changeset
|
246 |
if ( $rowtracker == 0 && !$first ) |
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
116
diff
changeset
|
247 |
$return .= "</tr>\n<tr>"; |
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
116
diff
changeset
|
248 |
|
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
116
diff
changeset
|
249 |
$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
|
250 |
|
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
|
251 |
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
|
252 |
$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
|
253 |
$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
|
254 |
$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
|
255 |
|
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
|
256 |
$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
|
257 |
$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
|
258 |
|
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
|
259 |
$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
|
260 |
$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
|
261 |
|
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
|
262 |
$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
|
263 |
|
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
|
264 |
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
|
265 |
} |
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
|
266 |
|
0 | 267 |
function page_Special_AllPages() |
268 |
{ |
|
269 |
// This should be an easy one |
|
270 |
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
|
271 |
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
|
272 |
|
0 | 273 |
$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
|
274 |
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
|
275 |
|
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
|
276 |
$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
|
277 |
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
|
278 |
$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
|
279 |
$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
|
280 |
$count = $row[0]; |
953
323c4cd1aa37
Made some more changes to the way namespaces are handled, for optimization purposes. This is a bit of a structural reorganization: $paths->pages is obsoleted in its entirety; calculating page existence and metadata is now the job of the Namespace_* backend class. There are many things in PageProcessor that should be reorganized, and page actions in general should really be rethought. This is probably the beginning of a long process that will be taking place over the course of the betas.
Dan
parents:
871
diff
changeset
|
281 |
$sz =& $count; |
117
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
116
diff
changeset
|
282 |
|
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
116
diff
changeset
|
283 |
switch($count % 4) |
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
116
diff
changeset
|
284 |
{ |
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
116
diff
changeset
|
285 |
case 0: |
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
116
diff
changeset
|
286 |
case 2: |
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
116
diff
changeset
|
287 |
// even number of results; do nothing |
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
116
diff
changeset
|
288 |
$last_cell = ''; |
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
116
diff
changeset
|
289 |
break; |
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
116
diff
changeset
|
290 |
case 1: |
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
116
diff
changeset
|
291 |
// 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
|
292 |
$last_cell = '<td class="row1"></td>'; |
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
116
diff
changeset
|
293 |
break; |
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
116
diff
changeset
|
294 |
case 3: |
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
116
diff
changeset
|
295 |
// 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
|
296 |
$last_cell = '<td class="row2"></td>'; |
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
116
diff
changeset
|
297 |
break; |
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
116
diff
changeset
|
298 |
} |
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
116
diff
changeset
|
299 |
|
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
|
300 |
$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
|
301 |
|
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
|
302 |
$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
|
303 |
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
|
304 |
$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
|
305 |
|
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
|
306 |
$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
|
307 |
|
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
|
308 |
// 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
|
309 |
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
|
310 |
|
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
|
311 |
$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
|
312 |
$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
|
313 |
'{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
|
314 |
$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
|
315 |
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
|
316 |
$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
|
317 |
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
|
318 |
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
|
319 |
'<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
|
320 |
<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
|
321 |
<tr>', // print at start |
117
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
116
diff
changeset
|
322 |
' ' . $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
|
323 |
</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
|
324 |
</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
|
325 |
); |
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
|
326 |
|
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
|
327 |
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
|
328 |
|
0 | 329 |
$template->footer(); |
330 |
} |
|
331 |
||
332 |
function page_Special_SpecialPages() |
|
333 |
{ |
|
334 |
// This should be an easy one |
|
335 |
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
|
336 |
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
|
337 |
|
0 | 338 |
$template->header(); |
953
323c4cd1aa37
Made some more changes to the way namespaces are handled, for optimization purposes. This is a bit of a structural reorganization: $paths->pages is obsoleted in its entirety; calculating page existence and metadata is now the job of the Namespace_* backend class. There are many things in PageProcessor that should be reorganized, and page actions in general should really be rethought. This is probably the beginning of a long process that will be taking place over the course of the betas.
Dan
parents:
871
diff
changeset
|
339 |
echo '<p>' . $lang->get('pagetools_specialpages_blurb') . '</p><div class="tblholder"><table border="0" width="100%" cellspacing="1" cellpadding="4"><tr>'; |
323c4cd1aa37
Made some more changes to the way namespaces are handled, for optimization purposes. This is a bit of a structural reorganization: $paths->pages is obsoleted in its entirety; calculating page existence and metadata is now the job of the Namespace_* backend class. There are many things in PageProcessor that should be reorganized, and page actions in general should really be rethought. This is probably the beginning of a long process that will be taking place over the course of the betas.
Dan
parents:
871
diff
changeset
|
340 |
$cclass = 'row1'; |
323c4cd1aa37
Made some more changes to the way namespaces are handled, for optimization purposes. This is a bit of a structural reorganization: $paths->pages is obsoleted in its entirety; calculating page existence and metadata is now the job of the Namespace_* backend class. There are many things in PageProcessor that should be reorganized, and page actions in general should really be rethought. This is probably the beginning of a long process that will be taking place over the course of the betas.
Dan
parents:
871
diff
changeset
|
341 |
$i = -1; |
323c4cd1aa37
Made some more changes to the way namespaces are handled, for optimization purposes. This is a bit of a structural reorganization: $paths->pages is obsoleted in its entirety; calculating page existence and metadata is now the job of the Namespace_* backend class. There are many things in PageProcessor that should be reorganized, and page actions in general should really be rethought. This is probably the beginning of a long process that will be taking place over the course of the betas.
Dan
parents:
871
diff
changeset
|
342 |
foreach ( $paths->pages as $cdata ) |
0 | 343 |
{ |
953
323c4cd1aa37
Made some more changes to the way namespaces are handled, for optimization purposes. This is a bit of a structural reorganization: $paths->pages is obsoleted in its entirety; calculating page existence and metadata is now the job of the Namespace_* backend class. There are many things in PageProcessor that should be reorganized, and page actions in general should really be rethought. This is probably the beginning of a long process that will be taking place over the course of the betas.
Dan
parents:
871
diff
changeset
|
344 |
if ( $cdata['namespace'] != 'Special' ) |
323c4cd1aa37
Made some more changes to the way namespaces are handled, for optimization purposes. This is a bit of a structural reorganization: $paths->pages is obsoleted in its entirety; calculating page existence and metadata is now the job of the Namespace_* backend class. There are many things in PageProcessor that should be reorganized, and page actions in general should really be rethought. This is probably the beginning of a long process that will be taking place over the course of the betas.
Dan
parents:
871
diff
changeset
|
345 |
continue; |
323c4cd1aa37
Made some more changes to the way namespaces are handled, for optimization purposes. This is a bit of a structural reorganization: $paths->pages is obsoleted in its entirety; calculating page existence and metadata is now the job of the Namespace_* backend class. There are many things in PageProcessor that should be reorganized, and page actions in general should really be rethought. This is probably the beginning of a long process that will be taking place over the course of the betas.
Dan
parents:
871
diff
changeset
|
346 |
|
323c4cd1aa37
Made some more changes to the way namespaces are handled, for optimization purposes. This is a bit of a structural reorganization: $paths->pages is obsoleted in its entirety; calculating page existence and metadata is now the job of the Namespace_* backend class. There are many things in PageProcessor that should be reorganized, and page actions in general should really be rethought. This is probably the beginning of a long process that will be taking place over the course of the betas.
Dan
parents:
871
diff
changeset
|
347 |
$i++; |
323c4cd1aa37
Made some more changes to the way namespaces are handled, for optimization purposes. This is a bit of a structural reorganization: $paths->pages is obsoleted in its entirety; calculating page existence and metadata is now the job of the Namespace_* backend class. There are many things in PageProcessor that should be reorganized, and page actions in general should really be rethought. This is probably the beginning of a long process that will be taking place over the course of the betas.
Dan
parents:
871
diff
changeset
|
348 |
if ( $i % 2 == 0 && $i > 0 ) |
0 | 349 |
{ |
953
323c4cd1aa37
Made some more changes to the way namespaces are handled, for optimization purposes. This is a bit of a structural reorganization: $paths->pages is obsoleted in its entirety; calculating page existence and metadata is now the job of the Namespace_* backend class. There are many things in PageProcessor that should be reorganized, and page actions in general should really be rethought. This is probably the beginning of a long process that will be taking place over the course of the betas.
Dan
parents:
871
diff
changeset
|
350 |
echo '</tr><tr>'; |
323c4cd1aa37
Made some more changes to the way namespaces are handled, for optimization purposes. This is a bit of a structural reorganization: $paths->pages is obsoleted in its entirety; calculating page existence and metadata is now the job of the Namespace_* backend class. There are many things in PageProcessor that should be reorganized, and page actions in general should really be rethought. This is probably the beginning of a long process that will be taking place over the course of the betas.
Dan
parents:
871
diff
changeset
|
351 |
$cclass = ( $cclass == 'row1' ) ? 'row3' : 'row1'; |
0 | 352 |
} |
953
323c4cd1aa37
Made some more changes to the way namespaces are handled, for optimization purposes. This is a bit of a structural reorganization: $paths->pages is obsoleted in its entirety; calculating page existence and metadata is now the job of the Namespace_* backend class. There are many things in PageProcessor that should be reorganized, and page actions in general should really be rethought. This is probably the beginning of a long process that will be taking place over the course of the betas.
Dan
parents:
871
diff
changeset
|
353 |
echo '<td style="width: 50%;" class="' . $cclass . '">'; |
323c4cd1aa37
Made some more changes to the way namespaces are handled, for optimization purposes. This is a bit of a structural reorganization: $paths->pages is obsoleted in its entirety; calculating page existence and metadata is now the job of the Namespace_* backend class. There are many things in PageProcessor that should be reorganized, and page actions in general should really be rethought. This is probably the beginning of a long process that will be taking place over the course of the betas.
Dan
parents:
871
diff
changeset
|
354 |
echo '<a href="' . makeUrl($cdata['urlname']) . '">'; |
323c4cd1aa37
Made some more changes to the way namespaces are handled, for optimization purposes. This is a bit of a structural reorganization: $paths->pages is obsoleted in its entirety; calculating page existence and metadata is now the job of the Namespace_* backend class. There are many things in PageProcessor that should be reorganized, and page actions in general should really be rethought. This is probably the beginning of a long process that will be taking place over the course of the betas.
Dan
parents:
871
diff
changeset
|
355 |
echo htmlspecialchars($cdata['name']); |
323c4cd1aa37
Made some more changes to the way namespaces are handled, for optimization purposes. This is a bit of a structural reorganization: $paths->pages is obsoleted in its entirety; calculating page existence and metadata is now the job of the Namespace_* backend class. There are many things in PageProcessor that should be reorganized, and page actions in general should really be rethought. This is probably the beginning of a long process that will be taking place over the course of the betas.
Dan
parents:
871
diff
changeset
|
356 |
echo '</a>'; |
323c4cd1aa37
Made some more changes to the way namespaces are handled, for optimization purposes. This is a bit of a structural reorganization: $paths->pages is obsoleted in its entirety; calculating page existence and metadata is now the job of the Namespace_* backend class. There are many things in PageProcessor that should be reorganized, and page actions in general should really be rethought. This is probably the beginning of a long process that will be taking place over the course of the betas.
Dan
parents:
871
diff
changeset
|
357 |
echo '</td>'; |
323c4cd1aa37
Made some more changes to the way namespaces are handled, for optimization purposes. This is a bit of a structural reorganization: $paths->pages is obsoleted in its entirety; calculating page existence and metadata is now the job of the Namespace_* backend class. There are many things in PageProcessor that should be reorganized, and page actions in general should really be rethought. This is probably the beginning of a long process that will be taking place over the course of the betas.
Dan
parents:
871
diff
changeset
|
358 |
} |
323c4cd1aa37
Made some more changes to the way namespaces are handled, for optimization purposes. This is a bit of a structural reorganization: $paths->pages is obsoleted in its entirety; calculating page existence and metadata is now the job of the Namespace_* backend class. There are many things in PageProcessor that should be reorganized, and page actions in general should really be rethought. This is probably the beginning of a long process that will be taking place over the course of the betas.
Dan
parents:
871
diff
changeset
|
359 |
// close up the table if necessary |
323c4cd1aa37
Made some more changes to the way namespaces are handled, for optimization purposes. This is a bit of a structural reorganization: $paths->pages is obsoleted in its entirety; calculating page existence and metadata is now the job of the Namespace_* backend class. There are many things in PageProcessor that should be reorganized, and page actions in general should really be rethought. This is probably the beginning of a long process that will be taking place over the course of the betas.
Dan
parents:
871
diff
changeset
|
360 |
if ( $i % 2 > 0 ) |
323c4cd1aa37
Made some more changes to the way namespaces are handled, for optimization purposes. This is a bit of a structural reorganization: $paths->pages is obsoleted in its entirety; calculating page existence and metadata is now the job of the Namespace_* backend class. There are many things in PageProcessor that should be reorganized, and page actions in general should really be rethought. This is probably the beginning of a long process that will be taking place over the course of the betas.
Dan
parents:
871
diff
changeset
|
361 |
{ |
323c4cd1aa37
Made some more changes to the way namespaces are handled, for optimization purposes. This is a bit of a structural reorganization: $paths->pages is obsoleted in its entirety; calculating page existence and metadata is now the job of the Namespace_* backend class. There are many things in PageProcessor that should be reorganized, and page actions in general should really be rethought. This is probably the beginning of a long process that will be taking place over the course of the betas.
Dan
parents:
871
diff
changeset
|
362 |
echo "<td class=\"$cclass\"></td>"; |
0 | 363 |
} |
364 |
echo '</table></div>'; |
|
365 |
$template->footer(); |
|
366 |
} |
|
367 |
||
368 |
function page_Special_About_Enano() |
|
369 |
{ |
|
370 |
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
|
371 |
global $lang; |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
372 |
|
0 | 373 |
$platform = 'Unknown'; |
374 |
$uname = @file_get_contents('/proc/sys/kernel/ostype'); |
|
375 |
if($uname == "Linux\n") |
|
376 |
$platform = 'Linux'; |
|
377 |
else if(file_exists('/hurd/pfinet')) // I have a little experience with GNU/Hurd :-) http://hurdvm.enanocms.org/ |
|
378 |
$platform = 'GNU/Hurd'; |
|
871 | 379 |
else if(strtolower(PHP_OS) == 'winnt') |
0 | 380 |
$platform = 'Windows NT'; |
871 | 381 |
else if(strtolower(PHP_OS) == 'win32') |
0 | 382 |
$platform = 'Windows 9x/DOS'; |
722 | 383 |
else if(file_exists('/System/Library/CoreServices/SystemVersion.plist')) |
384 |
$platform = 'Mac OS X'; |
|
0 | 385 |
else if(file_exists('/bin/bash')) |
722 | 386 |
$platform = 'Other GNU'; |
0 | 387 |
else if(is_dir('/bin')) |
388 |
$platform = 'Other POSIX'; |
|
389 |
$template->header(); |
|
390 |
?> |
|
391 |
<br /> |
|
392 |
<div class="tblholder"> |
|
393 |
<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
|
394 |
<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
|
395 |
<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
|
396 |
<?php |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
397 |
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
|
398 |
$subst = array( |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
399 |
'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
|
400 |
); |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
401 |
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
|
402 |
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
|
403 |
// 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
|
404 |
// 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
|
405 |
?> |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
406 |
<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
|
407 |
<p> |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
408 |
This website is powered by <a href="http://enanocms.org/">Enano</a>, the lightweight and open source CMS that everyone can use. |
868
75dcd8cf6232
Special:About_Enano should be up to date for another 9 months.
Dan
parents:
801
diff
changeset
|
409 |
Enano is copyright © 2006-2009 Dan Fuhry. For legal information, along with a list of libraries that Enano uses, please |
221
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
410 |
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
|
411 |
</p> |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
412 |
<p> |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
413 |
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
|
414 |
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
|
415 |
<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
|
416 |
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
|
417 |
</p> |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
418 |
<p> |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
419 |
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
|
420 |
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
|
421 |
</p> |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
422 |
<p> |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
423 |
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
|
424 |
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
|
425 |
</p> |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
426 |
<p> |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
427 |
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
|
428 |
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
|
429 |
</p> |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
430 |
<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
|
431 |
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
|
432 |
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
|
433 |
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
|
434 |
</p> |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
435 |
<p> |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
436 |
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
|
437 |
</p> |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
438 |
<?php |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
439 |
endif; |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
440 |
?> |
0 | 441 |
</td></tr> |
442 |
<tr> |
|
443 |
<td class="row2" colspan="2"> |
|
53 | 444 |
<table border="0" style="margin: 0 auto; background: none; width: 100%;" cellpadding="5"> |
0 | 445 |
<tr> |
53 | 446 |
<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
|
447 |
<?php echo $template->fading_button; ?> |
0 | 448 |
</td> |
449 |
<td style="text-align: center;"> |
|
450 |
<a href="http://www.php.net/" onclick="window.open(this.href); return false;" style="background: none; padding: 0;"> |
|
451 |
<img alt="Written in PHP" src="<?php echo scriptPath; ?>/images/about-powered-php.png" style="border-width: 0px;" width="88" height="31" /> |
|
452 |
</a> |
|
453 |
</td> |
|
454 |
<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
|
455 |
<?php |
5f1cd51bf1be
Many changes. Installer with PostgreSQL is broken badly and will be for some time.
Dan
parents:
317
diff
changeset
|
456 |
switch(ENANO_DBLAYER) |
5f1cd51bf1be
Many changes. Installer with PostgreSQL is broken badly and will be for some time.
Dan
parents:
317
diff
changeset
|
457 |
{ |
5f1cd51bf1be
Many changes. Installer with PostgreSQL is broken badly and will be for some time.
Dan
parents:
317
diff
changeset
|
458 |
case 'MYSQL': |
5f1cd51bf1be
Many changes. Installer with PostgreSQL is broken badly and will be for some time.
Dan
parents:
317
diff
changeset
|
459 |
?> |
5f1cd51bf1be
Many changes. Installer with PostgreSQL is broken badly and will be for some time.
Dan
parents:
317
diff
changeset
|
460 |
<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
|
461 |
<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
|
462 |
</a> |
5f1cd51bf1be
Many changes. Installer with PostgreSQL is broken badly and will be for some time.
Dan
parents:
317
diff
changeset
|
463 |
<?php |
5f1cd51bf1be
Many changes. Installer with PostgreSQL is broken badly and will be for some time.
Dan
parents:
317
diff
changeset
|
464 |
break; |
5f1cd51bf1be
Many changes. Installer with PostgreSQL is broken badly and will be for some time.
Dan
parents:
317
diff
changeset
|
465 |
case 'PGSQL': |
5f1cd51bf1be
Many changes. Installer with PostgreSQL is broken badly and will be for some time.
Dan
parents:
317
diff
changeset
|
466 |
?> |
5f1cd51bf1be
Many changes. Installer with PostgreSQL is broken badly and will be for some time.
Dan
parents:
317
diff
changeset
|
467 |
<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
|
468 |
<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
|
469 |
</a> |
5f1cd51bf1be
Many changes. Installer with PostgreSQL is broken badly and will be for some time.
Dan
parents:
317
diff
changeset
|
470 |
<?php |
5f1cd51bf1be
Many changes. Installer with PostgreSQL is broken badly and will be for some time.
Dan
parents:
317
diff
changeset
|
471 |
break; |
5f1cd51bf1be
Many changes. Installer with PostgreSQL is broken badly and will be for some time.
Dan
parents:
317
diff
changeset
|
472 |
} |
5f1cd51bf1be
Many changes. Installer with PostgreSQL is broken badly and will be for some time.
Dan
parents:
317
diff
changeset
|
473 |
?> |
0 | 474 |
</td> |
475 |
</tr> |
|
476 |
</table> |
|
477 |
</td> |
|
478 |
</tr> |
|
221
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
479 |
<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
|
480 |
<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
|
481 |
<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
|
482 |
<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
|
483 |
<?php |
5f1cd51bf1be
Many changes. Installer with PostgreSQL is broken badly and will be for some time.
Dan
parents:
317
diff
changeset
|
484 |
switch(ENANO_DBLAYER) |
5f1cd51bf1be
Many changes. Installer with PostgreSQL is broken badly and will be for some time.
Dan
parents:
317
diff
changeset
|
485 |
{ |
5f1cd51bf1be
Many changes. Installer with PostgreSQL is broken badly and will be for some time.
Dan
parents:
317
diff
changeset
|
486 |
case 'MYSQL': |
5f1cd51bf1be
Many changes. Installer with PostgreSQL is broken badly and will be for some time.
Dan
parents:
317
diff
changeset
|
487 |
?> |
326 | 488 |
<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
|
489 |
<?php |
5f1cd51bf1be
Many changes. Installer with PostgreSQL is broken badly and will be for some time.
Dan
parents:
317
diff
changeset
|
490 |
break; |
5f1cd51bf1be
Many changes. Installer with PostgreSQL is broken badly and will be for some time.
Dan
parents:
317
diff
changeset
|
491 |
case 'PGSQL': |
5f1cd51bf1be
Many changes. Installer with PostgreSQL is broken badly and will be for some time.
Dan
parents:
317
diff
changeset
|
492 |
$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
|
493 |
$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
|
494 |
?> |
326 | 495 |
<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
|
496 |
<?php |
5f1cd51bf1be
Many changes. Installer with PostgreSQL is broken badly and will be for some time.
Dan
parents:
317
diff
changeset
|
497 |
break; |
5f1cd51bf1be
Many changes. Installer with PostgreSQL is broken badly and will be for some time.
Dan
parents:
317
diff
changeset
|
498 |
} |
5f1cd51bf1be
Many changes. Installer with PostgreSQL is broken badly and will be for some time.
Dan
parents:
317
diff
changeset
|
499 |
?> |
0 | 500 |
</table> |
501 |
</div> |
|
502 |
<?php |
|
503 |
$template->footer(); |
|
504 |
} |
|
505 |
||
506 |
function page_Special_GNU_General_Public_License() |
|
507 |
{ |
|
508 |
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
|
509 |
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
|
510 |
|
0 | 511 |
$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
|
512 |
if(file_exists(ENANO_ROOT . '/GPL')) |
0 | 513 |
{ |
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
|
514 |
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
|
515 |
|
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
|
516 |
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
|
517 |
// 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
|
518 |
// must be accompanied by a copy of the English GPL.) |
0 | 519 |
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
|
520 |
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
|
521 |
|
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
|
522 |
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
|
523 |
{ |
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
|
524 |
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
|
525 |
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
|
526 |
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
|
527 |
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
|
528 |
} |
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
|
529 |
|
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
|
530 |
echo RenderMan::render( file_get_contents ( ENANO_ROOT . '/GPL' ) ); |
0 | 531 |
} |
532 |
else |
|
533 |
{ |
|
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
|
534 |
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
|
535 |
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
|
536 |
// 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
|
537 |
// 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
|
538 |
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 | 539 |
} |
540 |
$template->footer(); |
|
541 |
} |
|
542 |
||
83 | 543 |
function page_Special_TagCloud() |
544 |
{ |
|
545 |
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
|
546 |
global $lang; |
83 | 547 |
|
548 |
$template->header(); |
|
549 |
||
550 |
if ( $tag = $paths->getParam(0) ) |
|
551 |
{ |
|
552 |
$tag = sanitize_tag($tag); |
|
553 |
$q = $db->sql_query('SELECT page_id, namespace FROM '.table_prefix.'tags WHERE tag_name=\'' . $db->escape($tag) . '\';'); |
|
554 |
if ( !$q ) |
|
555 |
$db->_die(); |
|
556 |
if ( $row = $db->fetchrow() ) |
|
557 |
{ |
|
558 |
echo '<div class="tblholder"> |
|
559 |
<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
|
560 |
echo '<tr><th colspan="2">' . $lang->get('pagetools_tagcloud_pagelist_th', array('tag' => htmlspecialchars($tag))) . '</th></tr>'; |
83 | 561 |
echo '<tr>'; |
562 |
$i = 0; |
|
563 |
$td_class = 'row1'; |
|
564 |
do |
|
565 |
{ |
|
566 |
if ( $i % 2 == 0 && $i > 1 ) |
|
567 |
{ |
|
568 |
$td_class = ( $td_class == 'row2' ) ? 'row1' : 'row2'; |
|
569 |
echo '</tr><tr>'; |
|
570 |
} |
|
571 |
$i++; |
|
572 |
$title = get_page_title_ns($row['page_id'], $row['namespace']); |
|
573 |
if ( $row['namespace'] != 'Article' && isset($paths->nslist[$row['namespace']]) ) |
|
574 |
$title = $paths->nslist[$row['namespace']] . $title; |
|
575 |
$url = makeUrlNS($row['namespace'], $row['page_id']); |
|
576 |
$class = ( isPage( $paths->nslist[$row['namespace']] . $row['page_id'] ) ) ? '' : ' class="wikilink-nonexistent"'; |
|
577 |
$link = '<a href="' . htmlspecialchars($url) . '"' . $class . '>' . htmlspecialchars($title) . '</a>'; |
|
578 |
echo "<td class=\"$td_class\" style=\"width: 50%;\">$link</td>"; |
|
579 |
// " workaround for jEdit highlighting bug |
|
580 |
} |
|
581 |
while ( $row = $db->fetchrow() ); |
|
582 |
while ( $i % 2 > 0 ) |
|
583 |
{ |
|
584 |
$i++; |
|
585 |
echo "<td class=\"$td_class\" style=\"width: 50%;\"></td>"; |
|
586 |
} |
|
587 |
// " workaround for jEdit highlighting bug |
|
588 |
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
|
589 |
<th colspan="2" class="subhead"><a href="' . makeUrlNS('Special', 'TagCloud') . '">« ' . $lang->get('pagetools_tagcloud_btn_return') . '</a></th> |
83 | 590 |
</tr>'; |
591 |
echo '</table>'; |
|
592 |
echo '</div>'; |
|
593 |
} |
|
594 |
} |
|
595 |
else |
|
596 |
{ |
|
597 |
$cloud = new TagCloud(); |
|
598 |
||
599 |
$q = $db->sql_query('SELECT tag_name FROM '.table_prefix.'tags;'); |
|
600 |
if ( !$q ) |
|
601 |
$db->_die(); |
|
602 |
if ( $db->numrows() < 1 ) |
|
603 |
{ |
|
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
|
604 |
echo '<p>' . $lang->get('pagetools_tagcloud_msg_no_tags') . '</p>'; |
83 | 605 |
} |
606 |
else |
|
607 |
{ |
|
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
|
608 |
echo '<h3>' . $lang->get('pagetools_tagcloud_blurb') . '</h3>'; |
83 | 609 |
while ( $row = $db->fetchrow() ) |
610 |
{ |
|
611 |
$cloud->add_word($row['tag_name']); |
|
612 |
} |
|
613 |
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
|
614 |
echo '<p>' . $lang->get('pagetools_tagcloud_instructions') . '</p>'; |
83 | 615 |
} |
616 |
} |
|
617 |
||
618 |
$template->footer(); |
|
619 |
} |
|
620 |
||
581
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
621 |
function page_Special_Autofill() |
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
622 |
{ |
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
623 |
global $db, $session, $paths, $template, $plugins; // Common objects |
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
624 |
global $lang; |
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
625 |
|
648
082b7b47b859
Fixed missing require() on search.php in Special:Autofill (damn, when is this going to end?)
Dan
parents:
607
diff
changeset
|
626 |
require_once(ENANO_ROOT . '/includes/search.php'); |
082b7b47b859
Fixed missing require() on search.php in Special:Autofill (damn, when is this going to end?)
Dan
parents:
607
diff
changeset
|
627 |
|
581
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
628 |
header('Content-type: text/javascript'); |
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
629 |
|
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
630 |
$dataset = array(); |
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
631 |
if ( isset($_GET['type']) ) |
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
632 |
{ |
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
633 |
switch($_GET['type']) |
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
634 |
{ |
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
635 |
case 'username': |
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
636 |
if ( isset($_GET['userinput']) && strlen($_GET['userinput']) >= 3 ) |
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
637 |
{ |
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
638 |
$search = '%' . escape_string_like($_GET['userinput']) . '%'; |
701
dd80cde96a6c
Autocomplete further stabilized. Made Special:PasswordReset and Special:Register prevent use if logged in.
Dan
parents:
699
diff
changeset
|
639 |
$min_id = ( isset($_GET['allow_anon']) && $_GET['allow_anon'] == '1' ) ? '1' : '2'; |
dd80cde96a6c
Autocomplete further stabilized. Made Special:PasswordReset and Special:Register prevent use if logged in.
Dan
parents:
699
diff
changeset
|
640 |
$q = $db->sql_query('SELECT username FROM ' . table_prefix . "users WHERE " . ENANO_SQLFUNC_LOWERCASE . "(username) LIKE '$search' AND user_id >= $min_id"); |
581
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
641 |
if ( !$q ) |
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
642 |
$db->die_json(); |
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
643 |
|
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
644 |
while ( $row = $db->fetchrow() ) |
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
645 |
{ |
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
646 |
$key = array( |
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
647 |
'name' => $row['username'], |
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
648 |
'name_highlight' => highlight_term($_GET['userinput'], $row['username'], '<b>', '</b>') |
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
649 |
); |
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
650 |
$key = array_merge($key, $session->get_user_rank($row['username'])); |
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
651 |
$key['rank_title'] = $lang->get($key['rank_title']); |
699
c7d737202d59
Removed Adobe Spry and replaced with jQuery. Please report any new bugs on the forums or via IRC. In a related note, auto-completion should work now at least for usernames. Still hacking away at page name completion...
Dan
parents:
685
diff
changeset
|
652 |
$key[0] = $row['username']; |
581
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
653 |
$dataset[] = $key; |
699
c7d737202d59
Removed Adobe Spry and replaced with jQuery. Please report any new bugs on the forums or via IRC. In a related note, auto-completion should work now at least for usernames. Still hacking away at page name completion...
Dan
parents:
685
diff
changeset
|
654 |
// $dataset[] = array($row['username'], $row['username']); |
c7d737202d59
Removed Adobe Spry and replaced with jQuery. Please report any new bugs on the forums or via IRC. In a related note, auto-completion should work now at least for usernames. Still hacking away at page name completion...
Dan
parents:
685
diff
changeset
|
655 |
// echo "{$row['username']}|{$row['username']}\n"; |
581
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
656 |
} |
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
657 |
} |
699
c7d737202d59
Removed Adobe Spry and replaced with jQuery. Please report any new bugs on the forums or via IRC. In a related note, auto-completion should work now at least for usernames. Still hacking away at page name completion...
Dan
parents:
685
diff
changeset
|
658 |
// return; |
581
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
659 |
break; |
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
660 |
case 'page': |
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
661 |
if ( isset($_GET['userinput']) && strlen($_GET['userinput']) >= 3 ) |
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
662 |
{ |
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
663 |
$search = '%' . escape_string_like($_GET['userinput']) . '%'; |
699
c7d737202d59
Removed Adobe Spry and replaced with jQuery. Please report any new bugs on the forums or via IRC. In a related note, auto-completion should work now at least for usernames. Still hacking away at page name completion...
Dan
parents:
685
diff
changeset
|
664 |
$q = $db->sql_query('SELECT urlname, namespace, name FROM ' . table_prefix . "pages\n" |
581
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
665 |
. " WHERE (\n" |
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
666 |
. " " . ENANO_SQLFUNC_LOWERCASE . "(urlname) LIKE '$search'\n" |
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
667 |
. " OR " . ENANO_SQLFUNC_LOWERCASE . "(name) LIKE '$search'\n" |
699
c7d737202d59
Removed Adobe Spry and replaced with jQuery. Please report any new bugs on the forums or via IRC. In a related note, auto-completion should work now at least for usernames. Still hacking away at page name completion...
Dan
parents:
685
diff
changeset
|
668 |
. " );"); |
581
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
669 |
if ( !$q ) |
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
670 |
$db->die_json(); |
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
671 |
|
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
672 |
while ( $row = $db->fetchrow() ) |
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
673 |
{ |
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
674 |
$pathskey = ( isset($paths->nslist[$row['namespace']]) ? $paths->nslist[$row['namespace']] : $row['namespace'] . substr($paths->nslist['Special'], -1) ) . $row['urlname']; |
701
dd80cde96a6c
Autocomplete further stabilized. Made Special:PasswordReset and Special:Register prevent use if logged in.
Dan
parents:
699
diff
changeset
|
675 |
|
581
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
676 |
$key = array( |
699
c7d737202d59
Removed Adobe Spry and replaced with jQuery. Please report any new bugs on the forums or via IRC. In a related note, auto-completion should work now at least for usernames. Still hacking away at page name completion...
Dan
parents:
685
diff
changeset
|
677 |
0 => $pathskey, |
581
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
678 |
'pid_highlight' => highlight_term($_GET['userinput'], dirtify_page_id($pathskey), '<b>', '</b>'), |
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
679 |
'name_highlight' => highlight_term($_GET['userinput'], $row['name'], '<b>', '</b>') |
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
680 |
); |
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
681 |
$dataset[] = $key; |
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
682 |
} |
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
683 |
} |
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
684 |
break; |
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
685 |
default: |
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
686 |
$code = $plugins->setHook('autofill_json_request'); |
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
687 |
foreach ( $code as $cmd ) |
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
688 |
{ |
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
689 |
eval($cmd); |
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
690 |
} |
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
691 |
break; |
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
692 |
} |
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
693 |
} |
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
694 |
|
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
695 |
echo enano_json_encode($dataset); |
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
696 |
} |
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
697 |
|
0 | 698 |
?> |