Added quick & dirty css.php, file list shall be moved elsewhere

This commit is contained in:
Thomas Gelf 2014-02-18 19:18:12 +00:00
parent 0942a94958
commit e81543d519
3 changed files with 35 additions and 1 deletions

3
configure vendored
View File

@ -2950,7 +2950,7 @@ fi
#
# Create config files
#
ac_config_files="$ac_config_files Makefile config/authentication.ini config/config.ini config/resources.ini config/modules/monitoring/backends.ini config/modules/monitoring/instances.ini etc/apache/icingaweb.conf public/.htaccess public/index.php"
ac_config_files="$ac_config_files Makefile config/authentication.ini config/config.ini config/resources.ini config/modules/monitoring/backends.ini config/modules/monitoring/instances.ini etc/apache/icingaweb.conf public/.htaccess public/index.php public/css.php"
#
@ -3671,6 +3671,7 @@ do
"etc/apache/icingaweb.conf") CONFIG_FILES="$CONFIG_FILES etc/apache/icingaweb.conf" ;;
"public/.htaccess") CONFIG_FILES="$CONFIG_FILES public/.htaccess" ;;
"public/index.php") CONFIG_FILES="$CONFIG_FILES public/index.php" ;;
"public/css.php") CONFIG_FILES="$CONFIG_FILES public/css.php" ;;
*) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
esac

View File

@ -442,6 +442,7 @@ AC_CONFIG_FILES([
etc/apache/icingaweb.conf
public/.htaccess
public/index.php
public/css.php
])
#

32
public/css.php.in Normal file
View File

@ -0,0 +1,32 @@
<?php
use Icinga\Application\EmbeddedWeb;
use Icinga\Web\LessCompiler;
require_once dirname(__FILE__). '/../library/Icinga/Application/ApplicationBootstrap.php';
require_once dirname(__FILE__). '/../library/Icinga/Application/EmbeddedWeb.php';
$app = EmbeddedWeb::start('@icingaweb_config_path@');
$less = new LessCompiler();
header('Content-Type: text/css');
// TODO: Cache header
$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/pagination.less',
'css/icinga/monitoring-colors.less',
'css/icinga/login.less',
);
$basedir = dirname(__FILE__);
foreach ($lessfiles as $file) {
$less->addFile($basedir . '/' . $file);
}
echo $less->addLoadedModules()->compile();