Dotclear

Changeset 2170


Ignore:
Timestamp:
04/09/10 09:34:08 (13 years ago)
Author:
bruno
Message:

Added dotclear 2.2 compatibility.

Location:
themes/freshy2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • themes/freshy2/_config.php

    r1984 r2170  
    1818require dirname(__FILE__).'/lib/class.freshy2.config.php'; 
    1919 
     20if (!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 
    2028$config = new freshy2Config($core); 
    2129 
     
    2331$custom_themes_combo = $config->getCustomThemes(); 
    2432$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; 
    2937if ($current_custom_theme == null) { 
    3038     $current_custom_theme = 'default'; 
     
    4250     $left_sidebar = $_POST['left_sidebar']; 
    4351     $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'); 
    4956     $core->blog->triggerBlog(); 
    5057} 
  • themes/freshy2/_public.php

    r1851 r2170  
    2222class tplFreshy2Theme 
    2323{ 
     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 
    2434     public static function FreshyStyleSheet($attr) { 
    2535          return "style.css"; 
     
    2838     public static function FreshyLayoutClass($attr) { 
    2939          $p = '<?php '."\n"; 
    30           $p .= 'if ($core->blog->settings->freshy2_sidebar_right != "none")'."\n"; 
     40          $p .= 'if (tplFreshy2Theme::$settings->freshy2_sidebar_right != "none")'."\n"; 
    3141          $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"; 
    3343          $p .= '  echo "sidebar_left";'."\n"; 
    3444          $p .= '?>'."\n"; 
     
    4252               $pos="right"; 
    4353          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". 
    4656                    $content."\n". 
    4757                    '<?php endif; ?>'."\n"; 
    4858          } else { 
    4959               $setting = "freshy2_sidebar_".$pos; 
    50                return '<?php if ($core->blog->settings->'.$setting.' != "none"): ?>'."\n". 
     60               return '<?php if (tplFreshy2Theme::$settings->'.$setting.' != "none"): ?>'."\n". 
    5161                    $content."\n". 
    5262                    '<?php endif; ?>'."\n"; 
     
    6373          else 
    6474               $value="nav"; 
    65           return '<?php if ($core->blog->settings->'.$setting.' == "'.$value.'"): ?>'."\n". 
     75          return '<?php if (tplFreshy2Theme::$settings->'.$setting.' == "'.$value.'"): ?>'."\n". 
    6676               $content."\n". 
    6777               '<?php endif; ?>'."\n"; 
     
    7080     public static function publicHeadContent($core) 
    7181     { 
    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; 
    7585 
    7686          $css_content=''; 
     
    163173 
    164174} 
     175 
     176tplFreshy2Theme::initSettings(); 
    165177?> 
Note: See TracChangeset for help on using the changeset viewer.

Sites map