2014-03-04 16:15:08 +01:00
|
|
|
<?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',
|
2014-03-05 20:12:45 +01:00
|
|
|
'css/icinga/widgets.less',
|
2014-03-04 16:15:08 +01:00
|
|
|
'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();
|
|
|
|
}
|
|
|
|
|
2014-03-04 16:15:08 +01:00
|
|
|
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();
|
|
|
|
}
|
|
|
|
}
|