Do not use MIBEW_WEB_ROOT in Style classes

This commit is contained in:
Dmitriy Simushev 2014-09-05 10:59:48 +00:00
parent dfbbc11cfb
commit ff917b25ad
3 changed files with 3 additions and 5 deletions

View File

@ -50,14 +50,13 @@ class ChatStyle extends AbstractHandlebarsPoweredStyle implements StyleInterface
public function render($template_name, $data = array())
{
// Pass additional variables to template
$data['mibewRoot'] = MIBEW_WEB_ROOT;
$data['mibewVersion'] = MIBEW_VERSION;
$data['currentLocale'] = get_current_locale();
$locale_info = get_locale_info(get_current_locale());
$data['rtl'] = $locale_info && $locale_info['rtl'];
$data['stylePath'] = MIBEW_WEB_ROOT . '/' . $this->getFilesPath();
$data['stylePath'] = $this->getFilesPath();
$data['styleName'] = $this->getName();
return $this->getHandlebars()->render($template_name, $data);

View File

@ -50,14 +50,13 @@ class PageStyle extends AbstractHandlebarsPoweredStyle implements StyleInterface
public function render($template_name, $data = array())
{
// Pass additional variables to template
$data['mibewRoot'] = MIBEW_WEB_ROOT;
$data['mibewVersion'] = MIBEW_VERSION;
$data['currentLocale'] = get_current_locale();
$locale_info = get_locale_info(get_current_locale());
$data['rtl'] = $locale_info && $locale_info['rtl'];
$data['stylePath'] = MIBEW_WEB_ROOT . '/' . $this->getFilesPath();
$data['stylePath'] = $this->getFilesPath();
$data['styleName'] = $this->getName();
return $this->getHandlebars()->render($template_name, $data);

View File

@ -84,7 +84,7 @@
style: '{{styleName}}',
mibewBasePath: '{{mibewBasePath}}',
mibewBaseUrl: '{{mibewBaseUrl}}',
stylePath: '{{stylePath}}',
stylePath: '{{mibewBasePath}}/{{stylePath}}',
company: {
name: '{{#jsString}}{{company.name}}{{/jsString}}',
chatLogoURL: '{{company.chatLogoURL}}'