author | Dan |
Mon, 04 May 2009 23:02:53 -0400 | |
changeset 945 | c19242d13a49 |
parent 871 | 4e45f191dc33 |
child 953 | 323c4cd1aa37 |
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", |
685
17ebe24cdf85
Rebranded as 1.1.5 (Caoineag alpha 5) and fixed a couple bugs related to CDN support in template_nodb and installerUI. Updated readme.
Dan
parents:
682
diff
changeset
|
8 |
"Version" : "1.1.5", |
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 |
{ |
0 | 31 |
global $paths; |
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
|
32 |
$paths->add_page(Array( |
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
|
33 |
'name'=>'specialpage_create_page', |
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
|
34 |
'urlname'=>'CreatePage', |
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
|
35 |
'namespace'=>'Special', |
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
|
36 |
'special'=>0,'visible'=>1,'comments_on'=>0,'protected'=>1,'delvotes'=>0,'delvote_ips'=>'', |
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
|
37 |
)); |
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 |
|
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
|
39 |
$paths->add_page(Array( |
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
|
40 |
'name'=>'specialpage_all_pages', |
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
|
41 |
'urlname'=>'AllPages', |
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
|
42 |
'namespace'=>'Special', |
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
|
43 |
'special'=>0,'visible'=>1,'comments_on'=>0,'protected'=>1,'delvotes'=>0,'delvote_ips'=>'', |
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
|
44 |
)); |
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
|
45 |
|
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
|
46 |
$paths->add_page(Array( |
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
|
47 |
'name'=>'specialpage_special_pages', |
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
|
48 |
'urlname'=>'SpecialPages', |
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
|
49 |
'namespace'=>'Special', |
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
|
50 |
'special'=>0,'visible'=>1,'comments_on'=>0,'protected'=>1,'delvotes'=>0,'delvote_ips'=>'', |
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
|
51 |
)); |
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
|
52 |
|
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
|
53 |
$paths->add_page(Array( |
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
|
54 |
'name'=>'specialpage_about_enano', |
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
|
55 |
'urlname'=>'About_Enano', |
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
|
56 |
'namespace'=>'Special', |
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
|
57 |
'special'=>0,'visible'=>1,'comments_on'=>0,'protected'=>1,'delvotes'=>0,'delvote_ips'=>'', |
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
|
58 |
)); |
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
|
59 |
|
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
|
60 |
$paths->add_page(Array( |
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
|
61 |
'name'=>'specialpage_gnu_gpl', |
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
|
62 |
'urlname'=>'GNU_General_Public_License', |
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
|
63 |
'namespace'=>'Special', |
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
|
64 |
'special'=>0,'visible'=>1,'comments_on'=>0,'protected'=>1,'delvotes'=>0,'delvote_ips'=>'', |
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
|
65 |
)); |
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
|
66 |
|
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
|
67 |
$paths->add_page(Array( |
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
|
68 |
'name'=>'specialpage_tag_cloud', |
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
|
69 |
'urlname'=>'TagCloud', |
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
|
70 |
'namespace'=>'Special', |
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
|
71 |
'special'=>0,'visible'=>1,'comments_on'=>0,'protected'=>1,'delvotes'=>0,'delvote_ips'=>'', |
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
|
72 |
)); |
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
|
73 |
|
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
|
74 |
$paths->add_page(Array( |
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
|
75 |
'name'=>'specialpage_autofill', |
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
|
76 |
'urlname'=>'Autofill', |
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
|
77 |
'namespace'=>'Special', |
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
|
78 |
'special'=>0,'visible'=>1,'comments_on'=>0,'protected'=>1,'delvotes'=>0,'delvote_ips'=>'', |
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
|
79 |
)); |
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
|
80 |
} |
0 | 81 |
|
82 |
// function names are IMPORTANT!!! The name pattern is: page_<namespace ID>_<page URLname, without namespace> |
|
83 |
||
22
d0314575e2f0
More preliminary l10n work; userpage portal style basics implemented
Dan
parents:
0
diff
changeset
|
84 |
function page_Special_CreatePage() |
d0314575e2f0
More preliminary l10n work; userpage portal style basics implemented
Dan
parents:
0
diff
changeset
|
85 |
{ |
0 | 86 |
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
|
87 |
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
|
88 |
|
426 | 89 |
$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
|
90 |
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
|
91 |
{ |
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
|
92 |
$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
|
93 |
} |
426 | 94 |
$code = $plugins->setHook('page_create_ns_whitelist'); |
95 |
foreach ( $code as $cmd ) |
|
96 |
{ |
|
97 |
eval($cmd); |
|
98 |
} |
|
99 |
||
100 |
$errors = array(); |
|
101 |
||
102 |
switch ( isset($_POST['page_title']) ) |
|
103 |
{ |
|
104 |
case true: |
|
105 |
// "Create page" was clicked |
|
106 |
||
107 |
// |
|
108 |
// VALIDATION CODE |
|
109 |
// |
|
110 |
||
111 |
// Check namespace |
|
112 |
$namespace = ( isset($_POST['namespace']) ) ? $_POST['namespace'] : 'Article'; |
|
113 |
if ( !in_array($namespace, $whitelist_ns) ) |
|
114 |
{ |
|
115 |
$errors[] = $lang->get('pagetools_create_err_invalid_namespace'); |
|
116 |
} |
|
117 |
||
118 |
// Check title and figure out urlname |
|
119 |
$title = $_POST['page_title']; |
|
120 |
$urlname = $_POST['page_title']; |
|
121 |
if ( @$_POST['custom_url'] === 'yes' && isset($_POST['urlname']) ) |
|
122 |
{ |
|
123 |
$urlname = $_POST['urlname']; |
|
124 |
} |
|
125 |
$urlname = sanitize_page_id($urlname); |
|
126 |
if ( $urlname == '.00' || empty($urlname) ) |
|
127 |
{ |
|
128 |
$errors[] = $lang->get('pagetools_create_err_invalid_urlname'); |
|
129 |
} |
|
130 |
||
131 |
// Validate page existence |
|
132 |
$pathskey = $paths->nslist[$namespace] . $urlname; |
|
133 |
if ( isPage($pathskey) ) |
|
134 |
{ |
|
135 |
$errors[] = $lang->get('pagetools_create_err_already_exists'); |
|
136 |
} |
|
137 |
||
138 |
// Validate permissions |
|
139 |
$perms = $session->fetch_page_acl($urlname, $namespace); |
|
140 |
if ( !$perms->get_permissions('create_page') ) |
|
141 |
{ |
|
142 |
$errors[] = $lang->get('pagetools_create_err_no_permission'); |
|
143 |
} |
|
144 |
||
145 |
// Run hooks |
|
146 |
$code = $plugins->setHook('page_create_request'); |
|
147 |
foreach ( $code as $cmd ) |
|
148 |
{ |
|
149 |
eval($cmd); |
|
150 |
} |
|
151 |
||
152 |
// Create the page |
|
153 |
if ( count($errors) < 1 ) |
|
154 |
{ |
|
155 |
$page = new PageProcessor($urlname, $namespace); |
|
156 |
$page->create_page($title); |
|
157 |
if ( $error = $page->pop_error() ) |
|
158 |
{ |
|
159 |
do |
|
160 |
{ |
|
161 |
$errors[] = $error; |
|
162 |
} |
|
163 |
while ( $error = $page->pop_error() ); |
|
164 |
} |
|
165 |
else |
|
166 |
{ |
|
167 |
redirect(makeUrlNS($namespace, $urlname) . '#do:edit', '', '', 0); |
|
168 |
return true; |
|
169 |
} |
|
170 |
} |
|
171 |
||
172 |
break; |
|
173 |
} |
|
174 |
||
175 |
$template->header(); |
|
176 |
||
177 |
echo $lang->get('pagetools_create_blurb'); |
|
178 |
||
179 |
if ( count($errors) > 0 ) |
|
180 |
{ |
|
181 |
echo '<div class="error-box">' . implode("<br />\n ", $errors) . '</div>'; |
|
182 |
} |
|
183 |
||
184 |
?> |
|
185 |
<enano:no-opt> |
|
186 |
<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
|
187 |
window.cpGenPreviewUrl = function() |
426 | 188 |
{ |
588
20484deb89cd
Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents:
581
diff
changeset
|
189 |
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
|
190 |
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
|
191 |
|
426 | 192 |
var frm = document.forms['create_form']; |
193 |
var radio_custom = frm.getElementsByTagName('input')[2]; |
|
194 |
var use_custom_url = radio_custom.checked; |
|
195 |
if ( use_custom_url ) |
|
196 |
{ |
|
197 |
var title_src = frm.urlname.value; |
|
198 |
} |
|
199 |
else |
|
200 |
{ |
|
201 |
var title_src = frm.page_title.value; |
|
202 |
} |
|
203 |
var url = window.location.protocol + '//' + window.location.hostname + contentPath + namespace_list[frm.namespace.value] + sanitize_page_id(title_src); |
|
204 |
document.getElementById('createpage_url_preview').firstChild.nodeValue = url; |
|
205 |
} |
|
206 |
</script> |
|
207 |
</enano:no-opt> |
|
208 |
<?php |
|
209 |
||
210 |
echo '<form action="' . makeUrlNS('Special', 'CreatePage') . '" method="post" name="create_form">'; |
|
211 |
||
212 |
echo '<p>'; |
|
213 |
echo $lang->get('pagetools_create_field_title'); |
|
214 |
echo ' <input onkeyup="cpGenPreviewUrl();" type="text" name="page_title" size="40" tabindex="1" />'; |
|
215 |
echo '</p>'; |
|
216 |
||
217 |
echo '<p>'; |
|
218 |
echo $lang->get('pagetools_create_field_namespace'); |
|
219 |
echo ' <select onchange="cpGenPreviewUrl();" name="namespace" tabindex="2">'; |
|
220 |
foreach ( $paths->nslist as $ns => $ns_prefix ) |
|
221 |
{ |
|
222 |
if ( !in_array($ns, $whitelist_ns) ) |
|
223 |
continue; |
|
224 |
$lang_string = 'onpage_lbl_page_' . strtolower($ns); |
|
225 |
$str = $lang->get($lang_string); |
|
226 |
if ( $str == $lang_string ) |
|
227 |
$str = $ns; |
|
228 |
||
229 |
echo '<option value="' . $ns . '">' . ucwords($str) . '</option>'; |
|
230 |
} |
|
231 |
echo '</select>'; |
|
232 |
echo '</p>'; |
|
233 |
||
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
|
234 |
echo '<fieldset enano:expand="closed">'; |
426 | 235 |
echo '<legend>' . $lang->get('pagetools_create_group_advanced') . '</legend>'; |
236 |
||
237 |
echo '<p>'; |
|
238 |
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>'; |
|
239 |
echo '</p>'; |
|
240 |
||
241 |
echo '<p>'; |
|
242 |
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>'; |
|
243 |
echo '</p>'; |
|
244 |
||
245 |
echo '<p id="createpage_custom_url" style="display: none; margin-left: 2em;">'; |
|
246 |
echo $lang->get('pagetools_create_field_url'); |
|
247 |
echo ' <input onkeyup="cpGenPreviewUrl();" tabindex="4" type="text" name="urlname" value="" size="40" />'; |
|
248 |
echo '</p>'; |
|
249 |
||
250 |
echo '<p>'; |
|
251 |
echo $lang->get('pagetools_create_field_preview') . ' <tt id="createpage_url_preview"> </tt><br />'; |
|
252 |
echo '<small>' . $lang->get('pagetools_create_field_preview_hint') . '</small>'; |
|
253 |
echo '</p>'; |
|
254 |
||
255 |
echo '</fieldset>'; |
|
256 |
||
257 |
echo '<p>'; |
|
258 |
echo '<input tabindex="5" type="submit" value="' . $lang->get('pagetools_create_btn_create') . '" />'; |
|
259 |
echo '</p>'; |
|
260 |
||
261 |
echo '</form>'; |
|
262 |
||
588
20484deb89cd
Upgraded TinyMCE to 3.1.0.1. Ported a couple special pages to the componentized JS system.
Dan
parents:
581
diff
changeset
|
263 |
echo '<script type="text/javascript">addOnloadHook(cpGenPreviewUrl); addOnloadHook(function(){load_component(\'expander\')});</script>'; |
426 | 264 |
|
265 |
$template->footer(); |
|
266 |
} |
|
267 |
||
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
|
268 |
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
|
269 |
{ |
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
|
270 |
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
|
271 |
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
|
272 |
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
|
273 |
static $per_row = 2; |
117
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
116
diff
changeset
|
274 |
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
|
275 |
$return = ''; |
117
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
116
diff
changeset
|
276 |
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
|
277 |
{ |
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 |
$rowtracker = 0; |
117
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
116
diff
changeset
|
279 |
$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
|
280 |
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
|
281 |
} |
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
|
282 |
$rowtracker++; |
117
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
116
diff
changeset
|
283 |
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
|
284 |
{ |
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
|
285 |
$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
|
286 |
$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
|
287 |
} |
117
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
116
diff
changeset
|
288 |
if ( $rowtracker == 0 && !$first ) |
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
116
diff
changeset
|
289 |
$return .= "</tr>\n<tr>"; |
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
116
diff
changeset
|
290 |
|
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
116
diff
changeset
|
291 |
$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
|
292 |
|
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
|
293 |
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
|
294 |
$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
|
295 |
$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
|
296 |
$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
|
297 |
|
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
|
298 |
$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
|
299 |
$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
|
300 |
|
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 |
$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
|
302 |
$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
|
303 |
|
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 |
$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
|
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 |
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
|
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 |
|
0 | 309 |
function page_Special_AllPages() |
310 |
{ |
|
311 |
// This should be an easy one |
|
312 |
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
|
313 |
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
|
314 |
|
0 | 315 |
$template->header(); |
316 |
$sz = sizeof( $paths->pages ) / 2; |
|
335
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
334
diff
changeset
|
317 |
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
|
318 |
|
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 |
$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
|
320 |
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
|
321 |
$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
|
322 |
$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
|
323 |
$count = $row[0]; |
117
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
116
diff
changeset
|
324 |
|
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
116
diff
changeset
|
325 |
switch($count % 4) |
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
116
diff
changeset
|
326 |
{ |
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
116
diff
changeset
|
327 |
case 0: |
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
116
diff
changeset
|
328 |
case 2: |
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
116
diff
changeset
|
329 |
// even number of results; do nothing |
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
116
diff
changeset
|
330 |
$last_cell = ''; |
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
116
diff
changeset
|
331 |
break; |
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
116
diff
changeset
|
332 |
case 1: |
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
116
diff
changeset
|
333 |
// 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
|
334 |
$last_cell = '<td class="row1"></td>'; |
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
116
diff
changeset
|
335 |
break; |
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
116
diff
changeset
|
336 |
case 3: |
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
116
diff
changeset
|
337 |
// 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
|
338 |
$last_cell = '<td class="row2"></td>'; |
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
116
diff
changeset
|
339 |
break; |
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
116
diff
changeset
|
340 |
} |
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
116
diff
changeset
|
341 |
|
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
|
342 |
$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
|
343 |
|
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
|
344 |
$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
|
345 |
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
|
346 |
$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
|
347 |
|
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
|
348 |
$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
|
349 |
|
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
|
350 |
// 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
|
351 |
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
|
352 |
|
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
|
353 |
$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
|
354 |
$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
|
355 |
'{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
|
356 |
$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
|
357 |
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
|
358 |
$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
|
359 |
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
|
360 |
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
|
361 |
'<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
|
362 |
<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
|
363 |
<tr>', // print at start |
117
7cfdbb2fd17a
Bugfix in Special:AllPages; fixed tinyMCE under Opera (finally!)
Dan
parents:
116
diff
changeset
|
364 |
' ' . $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
|
365 |
</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
|
366 |
</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
|
367 |
); |
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
|
368 |
|
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
|
369 |
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
|
370 |
|
0 | 371 |
$template->footer(); |
372 |
} |
|
373 |
||
374 |
function page_Special_SpecialPages() |
|
375 |
{ |
|
376 |
// This should be an easy one |
|
377 |
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
|
378 |
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
|
379 |
|
0 | 380 |
$template->header(); |
381 |
$sz = sizeof($paths->pages) / 2; |
|
335
67bd3121a12e
Replaced TinyMCE 2.x with 3.0 beta 3. Supports everything but IE. Also rewrote the editor interface completely from the ground up.
Dan
parents:
334
diff
changeset
|
382 |
echo '<p>' . $lang->get('pagetools_specialpages_blurb') . '</p><div class="tblholder"><table border="0" width="100%" cellspacing="1" cellpadding="4">'; |
0 | 383 |
$cclass='row1'; |
384 |
for ( $i = 0; $i < $sz; $i = $i) |
|
385 |
{ |
|
386 |
if ( $cclass == 'row1' ) |
|
387 |
{ |
|
388 |
$cclass = 'row3'; |
|
389 |
} |
|
390 |
else if ( $cclass == 'row3') |
|
391 |
{ |
|
392 |
$cclass='row1'; |
|
393 |
} |
|
394 |
echo '<tr>'; |
|
395 |
for ( $j = 0; $j < 2; $j = $j ) |
|
396 |
{ |
|
397 |
if ( $i < $sz && $paths->pages[$i]['namespace'] == 'Special' && $paths->pages[$i]['visible'] == 1) |
|
398 |
{ |
|
399 |
echo '<td style="width: 50%" class="'.$cclass.'"><a href="'.makeUrl($paths->pages[$i]['urlname']).'">'; |
|
400 |
echo $paths->pages[$i]['name'].'</a></td>'; |
|
401 |
$j++; |
|
402 |
} |
|
403 |
else if ( $i >= $sz ) |
|
404 |
{ |
|
405 |
echo '<td style="width: 50%" class="row2"></td>'; |
|
406 |
$j++; |
|
407 |
} |
|
408 |
$i++; |
|
409 |
} |
|
410 |
echo '</tr>'; |
|
411 |
} |
|
412 |
echo '</table></div>'; |
|
413 |
$template->footer(); |
|
414 |
} |
|
415 |
||
416 |
function page_Special_About_Enano() |
|
417 |
{ |
|
418 |
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
|
419 |
global $lang; |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
420 |
|
0 | 421 |
$platform = 'Unknown'; |
422 |
$uname = @file_get_contents('/proc/sys/kernel/ostype'); |
|
423 |
if($uname == "Linux\n") |
|
424 |
$platform = 'Linux'; |
|
425 |
else if(file_exists('/hurd/pfinet')) // I have a little experience with GNU/Hurd :-) http://hurdvm.enanocms.org/ |
|
426 |
$platform = 'GNU/Hurd'; |
|
871 | 427 |
else if(strtolower(PHP_OS) == 'winnt') |
0 | 428 |
$platform = 'Windows NT'; |
871 | 429 |
else if(strtolower(PHP_OS) == 'win32') |
0 | 430 |
$platform = 'Windows 9x/DOS'; |
722 | 431 |
else if(file_exists('/System/Library/CoreServices/SystemVersion.plist')) |
432 |
$platform = 'Mac OS X'; |
|
0 | 433 |
else if(file_exists('/bin/bash')) |
722 | 434 |
$platform = 'Other GNU'; |
0 | 435 |
else if(is_dir('/bin')) |
436 |
$platform = 'Other POSIX'; |
|
437 |
$template->header(); |
|
438 |
?> |
|
439 |
<br /> |
|
440 |
<div class="tblholder"> |
|
441 |
<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
|
442 |
<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
|
443 |
<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
|
444 |
<?php |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
445 |
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
|
446 |
$subst = array( |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
447 |
'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
|
448 |
); |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
449 |
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
|
450 |
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
|
451 |
// 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
|
452 |
// 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
|
453 |
?> |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
454 |
<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
|
455 |
<p> |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
456 |
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
|
457 |
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
|
458 |
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
|
459 |
</p> |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
460 |
<p> |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
461 |
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
|
462 |
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
|
463 |
<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
|
464 |
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
|
465 |
</p> |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
466 |
<p> |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
467 |
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
|
468 |
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
|
469 |
</p> |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
470 |
<p> |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
471 |
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
|
472 |
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
|
473 |
</p> |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
474 |
<p> |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
475 |
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
|
476 |
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
|
477 |
</p> |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
478 |
<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
|
479 |
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
|
480 |
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
|
481 |
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
|
482 |
</p> |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
483 |
<p> |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
484 |
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
|
485 |
</p> |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
486 |
<?php |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
487 |
endif; |
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
488 |
?> |
0 | 489 |
</td></tr> |
490 |
<tr> |
|
491 |
<td class="row2" colspan="2"> |
|
53 | 492 |
<table border="0" style="margin: 0 auto; background: none; width: 100%;" cellpadding="5"> |
0 | 493 |
<tr> |
53 | 494 |
<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
|
495 |
<?php echo $template->fading_button; ?> |
0 | 496 |
</td> |
497 |
<td style="text-align: center;"> |
|
498 |
<a href="http://www.php.net/" onclick="window.open(this.href); return false;" style="background: none; padding: 0;"> |
|
499 |
<img alt="Written in PHP" src="<?php echo scriptPath; ?>/images/about-powered-php.png" style="border-width: 0px;" width="88" height="31" /> |
|
500 |
</a> |
|
501 |
</td> |
|
502 |
<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
|
503 |
<?php |
5f1cd51bf1be
Many changes. Installer with PostgreSQL is broken badly and will be for some time.
Dan
parents:
317
diff
changeset
|
504 |
switch(ENANO_DBLAYER) |
5f1cd51bf1be
Many changes. Installer with PostgreSQL is broken badly and will be for some time.
Dan
parents:
317
diff
changeset
|
505 |
{ |
5f1cd51bf1be
Many changes. Installer with PostgreSQL is broken badly and will be for some time.
Dan
parents:
317
diff
changeset
|
506 |
case 'MYSQL': |
5f1cd51bf1be
Many changes. Installer with PostgreSQL is broken badly and will be for some time.
Dan
parents:
317
diff
changeset
|
507 |
?> |
5f1cd51bf1be
Many changes. Installer with PostgreSQL is broken badly and will be for some time.
Dan
parents:
317
diff
changeset
|
508 |
<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
|
509 |
<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
|
510 |
</a> |
5f1cd51bf1be
Many changes. Installer with PostgreSQL is broken badly and will be for some time.
Dan
parents:
317
diff
changeset
|
511 |
<?php |
5f1cd51bf1be
Many changes. Installer with PostgreSQL is broken badly and will be for some time.
Dan
parents:
317
diff
changeset
|
512 |
break; |
5f1cd51bf1be
Many changes. Installer with PostgreSQL is broken badly and will be for some time.
Dan
parents:
317
diff
changeset
|
513 |
case 'PGSQL': |
5f1cd51bf1be
Many changes. Installer with PostgreSQL is broken badly and will be for some time.
Dan
parents:
317
diff
changeset
|
514 |
?> |
5f1cd51bf1be
Many changes. Installer with PostgreSQL is broken badly and will be for some time.
Dan
parents:
317
diff
changeset
|
515 |
<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
|
516 |
<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
|
517 |
</a> |
5f1cd51bf1be
Many changes. Installer with PostgreSQL is broken badly and will be for some time.
Dan
parents:
317
diff
changeset
|
518 |
<?php |
5f1cd51bf1be
Many changes. Installer with PostgreSQL is broken badly and will be for some time.
Dan
parents:
317
diff
changeset
|
519 |
break; |
5f1cd51bf1be
Many changes. Installer with PostgreSQL is broken badly and will be for some time.
Dan
parents:
317
diff
changeset
|
520 |
} |
5f1cd51bf1be
Many changes. Installer with PostgreSQL is broken badly and will be for some time.
Dan
parents:
317
diff
changeset
|
521 |
?> |
0 | 522 |
</td> |
523 |
</tr> |
|
524 |
</table> |
|
525 |
</td> |
|
526 |
</tr> |
|
221
e5302cb1945c
Localized a good part, if not all, of the registration page and a couple other things.
Dan
parents:
194
diff
changeset
|
527 |
<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
|
528 |
<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
|
529 |
<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
|
530 |
<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
|
531 |
<?php |
5f1cd51bf1be
Many changes. Installer with PostgreSQL is broken badly and will be for some time.
Dan
parents:
317
diff
changeset
|
532 |
switch(ENANO_DBLAYER) |
5f1cd51bf1be
Many changes. Installer with PostgreSQL is broken badly and will be for some time.
Dan
parents:
317
diff
changeset
|
533 |
{ |
5f1cd51bf1be
Many changes. Installer with PostgreSQL is broken badly and will be for some time.
Dan
parents:
317
diff
changeset
|
534 |
case 'MYSQL': |
5f1cd51bf1be
Many changes. Installer with PostgreSQL is broken badly and will be for some time.
Dan
parents:
317
diff
changeset
|
535 |
?> |
326 | 536 |
<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
|
537 |
<?php |
5f1cd51bf1be
Many changes. Installer with PostgreSQL is broken badly and will be for some time.
Dan
parents:
317
diff
changeset
|
538 |
break; |
5f1cd51bf1be
Many changes. Installer with PostgreSQL is broken badly and will be for some time.
Dan
parents:
317
diff
changeset
|
539 |
case 'PGSQL': |
5f1cd51bf1be
Many changes. Installer with PostgreSQL is broken badly and will be for some time.
Dan
parents:
317
diff
changeset
|
540 |
$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
|
541 |
$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
|
542 |
?> |
326 | 543 |
<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
|
544 |
<?php |
5f1cd51bf1be
Many changes. Installer with PostgreSQL is broken badly and will be for some time.
Dan
parents:
317
diff
changeset
|
545 |
break; |
5f1cd51bf1be
Many changes. Installer with PostgreSQL is broken badly and will be for some time.
Dan
parents:
317
diff
changeset
|
546 |
} |
5f1cd51bf1be
Many changes. Installer with PostgreSQL is broken badly and will be for some time.
Dan
parents:
317
diff
changeset
|
547 |
?> |
0 | 548 |
</table> |
549 |
</div> |
|
550 |
<?php |
|
551 |
$template->footer(); |
|
552 |
} |
|
553 |
||
554 |
function page_Special_GNU_General_Public_License() |
|
555 |
{ |
|
556 |
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
|
557 |
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
|
558 |
|
0 | 559 |
$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
|
560 |
if(file_exists(ENANO_ROOT . '/GPL')) |
0 | 561 |
{ |
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
|
562 |
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
|
563 |
|
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
|
564 |
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
|
565 |
// 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
|
566 |
// must be accompanied by a copy of the English GPL.) |
0 | 567 |
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
|
568 |
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
|
569 |
|
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
|
570 |
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
|
571 |
{ |
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
|
572 |
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
|
573 |
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
|
574 |
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
|
575 |
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
|
576 |
} |
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
|
577 |
|
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
|
578 |
echo RenderMan::render( file_get_contents ( ENANO_ROOT . '/GPL' ) ); |
0 | 579 |
} |
580 |
else |
|
581 |
{ |
|
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
|
582 |
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
|
583 |
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
|
584 |
// 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
|
585 |
// 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
|
586 |
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 | 587 |
} |
588 |
$template->footer(); |
|
589 |
} |
|
590 |
||
83 | 591 |
function page_Special_TagCloud() |
592 |
{ |
|
593 |
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
|
594 |
global $lang; |
83 | 595 |
|
596 |
$template->header(); |
|
597 |
||
598 |
if ( $tag = $paths->getParam(0) ) |
|
599 |
{ |
|
600 |
$tag = sanitize_tag($tag); |
|
601 |
$q = $db->sql_query('SELECT page_id, namespace FROM '.table_prefix.'tags WHERE tag_name=\'' . $db->escape($tag) . '\';'); |
|
602 |
if ( !$q ) |
|
603 |
$db->_die(); |
|
604 |
if ( $row = $db->fetchrow() ) |
|
605 |
{ |
|
606 |
echo '<div class="tblholder"> |
|
607 |
<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
|
608 |
echo '<tr><th colspan="2">' . $lang->get('pagetools_tagcloud_pagelist_th', array('tag' => htmlspecialchars($tag))) . '</th></tr>'; |
83 | 609 |
echo '<tr>'; |
610 |
$i = 0; |
|
611 |
$td_class = 'row1'; |
|
612 |
do |
|
613 |
{ |
|
614 |
if ( $i % 2 == 0 && $i > 1 ) |
|
615 |
{ |
|
616 |
$td_class = ( $td_class == 'row2' ) ? 'row1' : 'row2'; |
|
617 |
echo '</tr><tr>'; |
|
618 |
} |
|
619 |
$i++; |
|
620 |
$title = get_page_title_ns($row['page_id'], $row['namespace']); |
|
621 |
if ( $row['namespace'] != 'Article' && isset($paths->nslist[$row['namespace']]) ) |
|
622 |
$title = $paths->nslist[$row['namespace']] . $title; |
|
623 |
$url = makeUrlNS($row['namespace'], $row['page_id']); |
|
624 |
$class = ( isPage( $paths->nslist[$row['namespace']] . $row['page_id'] ) ) ? '' : ' class="wikilink-nonexistent"'; |
|
625 |
$link = '<a href="' . htmlspecialchars($url) . '"' . $class . '>' . htmlspecialchars($title) . '</a>'; |
|
626 |
echo "<td class=\"$td_class\" style=\"width: 50%;\">$link</td>"; |
|
627 |
// " workaround for jEdit highlighting bug |
|
628 |
} |
|
629 |
while ( $row = $db->fetchrow() ); |
|
630 |
while ( $i % 2 > 0 ) |
|
631 |
{ |
|
632 |
$i++; |
|
633 |
echo "<td class=\"$td_class\" style=\"width: 50%;\"></td>"; |
|
634 |
} |
|
635 |
// " workaround for jEdit highlighting bug |
|
636 |
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
|
637 |
<th colspan="2" class="subhead"><a href="' . makeUrlNS('Special', 'TagCloud') . '">« ' . $lang->get('pagetools_tagcloud_btn_return') . '</a></th> |
83 | 638 |
</tr>'; |
639 |
echo '</table>'; |
|
640 |
echo '</div>'; |
|
641 |
} |
|
642 |
} |
|
643 |
else |
|
644 |
{ |
|
645 |
$cloud = new TagCloud(); |
|
646 |
||
647 |
$q = $db->sql_query('SELECT tag_name FROM '.table_prefix.'tags;'); |
|
648 |
if ( !$q ) |
|
649 |
$db->_die(); |
|
650 |
if ( $db->numrows() < 1 ) |
|
651 |
{ |
|
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
|
652 |
echo '<p>' . $lang->get('pagetools_tagcloud_msg_no_tags') . '</p>'; |
83 | 653 |
} |
654 |
else |
|
655 |
{ |
|
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
|
656 |
echo '<h3>' . $lang->get('pagetools_tagcloud_blurb') . '</h3>'; |
83 | 657 |
while ( $row = $db->fetchrow() ) |
658 |
{ |
|
659 |
$cloud->add_word($row['tag_name']); |
|
660 |
} |
|
661 |
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
|
662 |
echo '<p>' . $lang->get('pagetools_tagcloud_instructions') . '</p>'; |
83 | 663 |
} |
664 |
} |
|
665 |
||
666 |
$template->footer(); |
|
667 |
} |
|
668 |
||
669 |
// tag cloud sidebar block |
|
670 |
function sidebar_add_tag_cloud() |
|
671 |
{ |
|
672 |
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
|
673 |
global $lang; |
83 | 674 |
$cloud = new TagCloud(); |
675 |
||
676 |
$q = $db->sql_query('SELECT tag_name FROM '.table_prefix.'tags;'); |
|
677 |
if ( !$q ) |
|
678 |
$db->_die(); |
|
679 |
if ( $db->numrows() < 1 ) |
|
680 |
{ |
|
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
|
681 |
$sb_html = $lang->get('pagetools_tagcloud_msg_no_tags'); |
83 | 682 |
} |
683 |
else |
|
684 |
{ |
|
685 |
while ( $row = $db->fetchrow() ) |
|
686 |
{ |
|
687 |
$cloud->add_word($row['tag_name']); |
|
688 |
} |
|
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
|
689 |
$sb_html = $cloud->make_html('small', 'justify') . '<br /><a style="text-align: center;" href="' . makeUrlNS('Special', 'TagCloud') . '">' . $lang->get('pagetools_tagcloud_sidebar_btn_larger') . '</a>'; |
83 | 690 |
} |
607
935f3799b654
First stab at cache management backend. Everything seems to have been tested and working so far, but a number of things require a more specialized cache and can't go through the framework (e.g. user ranks which use references to map usernames to user IDs)
Dan
parents:
593
diff
changeset
|
691 |
$template->sidebar_widget('pagetools_tagcloud_sidebar_title', "<div style='padding: 5px;'>$sb_html</div>"); |
83 | 692 |
} |
693 |
||
694 |
$plugins->attachHook('compile_template', 'sidebar_add_tag_cloud();'); |
|
695 |
||
581
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
696 |
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
|
697 |
{ |
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
698 |
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
|
699 |
global $lang; |
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
700 |
|
648
082b7b47b859
Fixed missing require() on search.php in Special:Autofill (damn, when is this going to end?)
Dan
parents:
607
diff
changeset
|
701 |
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
|
702 |
|
581
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
703 |
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
|
704 |
|
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
705 |
$dataset = array(); |
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
706 |
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
|
707 |
{ |
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
708 |
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
|
709 |
{ |
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
710 |
case 'username': |
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
711 |
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
|
712 |
{ |
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
713 |
$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
|
714 |
$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
|
715 |
$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
|
716 |
if ( !$q ) |
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
717 |
$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
|
718 |
|
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
719 |
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
|
720 |
{ |
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
721 |
$key = array( |
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
722 |
'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
|
723 |
'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
|
724 |
); |
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
725 |
$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
|
726 |
$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
|
727 |
$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
|
728 |
$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
|
729 |
// $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
|
730 |
// 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
|
731 |
} |
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
732 |
} |
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
|
733 |
// return; |
581
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
734 |
break; |
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
735 |
case 'page': |
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
736 |
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
|
737 |
{ |
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
738 |
$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
|
739 |
$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
|
740 |
. " WHERE (\n" |
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
741 |
. " " . 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
|
742 |
. " 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
|
743 |
. " );"); |
581
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
744 |
if ( !$q ) |
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
745 |
$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
|
746 |
|
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
747 |
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
|
748 |
{ |
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
749 |
$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
|
750 |
|
581
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
751 |
$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
|
752 |
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
|
753 |
'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
|
754 |
'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
|
755 |
); |
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
756 |
$dataset[] = $key; |
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
757 |
} |
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
758 |
} |
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
759 |
break; |
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
760 |
default: |
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
761 |
$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
|
762 |
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
|
763 |
{ |
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
764 |
eval($cmd); |
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
765 |
} |
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
766 |
break; |
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
767 |
} |
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
768 |
} |
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
769 |
|
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
770 |
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
|
771 |
} |
5e8fd89c02ea
Initial progress towards converting auto-completion framework to Spry. Not currently in a very working state.
Dan
parents:
564
diff
changeset
|
772 |
|
0 | 773 |
?> |