Changeset 8378 for trunk/include


Ignore:
Timestamp:
Dec 29, 2010, 10:00:25 PM (14 years ago)
Author:
rvelices
Message:

css sprites fix ie7 display
picture.tpl more compact + removed unnecessary escape modifiers + use footer_script
template combine_css small things

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/template.class.php

    r8305 r8378  
    9393    $this->smarty->register_function('get_combined_scripts', array(&$this, 'func_get_combined_scripts') );
    9494    $this->smarty->register_function('combine_css', array(&$this, 'func_combine_css') );
    95     $this->smarty->register_function('get_combined_css', array(&$this, 'func_get_combined_css') );
     95    $this->smarty->register_compiler_function('get_combined_css', array(&$this, 'func_get_combined_css') );
    9696    $this->smarty->register_block('footer_script', array(&$this, 'block_footer_script') );
    9797    $this->smarty->register_function('known_script', array(&$this, 'func_known_script') );
     
    443443          implode( "\n", $content ),
    444444          $this->output );
     445                        $this->css_by_priority = array();
    445446    }
    446447
     
    607608        $content[]= '<script type="text/javascript">';
    608609        $content[]= '(function() {
    609   var after = document.getElementsByTagName(\'script\')[document.getElementsByTagName(\'script\').length-1];
    610   var s;';
     610var after = document.getElementsByTagName(\'script\')[document.getElementsByTagName(\'script\').length-1];
     611var s;';
    611612        foreach ($scripts[1] as $id => $script)
    612613        {
    613614          $content[]=
    614             's=document.createElement(\'script\'); s.type = \'text/javascript\'; s.async = true; s.src = \''
     615            's=document.createElement(\'script\'); s.type=\'text/javascript\'; s.async=true; s.src=\''
    615616            . self::make_script_src($script)
    616617            .'\';';
     
    662663  function func_get_combined_css($params, &$smarty)
    663664  {
    664     return self::COMBINED_CSS_TAG;
     665    return 'echo '.var_export(self::COMBINED_CSS_TAG,true);
    665666  }
    666667
     
    736737
    737738    $regex = array();
    738     $tags = array('if', 'foreach', 'section');
     739    $tags = array('if','foreach','section','footer_script');
    739740    foreach($tags as $tag)
    740741    {
     
    742743      array_push($regex, "#^[ \t]+($ldq/$tag$rdq)\s*$#m");
    743744    }
    744     $tags = array('include', 'else', 'html_head');
     745    $tags = array('include','else','combine_script','html_head');
    745746    foreach($tags as $tag)
    746747    {
     
    11921193    }
    11931194
    1194     $output = '';
    1195     $output .= "/* ".count($this->files)."\n".join("\n", $this->files)."*/\n";
     1195    $output = "/* ".join("\n", $this->files)."*/\n";
    11961196    foreach ($this->files as $input_file)
    11971197    {
     
    12271227    require_once(PHPWG_ROOT_PATH.'include/cssmin.class.php');
    12281228    $css = CssMin::minify($css, array('emulate-css3-variables'=>false));
     1229                $css = trigger_event('combined_css_postfilter', $css);
    12291230    return $css;
    12301231  }
     
    12431244          $relative = dirname($file) . "/$match[1]";
    12441245          $search[] = $match[0];
    1245           $replace[] = "url('" . get_absolute_root_url(false) . $relative . "')";
     1246          $replace[] = 'url('.embellish_url(get_absolute_root_url(false)).$relative.')';
    12461247        }
    12471248      }
Note: See TracChangeset for help on using the changeset viewer.