[ Index ] |
|
Code source de Serendipity 1.2 |
1 <?php # $Id: serendipity.css.php 1673 2007-04-12 09:22:44Z garvinhicking $ 2 # Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team) 3 # All rights reserved. See LICENSE file for licensing details 4 5 /* This is a small hack to allow CSS display during installations and upgrades */ 6 define('IN_installer', true); 7 define('IN_upgrader', true); 8 define('IN_CSS', true); 9 10 session_cache_limiter('public'); 11 if (!defined('S9Y_FRAMEWORK')) { 12 include ('serendipity_config.inc.php'); 13 } 14 15 if (!isset($css_mode)) { 16 if (!empty($serendipity['GET']['css_mode'])) { 17 $css_mode = $serendipity['GET']['css_mode']; 18 } else { 19 $css_mode = 'serendipity.css'; 20 } 21 } 22 23 switch($css_mode) { 24 case 'serendipity.css': 25 default: 26 $css_hook = 'css'; 27 $css_file = 'style.css'; 28 break; 29 30 case 'serendipity_admin.css': 31 $css_hook = 'css_backend'; 32 $css_file = 'admin/style.css'; 33 break; 34 } 35 36 function serendipity_printStylesheet($file, $dir = '') { 37 global $serendipity; 38 return "/* $dir */\n" . str_replace( 39 array( 40 '{TEMPLATE_PATH}', 41 '{LANG_DIRECTION}' 42 ), 43 44 array( 45 dirname($dir) . '/', 46 LANG_DIRECTION 47 ), 48 49 @file_get_contents($file, 1)); 50 } 51 52 53 if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false) { 54 header('Cache-Control: no-cache'); 55 } else { 56 header('Cache-Control:'); 57 header('Pragma:'); 58 header('Expires: ' . gmdate('D, d M Y H:i:s \G\M\T', time()+3600)); 59 } 60 header('Content-type: text/css; charset=' . LANG_CHARSET); 61 62 if (IS_installed === false) { 63 if (file_exists(S9Y_INCLUDE_PATH . 'templates/' . $serendipity['defaultTemplate'] . '/' . $css_file)) { 64 echo serendipity_printStylesheet('templates/' . $serendipity['defaultTemplate'] . '/' . $css_file, 'templates/' . $serendipity['defaultTemplate'] . '/' . $css_file); 65 } 66 die(); 67 } 68 69 70 $out = serendipity_printStylesheet( 71 serendipity_getTemplateFile($css_file, 'serendipityPath'), 72 serendipity_getTemplateFile($css_file, '') 73 ); 74 75 serendipity_plugin_api::hook_event($css_hook, $out); 76 77 echo $out; 78 79 /* vim: set sts=4 ts=4 expandtab : */
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sat Nov 24 09:00:37 2007 | par Balluche grâce à PHPXref 0.7 |
![]() |