Dotclear

Changeset 1057:089f36cd2a8c


Ignore:
Timestamp:
12/09/12 11:24:58 (13 years ago)
Author:
JcDenis
Branch:
twig
Message:
  • Create a temporary function to add theme path in CSS
File:
1 edited

Legend:

Unmodified
Added
Removed
  • inc/load_theme_file.php

    r1056 r1057  
    9797http::$cache_max_age = 7200; 
    9898http::cache(array_merge(array($file),get_included_files())); 
     99header('Content-Type: '.files::getMimeType($file)); 
    99100 
    100 header('Content-Type: '.files::getMimeType($file)); 
    101 header('Content-Length: '.filesize($file)); 
    102 readfile($file); 
     101# Temporary hack css files to regain relative path 
     102if (files::getExtension($file) == 'css') { 
     103     $content = preg_replace( 
     104          '/url\((\'|)([^:].*?)(\'|)\)/msi', 
     105          'url($1?tf='.dirname($f).'/$2$3)', 
     106          file_get_contents($file) 
     107     ); 
     108     header('Content-Length: '.strlen($content)); 
     109     echo $content; 
     110} 
     111else { 
     112     header('Content-Length: '.filesize($file)); 
     113     readfile($file); 
     114} 
    103115exit; 
    104116?> 
Note: See TracChangeset for help on using the changeset viewer.

Sites map