icingaweb2/library/Icinga/Web/StyleSheet.php

48 lines
1.3 KiB
PHP
Raw Normal View History

<?php
namespace Icinga\Web;
use Icinga\Application\Icinga;
use Icinga\Web\LessCompiler;
class StyleSheet
{
protected static $lessFiles = array(
'css/icinga/defaults.less',
'css/icinga/layout-colors.less',
'css/icinga/layout-structure.less',
'css/icinga/menu.less',
'css/icinga/header-elements.less',
'css/icinga/main-content.less',
'css/icinga/tabs.less',
'css/icinga/forms.less',
'css/icinga/widgets.less',
'css/icinga/pagination.less',
'css/icinga/monitoring-colors.less',
'css/icinga/login.less',
);
2014-03-06 10:21:32 +01:00
public static function compileForPdf()
{
$less = new LessCompiler();
$basedir = Icinga::app()->getBootstrapDirecory();
foreach (self::$lessFiles as $file) {
$less->addFile($basedir . '/' . $file);
}
$less->addLoadedModules();
$less->addFile($basedir . '/css/pdf/pdfprint.less');
return $less->compile();
}
public static function send()
{
header('Content-Type: text/css');
$less = new LessCompiler();
$basedir = Icinga::app()->getBootstrapDirecory();
foreach (self::$lessFiles as $file) {
$less->addFile($basedir . '/' . $file);
}
echo $less->addLoadedModules()->compile();
}
}