public function renderCss()
{
$cacheId = 'xfCssCache_' . sha1(
'style=' . $this->_styleId .
'css=' . serialize($this->_cssRequested) .
'd=' . $this->_inputModifiedDate .
'dir=' . $this->_textDirection .
'minify=' . XenForo_Application::get('options')->minifyCss)
. (XenForo_Application::debugMode() ? 'debug' : '');
if ($cacheObject = XenForo_Application::getCache())
{
if ($cacheCss = $cacheObject->load($cacheId, true))
{
return $cacheCss . "\n/* CSS returned from cache. */";
}
}
$this->_prepareForOutput();
if (XenForo_Application::isRegistered('bbCode'))
{
$bbCodeCache = XenForo_Application::get('bbCode');
}
else
{
$bbCodeCache = XenForo_Model::create('XenForo_Model_BbCode')->getBbCodeCache();
}
$params = array(
'displayStyles' => $this->_displayStyles,
'smilieSprites' => $this->_smilieSprites,
'customBbCodes' => !empty($bbCodeCache['bbCodes']) ? $bbCodeCache['bbCodes'] : array(),
'xenOptions' => XenForo_Application::get('options')->getOptions(),
'dir' => $this->_textDirection,
'pageIsRtl' => ($this->_textDirection == 'RTL')
);
var_dump($params);die;
$templates = array();
foreach ($this->_cssRequested AS $cssName)
{
$cssName = trim($cssName);
if (!$cssName)
{
continue;
}
$templateName = $cssName . '.css';
if (!isset($templates[$templateName]))
{
$templates[$templateName] = new XenForo_Template_Public($templateName, $params);
}
}
$css = self::renderCssFromObjects($templates, XenForo_Application::debugMode());
$css = self::prepareCssForOutput(
$css,
$this->_textDirection,
(XenForo_Application::get('options')->minifyCss && $cacheObject)
);
if ($cacheObject)
{
$cacheObject->save($css, $cacheId, array(), 86400);
}
return $css;
}