public function addCss($sCssAbsPath)
{
if (\Flake\Util\Frameworks::enabled("LessPHP")) {
$sCompiledPath = PATH_buildcss;
$sFileName = basename($sCssAbsPath);
$sCompiledFilePath = $sCompiledPath . \Flake\Util\Tools::shortMD5($sFileName) . "_" . $sFileName;
if (substr(strtolower($sCompiledFilePath), -4) !== ".css") {
$sCompiledFilePath .= ".css";
}
if (!file_exists($sCompiledPath)) {
@mkdir($sCompiledPath);
if (!file_exists($sCompiledPath)) {
die("Page: Cannot create " . $sCompiledPath);
}
}
\Frameworks\LessPHP\Delegate::compileCss($sCssAbsPath, $sCompiledFilePath);
$sCssUrl = \Flake\Util\Tools::serverToRelativeWebPath($sCompiledFilePath);
} else {
$sCssUrl = \Flake\Util\Tools::serverToRelativeWebPath($sCssAbsPath);
}
$sHtml = "<link rel=\"stylesheet\" type=\"text/css\" href=\"" . $sCssUrl . "\" media=\"all\"/>";
$this->zone("head")->addBlock(new \Flake\Controller\HtmlBlock($sHtml));
}