From: Michael M Slusarz Date: Thu, 30 Jul 2009 18:28:50 +0000 (-0600) Subject: Output prototype.js script tag separately from other script files X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=aa4c9e3729e6e8b5ada23f16495c57606c2feb7d;p=horde.git Output prototype.js script tag separately from other script files --- diff --git a/framework/Core/lib/Horde.php b/framework/Core/lib/Horde.php index 148028b0b..e8327a8a4 100644 --- a/framework/Core/lib/Horde.php +++ b/framework/Core/lib/Horde.php @@ -299,6 +299,14 @@ HTML; $mtime = array(0); $s_list = $hsf->listFiles(); + if (empty($s_list)) { + return; + } + + /* Output prototype.js separately from the other files. */ + $js_force[] = $s_list['horde'][0]['u']; + unset($s_list['horde'][0]); + foreach ($s_list as $app => $files) { foreach ($files as $file) { if ($file['d'] && ($file['f'][0] != '/') && empty($file['e'])) { @@ -313,7 +321,6 @@ HTML; } sort($s_list); - $sig = hash('md5', serialize($s_list) . max($mtime)); switch ($cache_type) { @@ -336,7 +343,7 @@ HTML; if (!$exists) { $out = ''; foreach ($js_tocache as $key => $val) { - // Seperate JS files with a newline since some compressors may + // Separate JS files with a newline since some compressors may // strip trailing terminators. if ($val) { // Minify these files a bit by removing newlines and @@ -360,8 +367,8 @@ HTML; } } - foreach (array_merge($js_external, array($js_url), $js_force) as $val) { - echo '\n"; + foreach (array_merge($js_force, array($js_url), $js_external) as $val) { + $hsf->outputTag($val); } }