Ignore:
Timestamp:
Mar 17, 2011, 12:35:45 AM (13 years ago)
Author:
patdenice
Message:

Compatible 2.2

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/PWG_Stuffs/trunk/class.inc.php

    r9736 r9737  
    1818    {
    1919      $this->prefixe = 'PLUGIN_PICTURE_';
    20       $template->set_prefilter('header', array('stuffs', 'prefilter_picture_css'));
     20      $template->func_combine_css(array(
     21        'path' => 'plugins/PWG_Stuffs/theme/stuffs_picture.css',
     22        ),
     23        $smarty
     24      );
    2125      pwgs_picture_special_sections();
    2226    }
    2327    else
    2428    {
    25       $template->set_prefilter( 'header', array('stuffs', 'prefilter_index_css') );
     29      $template->func_combine_css(array(
     30        'path' => 'plugins/PWG_Stuffs/theme/stuffs_index.css',
     31        ),
     32        $smarty
     33      );
    2634    }
    2735
     
    184192    $this->blocks[$this->pos][] = $block;
    185193  }
    186 
    187   static function prefilter_index_css($source, &$smarty)
    188   {
    189     $css = array(
    190       '<link rel="stylesheet" type="text/css" href="{$ROOT_URL}plugins/'.STUFFS_DIR.'/theme/stuffs_index.css">'
    191     );
    192 
    193     foreach ($smarty->get_template_vars('themes') as $theme)
    194     {
    195       if (file_exists(PHPWG_THEMES_PATH.$theme['id'].'/stuffs_index.css'))
    196       {
    197         array_push($css, '<link rel="stylesheet" type="text/css" href="{$ROOT_URL}themes/'.$theme['id'].'/stuffs_index.css">');
    198       }
    199     }
    200 
    201     $source = str_replace("\n</head>", "\n".implode( "\n", $css )."\n</head>", $source);
    202 
    203     return $source;
    204   }
    205 
    206   static function prefilter_picture_css($source, &$smarty)
    207   {
    208     $css = array(
    209       '<link rel="stylesheet" type="text/css" href="{$ROOT_URL}plugins/'.STUFFS_DIR.'/theme/stuffs_picture.css">'
    210     );
    211 
    212     foreach ($smarty->get_template_vars('themes') as $theme)
    213     {
    214       if (file_exists(PHPWG_THEMES_DIR.$theme['id'].'/stuffs_picture.css'))
    215       {
    216         array_push($css, '<link rel="stylesheet" type="text/css" href="{$ROOT_URL}themes/'.$theme['id'].'/stuffs_picture.css">');
    217       }
    218     }
    219 
    220     if (!empty($css))
    221     {
    222       $source = str_replace("\n</head>", "\n".implode( "\n", $css )."\n</head>", $source);
    223     }
    224 
    225     return $source;
    226   }
    227194}
    228195
Note: See TracChangeset for help on using the changeset viewer.