R
ragtek
Guest
Isn't it possible to use the xen syntax and global variables from
in the css templates?
I've added this:
But non of the variables is shown
PHP:
public function preRenderView(XenForo_ControllerResponse_Abstract $controllerResponse = null)
{
if (XenForo_Application::isRegistered('session'))
{
/* @var $session XenForo_Session */
$session = XenForo_Application::get('session');
$this->_defaultTemplateParams['session'] = $session->getAll();
$this->_defaultTemplateParams['sessionId'] = $session->getSessionId();
}
$this->_defaultTemplateParams['requestPaths'] = XenForo_Application::get('requestPaths');
$options = XenForo_Application::get('options')->getOptions();
$options['cookieConfig'] = XenForo_Application::get('config')->cookie->toArray();
$options['currentVersion'] = XenForo_Application::$version;
$options['jsVersion'] = XenForo_Application::$jsVersion;
$visitor = XenForo_Visitor::getInstance();
$this->_defaultTemplateParams['visitor'] = $visitor->toArray();
$this->_defaultTemplateParams['visitorLanguage'] = $visitor->getLanguage();
$this->_defaultTemplateParams['pageIsRtl'] = (isset($this->_defaultTemplateParams['visitorLanguage']['text_direction']) && $this->_defaultTemplateParams['visitorLanguage']['text_direction'] == 'RTL');
$this->_defaultTemplateParams['xenOptions'] = $options;
$this->_defaultTemplateParams['xenCache'] = XenForo_Application::get('simpleCache');
$this->_defaultTemplateParams['serverTime'] = XenForo_Application::$time;
$this->_defaultTemplateParams['debugMode'] = XenForo_Application::debugMode();
$this->_defaultTemplateParams['javaScriptSource'] = XenForo_Application::$javaScriptUrl;
if ($controllerResponse)
{
$this->_defaultTemplateParams['controllerName'] = $controllerResponse->controllerName;
$this->_defaultTemplateParams['controllerAction'] = $controllerResponse->controllerAction;
$this->_defaultTemplateParams['viewName'] = $controllerResponse->viewName;
}
}
I've added this:
Code:
/ extra controllername: {$controllerName} - view: {$viewName}
<xen:if is="{$controllerName} == 'Ragtek_Debug_ControllerPublic'"}>....