{/if}
diff --git a/admin-dev/themes/default/template/controllers/products/helpers/tree/tree_categories.tpl b/admin-dev/themes/default/template/controllers/products/helpers/tree/tree_categories.tpl
new file mode 100644
index 000000000..78f662c03
--- /dev/null
+++ b/admin-dev/themes/default/template/controllers/products/helpers/tree/tree_categories.tpl
@@ -0,0 +1,118 @@
+{*
+* 2007-2013 PrestaShop
+*
+* NOTICE OF LICENSE
+*
+* This source file is subject to the Academic Free License (AFL 3.0)
+* that is bundled with this package in the file LICENSE.txt.
+* It is also available through the world-wide-web at this URL:
+* http://opensource.org/licenses/afl-3.0.php
+* If you did not receive a copy of the license and are unable to
+* obtain it through the world-wide-web, please send an email
+* to license@prestashop.com so we can send you a copy immediately.
+*
+* DISCLAIMER
+*
+* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
+* versions in the future. If you wish to customize PrestaShop for your
+* needs please refer to http://www.prestashop.com for more information.
+*
+* @author PrestaShop SA
+* @copyright 2007-2013 PrestaShop SA
+* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
+* International Registered Trademark & Property of PrestaShop SA
+*}
+
+ {if isset($header)}{$header}{/if}
+
+ {if isset($nodes)}
+
+ {$nodes}
+
+ {/if}
+
+
+
\ No newline at end of file
diff --git a/admin-dev/themes/default/template/controllers/products/helpers/tree/tree_header.tpl b/admin-dev/themes/default/template/controllers/products/helpers/tree/tree_header.tpl
new file mode 100644
index 000000000..0271ca921
--- /dev/null
+++ b/admin-dev/themes/default/template/controllers/products/helpers/tree/tree_header.tpl
@@ -0,0 +1,42 @@
+{*
+* 2007-2013 PrestaShop
+*
+* NOTICE OF LICENSE
+*
+* This source file is subject to the Academic Free License (AFL 3.0)
+* that is bundled with this package in the file LICENSE.txt.
+* It is also available through the world-wide-web at this URL:
+* http://opensource.org/licenses/afl-3.0.php
+* If you did not receive a copy of the license and are unable to
+* obtain it through the world-wide-web, please send an email
+* to license@prestashop.com so we can send you a copy immediately.
+*
+* DISCLAIMER
+*
+* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
+* versions in the future. If you wish to customize PrestaShop for your
+* needs please refer to http://www.prestashop.com for more information.
+*
+* @author PrestaShop SA
+* @copyright 2007-2013 PrestaShop SA
+* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
+* International Registered Trademark & Property of PrestaShop SA
+*}
+
+
+ {l s=$title}
+
{if isset($toolbar)}{$toolbar}{/if}
+
\ No newline at end of file
diff --git a/admin-dev/themes/default/template/controllers/products/helpers/tree/tree_toolbar.tpl b/admin-dev/themes/default/template/controllers/products/helpers/tree/tree_toolbar.tpl
new file mode 100644
index 000000000..befb4815d
--- /dev/null
+++ b/admin-dev/themes/default/template/controllers/products/helpers/tree/tree_toolbar.tpl
@@ -0,0 +1,25 @@
+{*
+* 2007-2013 PrestaShop
+*
+* NOTICE OF LICENSE
+*
+* This source file is subject to the Academic Free License (AFL 3.0)
+* that is bundled with this package in the file LICENSE.txt.
+* It is also available through the world-wide-web at this URL:
+* http://opensource.org/licenses/afl-3.0.php
+* If you did not receive a copy of the license and are unable to
+* obtain it through the world-wide-web, please send an email
+* to license@prestashop.com so we can send you a copy immediately.
+*
+* DISCLAIMER
+*
+* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
+* versions in the future. If you wish to customize PrestaShop for your
+* needs please refer to http://www.prestashop.com for more information.
+*
+* @author PrestaShop SA
+* @copyright 2007-2013 PrestaShop SA
+* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
+* International Registered Trademark & Property of PrestaShop SA
+*}
+{if isset($actions)}{foreach from=$actions item=action}{$action->render()}{/foreach}{/if}
\ No newline at end of file
diff --git a/classes/tree/Tree.php b/classes/tree/Tree.php
index a4bc77f45..95b82f13c 100644
--- a/classes/tree/Tree.php
+++ b/classes/tree/Tree.php
@@ -329,7 +329,8 @@ class TreeCore
$this->getTemplateFile($this->getHeaderTemplate()),
$this->getContext()->smarty
);
- $headerTemplate->assign(array(
+ $headerTemplate->assign($this->getAttributes())
+ ->assign(array(
'title' => $this->getTitle(),
'toolbar' => $this->useToolbar() ? $this->renderToolbar() : null
));
@@ -337,9 +338,8 @@ class TreeCore
}
//Assign Tree nodes
- $template
- ->assign($this->getAttributes())
- ->assign(array(
+ $template->assign($this->getAttributes())
+ ->assign(array(
'id' => $this->getId(),
'nodes' => $this->renderNodes($data)
));
diff --git a/controllers/admin/AdminProductsController.php b/controllers/admin/AdminProductsController.php
index ac6586488..2573a396e 100644
--- a/controllers/admin/AdminProductsController.php
+++ b/controllers/admin/AdminProductsController.php
@@ -2273,7 +2273,9 @@ class AdminProductsControllerCore extends AdminController
// Generate category selection tree
$tree = new HelperTreeCategories('categories-tree', 'Filter by category');
- $tree->setSelectedCategories(array((int)$id_category));
+ $tree->setAttribute('is_category_filter', (bool)$this->id_current_category)
+ ->setAttribute('base_url', preg_replace('#&id_category=[0-9]*#', '', self::$currentIndex).'&token='.$this->token)
+ ->setSelectedCategories(array((int)$id_category));
$this->tpl_list_vars['category_tree'] = $tree->render();
// used to build the new url when changing category