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