[-] MO : #PSCFV-2349 - Fix bugs with theme export

This commit is contained in:
mDeflotte
2012-05-18 09:08:29 +00:00
parent c7c7bc7a08
commit 7fb5770314
2 changed files with 21 additions and 21 deletions
+1 -2
View File
@@ -99,7 +99,6 @@ $('document').ready(function()
if (themes.length > 0) if (themes.length > 0)
{ {
var count = 0; var count = 0;
while (themes_id[count] != null && count < 10) addVariation(themes_id[theme_selected]);
addVariation(themes_id[count++]);
} }
}); });
@@ -1069,10 +1069,12 @@ class ThemeInstallator extends Module
*/ */
private function getHookState() private function getHookState()
{ {
if ($this->to_install !== false)
foreach ($this->to_install as $string) foreach ($this->to_install as $string)
foreach ($this->hook_list as $tmp) foreach ($this->hook_list as $tmp)
if ($tmp['name_module'] == $string) if ($tmp['name_module'] == $string)
$this->to_hook[] = $string.';'.$tmp['name_hook'].';'.$tmp['position'].';'.$tmp['exceptions']; $this->to_hook[] = $string.';'.$tmp['name_hook'].';'.$tmp['position'].';'.$tmp['exceptions'];
if ($this->to_enable !== false)
foreach ($this->to_enable as $string) foreach ($this->to_enable as $string)
foreach ($this->hook_list as $tmp) foreach ($this->hook_list as $tmp)
if ($tmp['name_module'] == $string) if ($tmp['name_module'] == $string)
@@ -1100,9 +1102,6 @@ class ThemeInstallator extends Module
private function getThemeVariations() private function getThemeVariations()
{ {
// @todo check theme variation pertinence // @todo check theme variation pertinence
$from = Tools::getValue('compa_from');
$to = Tools::getValue('compa_to');
$this->variations[] = Tools::getValue('theme_name').'¤'.Tools::getValue('mainTheme').'¤'.$from.'¤'.$to;
$count = 0; $count = 0;
while (Tools::isSubmit('myvar_'.++$count)) while (Tools::isSubmit('myvar_'.++$count))
{ {
@@ -1362,12 +1361,14 @@ class ThemeInstallator extends Module
var select_default = "'.$this->l('Choose a theme').'"; var select_default = "'.$this->l('Choose a theme').'";
var themes = Array(); var themes = Array();
var themes_id = Array(); var themes_id = Array();
var theme_selected = '.Tools::getValue('id_theme').';
'; ';
$id = 0; $id = 0;
foreach ($this->theme_list as $row) foreach ($this->theme_list as $row)
{ {
if (!is_dir(_PS_ALL_THEMES_DIR_.$row) || !file_exists(_PS_ALL_THEMES_DIR_.$row.'/index.tpl') || $row == 'prestashop' || $row == Tools::getValue('mainTheme')) if (!is_dir(_PS_ALL_THEMES_DIR_.$row) || !file_exists(_PS_ALL_THEMES_DIR_.$row.'/index.tpl') || $row == 'prestashop' || $row == Tools::getValue('mainTheme'))
continue ; continue ;
$this->_html .= 'themes['.$id.'] = "'.$row.'";'; $this->_html .= 'themes['.$id.'] = "'.$row.'";';
$this->_html .= 'themes_id['.$id.'] = '.$id.';'; $this->_html .= 'themes_id['.$id.'] = '.$id.';';
$id++; $id++;