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

This commit is contained in:
Damien Metzger committed 2013-07-22 10:49:41 +02:00
1 parent 3483706951
commit 3556e75ce3
2 files changed
+4 -5

No files matched your search

+1 -2
View File
@@ -1390,8 +1390,7 @@ class CategoryCore extends ObjectModel
SELECT DISTINCT c.* SELECT DISTINCT c.*
FROM `'._DB_PREFIX_.'category` 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.') 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() public function isRootCategoryForAShop()
+3 -3
View File
@@ -172,14 +172,14 @@ class HelperListCore extends Helper
} }
public function displayListContent() public function displayListContent()
{
if (isset($this->fields_list['position']))
{ {
if ($this->position_identifier) if ($this->position_identifier)
$id_category = (int)Tools::getValue('id_'.($this->is_cms ? 'cms_' : '').'category', ($this->is_cms ? '1' : Category::getRootCategory()->id )); $id_category = (int)Tools::getValue('id_'.($this->is_cms ? 'cms_' : '').'category', ($this->is_cms ? '1' : Category::getRootCategory()->id ));
else else
$id_category = Category::getRootCategory()->id; $id_category = Category::getRootCategory()->id;
if (isset($this->fields_list['position']))
{
$positions = array_map(create_function('$elem', 'return (int)($elem[\'position\']);'), $this->_list); $positions = array_map(create_function('$elem', 'return (int)($elem[\'position\']);'), $this->_list);
sort($positions); sort($positions);
} }
@@ -307,7 +307,7 @@ class HelperListCore extends Helper
'table' => $this->table, 'table' => $this->table,
'token' => $this->token, 'token' => $this->token,
'color_on_bg' => $this->colorOnBackground, 'color_on_bg' => $this->colorOnBackground,
'id_category' => $id_category, 'id_category' => isset($id_category) ? $id_category : false,
'bulk_actions' => $this->bulk_actions, 'bulk_actions' => $this->bulk_actions,
'positions' => isset($positions) ? $positions : null, 'positions' => isset($positions) ? $positions : null,
'order_by' => $this->orderBy, 'order_by' => $this->orderBy,