+ getDefaultCss() and getSysURL().

This commit is contained in:
wangchunsheng
2009-12-02 06:56:58 +00:00
parent 1a2c00d3fb
commit c8ea6072fe

View File

@@ -206,4 +206,24 @@ EOT;
ksort($diff);
return implode("\n", $diff);
}
/* <20><><EFBFBD><EFBFBD>ϵͳURL<52><4C>ַ<EFBFBD><D6B7>*/
public function getSysURL()
{
global $config;
$httpType = isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == 'on' ? 'https' : 'http';
$httpHost = $_SERVER['HTTP_HOST'];
return "$httpType://$httpHost";
}
/* <20><><EFBFBD><EFBFBD>ϵͳĬ<CDB3>ϵ<EFBFBD><CFB5><EFBFBD>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD>*/
public function getDefaultCss()
{
global $app;
$pathFix = $app->getPathFix();
$cssFile = $app->getAppRoot() . "www{$pathFix}theme{$pathFix}default{$pathFix}style.css";
$cssContent = preg_replace('!/\*[^*]*\*+([^/][^*]*\*+)*/!','', file_get_contents($cssFile));
$cssContent = str_replace(array(" {", "} ", ' ', "\r\n", "\r", "\n", "\t"), array("{", '}', ' ', ''), $cssContent);
return $cssContent;
}
}