diff --git a/library/Icinga/Web/LessCompiler.php b/library/Icinga/Web/LessCompiler.php index 791fdbab0..a5349f1a4 100644 --- a/library/Icinga/Web/LessCompiler.php +++ b/library/Icinga/Web/LessCompiler.php @@ -38,15 +38,17 @@ class LessCompiler /** * Create a new instance + * + * @param string $basePath Provide web base path optional */ - public function __construct() + public function __construct($basePath = null) { require_once 'lessphp/lessc.inc.php'; $this->lessc = new lessc(); $this->lessc->setVariables( array( - 'baseurl' => '\'' . Zend_Controller_Front::getInstance()->getBaseUrl(). '\'' + 'baseurl' => '\'' . $basePath. '\'' ) ); } diff --git a/library/Icinga/Web/StyleSheet.php b/library/Icinga/Web/StyleSheet.php index 719d1c829..52bc4b27b 100644 --- a/library/Icinga/Web/StyleSheet.php +++ b/library/Icinga/Web/StyleSheet.php @@ -11,7 +11,7 @@ use Icinga\Web\LessCompiler; class StyleSheet { protected static $lessFiles = array( - '../application/fonts/fontello-ifont/css/ifont-embedded.css', + 'fonts/fontello-ifont/css/ifont-embedded.less', 'css/vendor/tipsy.css', 'css/icinga/defaults.less', 'css/icinga/layout-colors.less', @@ -96,7 +96,8 @@ class StyleSheet $cache->send($cacheFile); return; } - $less = new LessCompiler(); + + $less = new LessCompiler(dirname($_SERVER['PHP_SELF'])); foreach ($lessFiles as $file) { $less->addFile($file); } diff --git a/application/fonts/fontello-ifont/LICENSE.txt b/public/fonts/fontello-ifont/LICENSE.txt similarity index 100% rename from application/fonts/fontello-ifont/LICENSE.txt rename to public/fonts/fontello-ifont/LICENSE.txt diff --git a/application/fonts/fontello-ifont/README.txt b/public/fonts/fontello-ifont/README.txt similarity index 100% rename from application/fonts/fontello-ifont/README.txt rename to public/fonts/fontello-ifont/README.txt diff --git a/application/fonts/fontello-ifont/config.json b/public/fonts/fontello-ifont/config.json similarity index 100% rename from application/fonts/fontello-ifont/config.json rename to public/fonts/fontello-ifont/config.json diff --git a/application/fonts/fontello-ifont/css/animation.css b/public/fonts/fontello-ifont/css/animation.css similarity index 100% rename from application/fonts/fontello-ifont/css/animation.css rename to public/fonts/fontello-ifont/css/animation.css diff --git a/application/fonts/fontello-ifont/css/ifont-codes.css b/public/fonts/fontello-ifont/css/ifont-codes.css similarity index 100% rename from application/fonts/fontello-ifont/css/ifont-codes.css rename to public/fonts/fontello-ifont/css/ifont-codes.css diff --git a/application/fonts/fontello-ifont/css/ifont-embedded.css b/public/fonts/fontello-ifont/css/ifont-embedded.less similarity index 99% rename from application/fonts/fontello-ifont/css/ifont-embedded.css rename to public/fonts/fontello-ifont/css/ifont-embedded.less index 92bcfdff9..294c342e3 100644 --- a/application/fonts/fontello-ifont/css/ifont-embedded.css +++ b/public/fonts/fontello-ifont/css/ifont-embedded.less @@ -1,8 +1,8 @@ @font-face { font-family: 'ifont'; - src: url('../font/ifont.eot?75097146'); - src: url('../font/ifont.eot?75097146#iefix') format('embedded-opentype'), - url('../font/ifont.svg?75097146#ifont') format('svg'); + src: url('@{baseurl}/fonts/fontello-ifont/font/ifont.eot?75097146'); + src: url('@{baseurl}/fonts/fontello-ifont/font/ifont.eot?75097146#iefix') format('embedded-opentype'), + url('@{baseurl}/fonts/fontello-ifont/ifont.svg?75097146#ifont') format('svg'); font-weight: normal; font-style: normal; } diff --git a/application/fonts/fontello-ifont/css/ifont-ie7-codes.css b/public/fonts/fontello-ifont/css/ifont-ie7-codes.css similarity index 100% rename from application/fonts/fontello-ifont/css/ifont-ie7-codes.css rename to public/fonts/fontello-ifont/css/ifont-ie7-codes.css diff --git a/application/fonts/fontello-ifont/css/ifont-ie7.css b/public/fonts/fontello-ifont/css/ifont-ie7.css similarity index 100% rename from application/fonts/fontello-ifont/css/ifont-ie7.css rename to public/fonts/fontello-ifont/css/ifont-ie7.css diff --git a/application/fonts/fontello-ifont/css/ifont.css b/public/fonts/fontello-ifont/css/ifont.css similarity index 100% rename from application/fonts/fontello-ifont/css/ifont.css rename to public/fonts/fontello-ifont/css/ifont.css diff --git a/application/fonts/fontello-ifont/demo.html b/public/fonts/fontello-ifont/demo.html similarity index 100% rename from application/fonts/fontello-ifont/demo.html rename to public/fonts/fontello-ifont/demo.html diff --git a/application/fonts/fontello-ifont/font/ifont.eot b/public/fonts/fontello-ifont/font/ifont.eot similarity index 100% rename from application/fonts/fontello-ifont/font/ifont.eot rename to public/fonts/fontello-ifont/font/ifont.eot diff --git a/application/fonts/fontello-ifont/font/ifont.svg b/public/fonts/fontello-ifont/font/ifont.svg similarity index 100% rename from application/fonts/fontello-ifont/font/ifont.svg rename to public/fonts/fontello-ifont/font/ifont.svg diff --git a/application/fonts/fontello-ifont/font/ifont.ttf b/public/fonts/fontello-ifont/font/ifont.ttf similarity index 100% rename from application/fonts/fontello-ifont/font/ifont.ttf rename to public/fonts/fontello-ifont/font/ifont.ttf diff --git a/application/fonts/fontello-ifont/font/ifont.woff b/public/fonts/fontello-ifont/font/ifont.woff similarity index 100% rename from application/fonts/fontello-ifont/font/ifont.woff rename to public/fonts/fontello-ifont/font/ifont.woff diff --git a/public/fonts/fontello-ifont/icingaweb.md b/public/fonts/fontello-ifont/icingaweb.md new file mode 100644 index 000000000..fa0a52c7d --- /dev/null +++ b/public/fonts/fontello-ifont/icingaweb.md @@ -0,0 +1,6 @@ +# fontello-ifont has been moved + +The font directory has been moved to the public structure because of Internet Explorer version 8 compatibility. The +common way for browsers is to include the binary embeded font type in the javascript. IE8 falls back and include one of +the provided font sources. Therefore it is important to have the font files available public and exported by the +HTTP server. \ No newline at end of file