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()) public function render($template_name, $data = array())
{ {
// Pass additional variables to template // Pass additional variables to template
$data['mibewRoot'] = MIBEW_WEB_ROOT;
$data['mibewVersion'] = MIBEW_VERSION; $data['mibewVersion'] = MIBEW_VERSION;
$data['currentLocale'] = get_current_locale(); $data['currentLocale'] = get_current_locale();
$locale_info = get_locale_info(get_current_locale()); $locale_info = get_locale_info(get_current_locale());
$data['rtl'] = $locale_info && $locale_info['rtl']; $data['rtl'] = $locale_info && $locale_info['rtl'];
$data['stylePath'] = MIBEW_WEB_ROOT . '/' . $this->getFilesPath(); $data['stylePath'] = $this->getFilesPath();
$data['styleName'] = $this->getName(); $data['styleName'] = $this->getName();
return $this->getHandlebars()->render($template_name, $data); 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()) public function render($template_name, $data = array())
{ {
// Pass additional variables to template // Pass additional variables to template
$data['mibewRoot'] = MIBEW_WEB_ROOT;
$data['mibewVersion'] = MIBEW_VERSION; $data['mibewVersion'] = MIBEW_VERSION;
$data['currentLocale'] = get_current_locale(); $data['currentLocale'] = get_current_locale();
$locale_info = get_locale_info(get_current_locale()); $locale_info = get_locale_info(get_current_locale());
$data['rtl'] = $locale_info && $locale_info['rtl']; $data['rtl'] = $locale_info && $locale_info['rtl'];
$data['stylePath'] = MIBEW_WEB_ROOT . '/' . $this->getFilesPath(); $data['stylePath'] = $this->getFilesPath();
$data['styleName'] = $this->getName(); $data['styleName'] = $this->getName();
return $this->getHandlebars()->render($template_name, $data); return $this->getHandlebars()->render($template_name, $data);

View File

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