StyleSheet: Load all available module stylesheets

refs #9702
This commit is contained in:
Johannes Meyer 2015-08-06 15:14:29 +02:00
parent 712d545f48
commit 9cea83242c
2 changed files with 16 additions and 5 deletions

View File

@ -93,14 +93,21 @@ class LessCompiler
public function addModule($name, $module)
{
if ($module->hasCss()) {
$this->source .= "\n/* CSS: modules/$name/module.less */\n"
$contents = array();
foreach ($module->getCssFiles() as $path) {
if (file_exists($path)) {
$contents[] = "/* CSS: modules/$name/$path */\n" . file_get_contents($path);
}
}
$this->source .= ''
. '.icinga-module.module-'
. $name
. " {\n"
. file_get_contents($module->getCssFilename())
. "}\n\n"
;
. join("\n\n", $contents)
. "}\n\n";
}
return $this;
}

View File

@ -76,7 +76,11 @@ class StyleSheet
$files = $lessFiles;
foreach ($app->getModuleManager()->getLoadedModules() as $name => $module) {
if ($module->hasCss()) {
$files[] = $module->getCssFilename();
foreach ($module->getCssFiles() as $path) {
if (file_exists($path)) {
$files[] = $path;
}
}
}
}