mirror of
https://github.com/e107inc/e107.git
synced 2025-08-03 13:17:24 +02:00
Raw html as inline code (often used by google/bing analytics) now supported by js manager.
eg. Inside a plugin's e_header.php : e107::js('footer-inline', '<script>...</script><iframe>...</iframe>');
This commit is contained in:
@@ -1237,6 +1237,28 @@ class e_jsmanager
|
|||||||
$content_array = array_unique($content_array); //TODO quick fix, we need better control!
|
$content_array = array_unique($content_array); //TODO quick fix, we need better control!
|
||||||
echo "\n";
|
echo "\n";
|
||||||
|
|
||||||
|
$raw = array();
|
||||||
|
|
||||||
|
if($type == 'js') // support for raw html as inline code. (eg. google/bing/yahoo analytics)
|
||||||
|
{
|
||||||
|
$script = array();
|
||||||
|
foreach($content_array as $code)
|
||||||
|
{
|
||||||
|
$start = substr($code,0,7);
|
||||||
|
if($start == '<script' || $start == '<iframe')
|
||||||
|
{
|
||||||
|
$raw[] = $code;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$script[] = $code;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$content_array = $script;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
switch ($type)
|
switch ($type)
|
||||||
{
|
{
|
||||||
case 'js':
|
case 'js':
|
||||||
@@ -1250,6 +1272,16 @@ class e_jsmanager
|
|||||||
echo "\n//]]>\n";
|
echo "\n//]]>\n";
|
||||||
echo '</script>';
|
echo '</script>';
|
||||||
echo "\n";
|
echo "\n";
|
||||||
|
|
||||||
|
if(!empty($raw))
|
||||||
|
{
|
||||||
|
if($label) //TODO - print comments only if site debug is on
|
||||||
|
{
|
||||||
|
echo "\n<!-- [JSManager] (Raw) ".$label." -->\n";
|
||||||
|
}
|
||||||
|
echo implode("\n\n", $raw);
|
||||||
|
echo "\n\n";
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'css':
|
case 'css':
|
||||||
|
Reference in New Issue
Block a user