Changeset 2170
- Timestamp:
- 04/09/10 09:34:08 (13 years ago)
- Location:
- themes/freshy2
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
themes/freshy2/_config.php
r1984 r2170 18 18 require dirname(__FILE__).'/lib/class.freshy2.config.php'; 19 19 20 if (!version_compare(DC_VERSION,'2.1.6','<=')) { 21 $core->blog->settings->addNamespace('freshy2'); 22 $freshy2_settings =& $core->blog->settings->freshy2; 23 } else { 24 $core->blog->settings->setNamespace('freshy2'); 25 $freshy2_settings =& $core->blog->settings; 26 } 27 20 28 $config = new freshy2Config($core); 21 29 … … 23 31 $custom_themes_combo = $config->getCustomThemes(); 24 32 $images = $config->getHeaderImages(); 25 $current_custom_theme = $ core->blog->settings->freshy2_custom;26 $current_top_image = $ core->blog->settings->freshy2_top_image;27 $left_sidebar = $ core->blog->settings->freshy2_sidebar_left;28 $right_sidebar = $ core->blog->settings->freshy2_sidebar_right;33 $current_custom_theme = $freshy2_settings->freshy2_custom; 34 $current_top_image = $freshy2_settings->freshy2_top_image; 35 $left_sidebar = $freshy2_settings->freshy2_sidebar_left; 36 $right_sidebar = $freshy2_settings->freshy2_sidebar_right; 29 37 if ($current_custom_theme == null) { 30 38 $current_custom_theme = 'default'; … … 42 50 $left_sidebar = $_POST['left_sidebar']; 43 51 $right_sidebar = $_POST['right_sidebar']; 44 $core->blog->settings->setNamespace('themes'); 45 $core->blog->settings->put('freshy2_custom',$current_custom_theme,'string'); 46 $core->blog->settings->put('freshy2_top_image',$current_top_image,'string'); 47 $core->blog->settings->put('freshy2_sidebar_left',$left_sidebar,'string'); 48 $core->blog->settings->put('freshy2_sidebar_right',$right_sidebar,'string'); 52 $freshy2_settings->put('freshy2_custom',$current_custom_theme,'string'); 53 $freshy2_settings->put('freshy2_top_image',$current_top_image,'string'); 54 $freshy2_settings->put('freshy2_sidebar_left',$left_sidebar,'string'); 55 $freshy2_settings->put('freshy2_sidebar_right',$right_sidebar,'string'); 49 56 $core->blog->triggerBlog(); 50 57 } -
themes/freshy2/_public.php
r1851 r2170 22 22 class tplFreshy2Theme 23 23 { 24 public static $settings; 25 26 public static function initSettings() { 27 global $core; 28 if (!version_compare(DC_VERSION,'2.1.6','<=')) 29 self::$settings =& $core->blog->settings->freshy2; 30 else 31 self::$settings =& $core->blog->settings; 32 } 33 24 34 public static function FreshyStyleSheet($attr) { 25 35 return "style.css"; … … 28 38 public static function FreshyLayoutClass($attr) { 29 39 $p = '<?php '."\n"; 30 $p .= 'if ( $core->blog->settings->freshy2_sidebar_right != "none")'."\n";40 $p .= 'if (tplFreshy2Theme::$settings->freshy2_sidebar_right != "none")'."\n"; 31 41 $p .= ' echo "sidebar_right ";'."\n"; 32 $p .= 'if ( $core->blog->settings->freshy2_sidebar_left != "none")'."\n";42 $p .= 'if (tplFreshy2Theme::$settings->freshy2_sidebar_left != "none")'."\n"; 33 43 $p .= ' echo "sidebar_left";'."\n"; 34 44 $p .= '?>'."\n"; … … 42 52 $pos="right"; 43 53 if ($pos == 'both') { 44 return '<?php if (( $core->blog->settings->freshy2_sidebar_left != "none") '.45 '&& ( $core->blog->settings->freshy2_sidebar_right != "none")): ?>'."\n".54 return '<?php if ((tplFreshy2Theme::$settings->freshy2_sidebar_left != "none") '. 55 '&& (tplFreshy2Theme::$settings->freshy2_sidebar_right != "none")): ?>'."\n". 46 56 $content."\n". 47 57 '<?php endif; ?>'."\n"; 48 58 } else { 49 59 $setting = "freshy2_sidebar_".$pos; 50 return '<?php if ( $core->blog->settings->'.$setting.' != "none"): ?>'."\n".60 return '<?php if (tplFreshy2Theme::$settings->'.$setting.' != "none"): ?>'."\n". 51 61 $content."\n". 52 62 '<?php endif; ?>'."\n"; … … 63 73 else 64 74 $value="nav"; 65 return '<?php if ( $core->blog->settings->'.$setting.' == "'.$value.'"): ?>'."\n".75 return '<?php if (tplFreshy2Theme::$settings->'.$setting.' == "'.$value.'"): ?>'."\n". 66 76 $content."\n". 67 77 '<?php endif; ?>'."\n"; … … 70 80 public static function publicHeadContent($core) 71 81 { 72 $cust = $core->blog->settings->freshy2_custom;73 $topimg = $core->blog->settings->freshy2_top_image;74 $theme_url= $core->blog->settings->themes_url."/".$core->blog->settings->theme;82 $cust = self::$settings->freshy2_custom; 83 $topimg = self::$settings->freshy2_top_image; 84 $theme_url= self::$settings->themes_url."/".self::$settings->theme; 75 85 76 86 $css_content=''; … … 163 173 164 174 } 175 176 tplFreshy2Theme::initSettings(); 165 177 ?>
Note: See TracChangeset
for help on using the changeset viewer.