// Moved useless code into the block where it is useful

This commit is contained in:
Damien Metzger
2013-07-22 10:49:41 +02:00
parent 3483706951
commit 3556e75ce3
2 changed files with 7 additions and 8 deletions
+1 -2
View File
@@ -1390,8 +1390,7 @@ class CategoryCore extends ObjectModel
SELECT DISTINCT c.*
FROM `'._DB_PREFIX_.'category` c
LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON (c.`id_category` = cl.`id_category` AND cl.`id_lang` = '.(int)Context::getContext()->language->id.')
WHERE `level_depth` = 1
');
WHERE `level_depth` = 1');
}
public function isRootCategoryForAShop()
+6 -6
View File
@@ -173,13 +173,13 @@ class HelperListCore extends Helper
public function displayListContent()
{
if ($this->position_identifier)
$id_category = (int)Tools::getValue('id_'.($this->is_cms ? 'cms_' : '').'category', ($this->is_cms ? '1' : Category::getRootCategory()->id ));
else
$id_category = Category::getRootCategory()->id;
if (isset($this->fields_list['position']))
{
if ($this->position_identifier)
$id_category = (int)Tools::getValue('id_'.($this->is_cms ? 'cms_' : '').'category', ($this->is_cms ? '1' : Category::getRootCategory()->id ));
else
$id_category = Category::getRootCategory()->id;
$positions = array_map(create_function('$elem', 'return (int)($elem[\'position\']);'), $this->_list);
sort($positions);
}
@@ -307,7 +307,7 @@ class HelperListCore extends Helper
'table' => $this->table,
'token' => $this->token,
'color_on_bg' => $this->colorOnBackground,
'id_category' => $id_category,
'id_category' => isset($id_category) ? $id_category : false,
'bulk_actions' => $this->bulk_actions,
'positions' => isset($positions) ? $positions : null,
'order_by' => $this->orderBy,