Browse Source

! It's not perfect since so much stuff doesn't use it but it's still better than we had before.

Signed-off-by: Peter Spicer <[email protected]>
Peter Spicer 10 years ago
parent
commit
155977bf66
1 changed files with 9 additions and 1 deletions
  1. 9 1
      Sources/Subs.php

+ 9 - 1
Sources/Subs.php

@@ -3314,7 +3314,7 @@ function template_javascript($do_defered = false)
  */
 function template_css()
 {
-	global $context;
+	global $context, $db_show_debug, $boardurl;
 
 	// Use this hook to minify/optimize CSS files
 	call_integration_hook('integrate_pre_css_output');
@@ -3323,6 +3323,14 @@ function template_css()
 		echo '
 	<link rel="stylesheet" type="text/css" href="', $file['filename'], '" />';
 
+	if ($db_show_debug === true)
+	{
+		// Try to keep only what's useful.
+		$repl = array($boardurl . '/Themes/' => '', $boardurl . '/' => '');
+		foreach ($context['css_files'] as $file)
+			$context['debug']['sheets'][] = strtr($file['filename'], $repl); 
+	}
+
 	if (!empty($context['css_header']))
 		echo '
 	<style>', $context['css_header'], '</style>';