# HG changeset patch
# User Dan
# Date 1241981090 14400
# Node ID e5abd87bccef3e39b113569bd0d090d11be31d04
# Parent e74741b8360bdd21915607828c21a90b47c919a8# Parent 25b1bdce985b3a13b577cd9649efad1c18dc7e5c
Merging from accidental branch split
diff -r 25b1bdce985b -r e5abd87bccef includes/paths.php
--- a/includes/paths.php Tue May 05 22:06:23 2009 -0400
+++ b/includes/paths.php Sun May 10 14:44:50 2009 -0400
@@ -1115,4 +1115,28 @@
}
+/**
+ * Register a special page.
+ * @param string urlname of the page ("Administration" in "Special:Administration")
+ * @param string Page title; if in the right format, will be treated as a l10n string identifier
+ * @param bool If true, page is visible (shown in lists/search). Otherwise, hidden. Defaults to true.
+ */
+
+function register_special_page($urlname, $name, $visible = true)
+{
+ global $paths;
+
+ return $paths->add_page(Array(
+ 'name' => $name,
+ 'urlname' => $urlname,
+ 'namespace' => 'Special',
+ 'special' => 0,
+ 'visible' => $visible ? 1 : 0,
+ 'comments_on' => 0,
+ 'protected' => 1,
+ 'delvotes' => 0,
+ 'delvote_ips' => '',
+ ));
+}
+
?>
diff -r 25b1bdce985b -r e5abd87bccef includes/template.php
--- a/includes/template.php Tue May 05 22:06:23 2009 -0400
+++ b/includes/template.php Sun May 10 14:44:50 2009 -0400
@@ -336,15 +336,17 @@
function get_css($s = false)
{
global $db, $session, $paths, $template, $plugins; // Common objects
- if(!defined('ENANO_TEMPLATE_LOADED'))
- $this->load_theme($session->theme, $session->style);
+ $this->init_vars();
+
$path = ( $s ) ? 'css/'.$s : 'css/'.$this->style.'.css';
+
if ( !file_exists(ENANO_ROOT . '/themes/' . $this->theme . '/' . $path) )
{
echo "/* WARNING: Falling back to default file because file $path does not exist */\n";
$path = 'css/' . $this->style_list[0] . '.css';
}
- return '
' . htmlspecialchars(getConfig('site_desc')) . '
'); + $this->theme_initted = true; } @@ -873,7 +878,7 @@ // Protect button if ( $conds['protect'] ) { - switch($this->page->ns->page_protected) + switch($this->page->ns->cdata['protected']) { case PROTECT_FULL: $protect_status = $lang->get('onpage_btn_protect_on'); break; case PROTECT_SEMI: $protect_status = $lang->get('onpage_btn_protect_semi'); break; @@ -885,7 +890,7 @@ $t0 = $label->run(); $menubtn->assign_vars(array( - 'FLAGS' => 'accesskey="p" onclick="ajaxProtect(' . $this->page->ns->page_protected . '); return false;" id="tb_ajax_protect_btn" title="' . $lang->get('onpage_tip_protect') . '"', + 'FLAGS' => 'accesskey="p" onclick="ajaxProtect(' . $this->page->ns->cdata['protected'] . '); return false;" id="tb_ajax_protect_btn" title="' . $lang->get('onpage_tip_protect') . '"', 'HREF' => makeUrl($local_page, 'do=protect', true), 'TEXT' => $lang->get('onpage_btn_protect_change') )); @@ -2863,8 +2868,9 @@ } return $ds; } - function get_css($s = false) { - if($s) + function get_css($s = false) + { + if ( $s ) return $this->process_template('css/'.$s); else return $this->process_template('css/'.$this->style.'.css'); diff -r 25b1bdce985b -r e5abd87bccef language/english/core.json --- a/language/english/core.json Tue May 05 22:06:23 2009 -0400 +++ b/language/english/core.json Sun May 10 14:44:50 2009 -0400 @@ -536,6 +536,7 @@ title_tools: 'Tools', title_search: 'Search', title_links: 'Links', + title_about: 'About', btn_home: 'Home', btn_createpage: 'Create a page', diff -r 25b1bdce985b -r e5abd87bccef plugins/PrivateMessages.php --- a/plugins/PrivateMessages.php Tue May 05 22:06:23 2009 -0400 +++ b/plugins/PrivateMessages.php Sun May 10 14:44:50 2009 -0400 @@ -5,7 +5,7 @@ "Plugin URI" : "http://enanocms.org/", "Description" : "plugin_privatemessages_desc", "Author" : "Dan Fuhry", - "Version" : "1.1.5", + "Version" : "1.1.6", "Author URI" : "http://enanocms.org/" } **!*/ @@ -24,17 +24,9 @@ global $db, $session, $paths, $template, $plugins; // Common objects -// $plugins->attachHook('session_started', 'PrivateMessages_paths_init();'); - function PrivateMessages_paths_init() { - global $paths; - $paths->add_page(Array( - 'name'=>'specialpage_private_messages', - 'urlname'=>'PrivateMessages', - 'namespace'=>'Special', - 'special'=>0,'visible'=>1,'comments_on'=>0,'protected'=>1,'delvotes'=>0,'delvote_ips'=>'', - )); + register_special_page('PrivateMessages', 'specialpage_private_messages'); } function page_Special_PrivateMessages() diff -r 25b1bdce985b -r e5abd87bccef plugins/SpecialAdmin.php --- a/plugins/SpecialAdmin.php Tue May 05 22:06:23 2009 -0400 +++ b/plugins/SpecialAdmin.php Sun May 10 14:44:50 2009 -0400 @@ -5,7 +5,7 @@ "Plugin URI" : "http://enanocms.org/", "Description" : "plugin_specialadmin_desc", "Author" : "Dan Fuhry", - "Version" : "1.1.5", + "Version" : "1.1.6", "Author URI" : "http://enanocms.org/" } **!*/ @@ -29,19 +29,9 @@ function SpecialAdmin_paths_init() { global $paths; - $paths->add_page(Array( - 'name'=>'specialpage_administration', - 'urlname'=>'Administration', - 'namespace'=>'Special', - 'special'=>0,'visible'=>1,'comments_on'=>0,'protected'=>1,'delvotes'=>0,'delvote_ips'=>'', - )); - $paths->add_page(Array( - 'name'=>'specialpage_manage_sidebar', - 'urlname'=>'EditSidebar', - 'namespace'=>'Special', - 'special'=>0,'visible'=>1,'comments_on'=>0,'protected'=>1,'delvotes'=>0,'delvote_ips'=>'', - )); + register_special_page('Administration', 'specialpage_administration'); + register_special_page('EditSidebar', 'specialpage_manage_sidebar'); } $plugins->attachHook('base_classes_initted', 'SpecialAdmin_include();'); diff -r 25b1bdce985b -r e5abd87bccef plugins/SpecialCSS.php --- a/plugins/SpecialCSS.php Tue May 05 22:06:23 2009 -0400 +++ b/plugins/SpecialCSS.php Sun May 10 14:44:50 2009 -0400 @@ -5,7 +5,7 @@ "Plugin URI" : "http://enanocms.org/", "Description" : "plugin_specialcss_desc", "Author" : "Dan Fuhry", - "Version" : "1.1.5", + "Version" : "1.1.6", "Author URI" : "http://enanocms.org/" } **!*/ @@ -24,17 +24,10 @@ global $db, $session, $paths, $template, $plugins; // Common objects -// $plugins->attachHook('session_started', 'SpecialCSS_paths_init();'); - function SpecialCSS_paths_init() { global $paths; - $paths->add_page(Array( - 'name'=>'specialpage_css', - 'urlname'=>'CSS', - 'namespace'=>'Special', - 'special'=>0,'visible'=>0,'comments_on'=>0,'protected'=>1,'delvotes'=>0,'delvote_ips'=>'', - )); + register_special_page('CSS', 'specialpage_css', false); } // function names are IMPORTANT!!! The name pattern is: page_