JavaScript: Load all available module javascript files

refs #9702
This commit is contained in:
Johannes Meyer 2015-08-06 15:15:02 +02:00
parent 9cea83242c
commit c7cc9e66df
1 changed files with 6 additions and 13 deletions

View File

@ -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) {