1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-05 14:17:49 +02:00

Issue #2572 Inline CSS with Cached CSS Files.

This commit is contained in:
Cameron
2017-04-15 09:03:13 -07:00
parent 4f45805bc7
commit 45230488e3

View File

@@ -1493,6 +1493,11 @@ class e_jsmanager
else
{
echo "<link type='text/css' href='".e_WEB_ABS."cache/".$fileName."' rel='stylesheet' property='stylesheet' />\n\n";
if(!empty($this->_cache_list['css_inline']))
{
echo $this->_cache_list['css_inline'];
unset($this->_cache_list['css_inline']);
}
}
// Remove from list, anything we have added.
@@ -1629,7 +1634,7 @@ class e_jsmanager
/* remove tabs, spaces, newlines, etc. */
$minify = str_replace( array("\r\n", "\r", "\n", "\t", ' ', ' ', ' '), '', $minify );
$minify = str_replace("}","} ",$minify);
return $minify;
}
@@ -1716,14 +1721,26 @@ class e_jsmanager
break;
case 'css':
$text = '';
if($label && E107_DEBUG_LEVEL > 0)
{
echo "<!-- [CSSManager] ".$label." -->\n";
$text .= "<!-- [CSSManager] ".$label." -->\n";
}
echo '<style rel="stylesheet" type="text/css" property="stylesheet">';
echo implode("\n\n", $content_array);
echo '</style>';
echo "\n";
$text .= '<style rel="stylesheet" type="text/css" property="stylesheet">';
$text .= implode("\n\n", $content_array);
$text .= '</style>';
$text .= "\n";
if($this->_cache_enabled != true)
{
echo $text;
}
else
{
$this->_cache_list['css_inline'] = $text;
}
break;
}
}