файл init.php
[CODE]
function GetMyCSS($bExternal = true)
{
global $APPLICATION;
$res = "";
$arCSS = $APPLICATION->sPath2css;
if(defined("SITE_TEMPLATE_ID") && file_exists($_SERVER["DOCUMENT_ROOT"].BX_PERSONAL_ROOT."/templates/".SITE_TEMPLATE_ID."/styles.css"))
{
$arCSS[] = BX_PERSONAL_ROOT."/templates/".SITE_TEMPLATE_ID."/styles.css";
$arCSS[] = BX_PERSONAL_ROOT."/templates/".SITE_TEMPLATE_ID."/template_styles.css";
}
else
{
$arCSS[] = BX_PERSONAL_ROOT."/templates/.default/styles.css";
$arCSS[] = BX_PERSONAL_ROOT."/templates/.default/template_styles.css";
}
$arCSS = array_unique($arCSS);
foreach($arCSS as $css_path)
{
$filename = $_SERVER["DOCUMENT_ROOT"].$css_path;
if(file_exists($filename))
{
if($bExternal && (strpos($css_path, "/bitrix/modules/")===false))
$res .= '<link href="'.$css_path.'" type="text/css" rel="stylesheet">';
else
{
if($handle = fopen($filename, "r"))
{
$contents = fread($handle, filesize($filename));
fclose($handle);
}
$res .= "<style type='text/css'>n".$contents."n</style>n";
}
}
}
return $res;
}
function ShowMyCSS($bExternal = true)
{
global $APPLICATION;
$APPLICATION->AddBufferContent(("GetMyCSS"), $bExternal);
}
[/CODE]
Ну и вызываем соответственно