# HG changeset patch # User Dan # Date 1241980911 14400 # Node ID 6b7644fec887d64fd1bad722de487eb65151e4eb # Parent de4f81abc5e3ce0e4495bfa8f6ca9e3b07638cfc Fixed a couple bugs with protection UI; fixed stray in Special:CSS (do people still use that?) diff -r de4f81abc5e3 -r 6b7644fec887 includes/template.php --- a/includes/template.php Tue May 05 21:53:48 2009 -0400 +++ b/includes/template.php Sun May 10 14:41:51 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 '' . $this->process_template($path) . ''; + + return $this->process_template($path); } function load_theme($name = false, $css = false) { @@ -639,6 +641,9 @@ 'STYLE_ID' => $this->style )); + // Add the site description sidebar block + $this->sidebar_widget($lang->get('sidebar_title_about'), '

' . 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');