From 988519a0f8a7ecb8e00c380f9abb4cf646dba319 Mon Sep 17 00:00:00 2001 From: Cameron Date: Wed, 25 Jan 2017 11:04:14 -0800 Subject: [PATCH] Added an id to local theme stylesheets. --- e107_handlers/application.php | 1 + e107_handlers/js_manager.php | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/e107_handlers/application.php b/e107_handlers/application.php index 595606996..c3f3ebb06 100644 --- a/e107_handlers/application.php +++ b/e107_handlers/application.php @@ -4319,6 +4319,7 @@ class eHelper public static function secureIdAttr($string) { + $string = str_replace(array('/','_'),'-',$string); return preg_replace(self::$_idRegEx, '', $string); } diff --git a/e107_handlers/js_manager.php b/e107_handlers/js_manager.php index d74e65c3a..1e31e7ba4 100644 --- a/e107_handlers/js_manager.php +++ b/e107_handlers/js_manager.php @@ -1356,13 +1356,25 @@ class e_jsmanager if('css' === $external) { $path = explode($this->_sep, $path, 4); + + + $media = $path[0]; // support of IE checks $pre = varset($path[2]) ? $path[2]."\n" : ''; $post = varset($path[3]) ? "\n".$path[3] : ''; $path = $path[1]; + + $insertID =''; + if(strpos($path, 'http') !== 0) // local file. { + + if($label === 'Theme CSS') // add an id for local theme stylesheets. + { + $insertID = 'id="stylesheet-'. eHelper::secureIdAttr(str_replace(array('{e_THEME}','.css'),'',$path)).'"' ; + } + if($this->addCache($external,$path) === true) // if cache enabled, then skip and continue. { continue; @@ -1374,7 +1386,8 @@ class e_jsmanager continue; } - echo $pre.''.$post; + + echo $pre.''.$post; echo "\n"; continue;