// Helper::renderAdminCategorieTree refactoring

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@12578 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
tDidierjean
2012-01-20 13:02:34 +00:00
parent 6c09d18d61
commit f6e48114e7
5 changed files with 15 additions and 71 deletions
+5 -19
View File
@@ -176,15 +176,9 @@ class AdminShopControllerCore extends AdminController
{
$root_category = new Category((int)Tools::getValue('id_category'));
$root_category = array('id_category' => $root_category->id_category, 'name' => $root_category->name[$this->context->language->id]);
$trads = array(
'Root' => $root_category,
'selected' => $this->l('selected'),
'Collapse All' => $this->l('Collapse All'),
'Check All' => $this->l('Check All'),
'Uncheck All' => $this->l('Uncheck All'),
'Expand All' => $this->l('Expand All')
);
echo Helper::renderAdminCategorieTree($trads, array($root_category['id_category']));
$helper = new Helper();
echo $helper->renderCategoryTree($root_category, array($root_category['id_category']));
}
}
@@ -507,16 +501,8 @@ class AdminShopControllerCore extends AdminController
else
$root_category = new Category($id_root);
$root_category = array('id_category' => $root_category->id_category, 'name' => $root_category->name[$this->context->language->id]);
$translations = array(
'Root' => $root_category,
'selected' => $this->l('selected'),
'Collapse All' => $this->l('Collapse All'),
'Expand All' => $this->l('Expand All'),
'Check All' => $this->l('Check All'),
'Uncheck All' => $this->l('Uncheck All'),
'search' => $this->l('Search a category')
);
return Helper::renderAdminCategorieTree($translations, $selected_cat, 'categoryBox', false, true);
$helper = new Helper();
return $helper->renderCategoryTree($root_category, $selected_cat, 'categoryBox', false, true);
}
}