From c7cc9e66df0a9dbb38cfc7c64061a8ad927f58a7 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Thu, 6 Aug 2015 15:15:02 +0200 Subject: [PATCH] JavaScript: Load all available module javascript files refs #9702 --- library/Icinga/Web/JavaScript.php | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/library/Icinga/Web/JavaScript.php b/library/Icinga/Web/JavaScript.php index ed39c1b39..8cce31bb0 100644 --- a/library/Icinga/Web/JavaScript.php +++ b/library/Icinga/Web/JavaScript.php @@ -42,17 +42,6 @@ class JavaScript 'js/vendor/jquery.tipsy' ); - public static function listModuleFiles() - { - $list = array(); - foreach (Icinga::app()->getModuleManager()->getLoadedModules() as $name => $module) { - if ($module->hasJs()) { - $list[] = 'js/' . $name . '/module.js'; - } - } - return $list; - } - public static function sendMinified() { return self::send(true); @@ -86,7 +75,11 @@ class JavaScript foreach (Icinga::app()->getModuleManager()->getLoadedModules() as $name => $module) { if ($module->hasJs()) { - $jsFiles[] = $module->getJsFilename(); + foreach ($module->getJsFiles() as $path) { + if (file_exists($path)) { + $jsFiles[] = $path; + } + } } } $files = array_merge($vendorFiles, $jsFiles); @@ -114,7 +107,7 @@ class JavaScript } foreach ($jsFiles as $file) { - $js .= file_get_contents($file); + $js .= file_get_contents($file) . "\n\n\n"; } if ($minified) {