// Fixed bootstrap mode for modules

This commit is contained in:
Damien Metzger committed 2013-11-05 17:29:51 +01:00
1 parent b68d8c5d4a
commit a31dbeb68e
3 files changed
+14 -7

No files matched your search

+11 -7
View File
@@ -1917,6 +1917,14 @@ class AdminControllerCore extends Controller
$this->helper = $helper; $this->helper = $helper;
} }
public function setDeprecatedMedia()
{
$admin_webpath = str_ireplace(_PS_ROOT_DIR_, '', _PS_ADMIN_DIR_);
$admin_webpath = preg_replace('/^'.preg_quote(DIRECTORY_SEPARATOR, '/').'/', '', $admin_webpath);
$this->addCSS(__PS_BASE_URI__.$admin_webpath.'/themes/'.$this->bo_theme.'/css/backward-admin-bootstrap-reset.css', 'all');
$this->addCSS(__PS_BASE_URI__.$admin_webpath.'/themes/'.$this->bo_theme.'/css/backward-admin-old.css', 'all');
}
public function setMedia() public function setMedia()
{ {
@@ -1927,14 +1935,10 @@ class AdminControllerCore extends Controller
$this->addCSS(__PS_BASE_URI__.$admin_webpath.'/themes/'.$this->bo_theme.'/css/admin-theme.css', 'all'); $this->addCSS(__PS_BASE_URI__.$admin_webpath.'/themes/'.$this->bo_theme.'/css/admin-theme.css', 'all');
// Deprecated stylesheets + reset bootstrap style for the #nobootstrap field - Backward compatibility // Deprecated stylesheets + reset bootstrap style for the #nobootstrap field - Backward compatibility
//if (!$this->bootstrap) if (!$this->bootstrap)
//{ $this->setDeprecatedMedia();
$this->addCSS(__PS_BASE_URI__.$admin_webpath.'/themes/'.$this->bo_theme.'/css/backward-admin-bootstrap-reset.css', 'all');
$this->addCSS(__PS_BASE_URI__.$admin_webpath.'/themes/'.$this->bo_theme.'/css/backward-admin-old.css', 'all');
//}
//todo csss for rtl support //todo css for rtl support
if ($this->context->language->is_rtl) if ($this->context->language->is_rtl)
$this->addCSS(_THEME_CSS_DIR_.'rtl.css'); $this->addCSS(_THEME_CSS_DIR_.'rtl.css');
@@ -694,6 +694,8 @@ class AdminModulesControllerCore extends AdminController
if ($key == 'configure' && Module::isInstalled($module->name)) if ($key == 'configure' && Module::isInstalled($module->name))
{ {
$this->bootstrap = (isset($module->bootstrap) && $module->bootstrap); $this->bootstrap = (isset($module->bootstrap) && $module->bootstrap);
if (!$this->bootstrap)
$this->setDeprecatedMedia();
if (isset($module->multishop_context)) if (isset($module->multishop_context))
$this->multishop_context = $module->multishop_context; $this->multishop_context = $module->multishop_context;
+1
View File
@@ -36,6 +36,7 @@ class Gapi extends Module
$this->version = 0.9; $this->version = 0.9;
$this->author = 'PrestaShop'; $this->author = 'PrestaShop';
$this->need_instance = 0; $this->need_instance = 0;
$this->bootstrap = true;
parent::__construct(); parent::__construct();