From 2bf17241bdaaa87917bf7b870e14e4906951d9b0 Mon Sep 17 00:00:00 2001 From: Jerome Nadaud Date: Fri, 13 Sep 2013 11:50:27 +0200 Subject: [PATCH] // Fix associated categories tree header --- .../products/helpers/list/list_header.tpl | 24 ---- .../tree/tree_associated_categories.tpl | 116 ++++++++++++++++++ .../helpers/tree/tree_associated_header.tpl | 28 +++++ controllers/admin/AdminProductsController.php | 4 +- 4 files changed, 147 insertions(+), 25 deletions(-) create mode 100644 admin-dev/themes/default/template/controllers/products/helpers/tree/tree_associated_categories.tpl create mode 100644 admin-dev/themes/default/template/controllers/products/helpers/tree/tree_associated_header.tpl diff --git a/admin-dev/themes/default/template/controllers/products/helpers/list/list_header.tpl b/admin-dev/themes/default/template/controllers/products/helpers/list/list_header.tpl index 0d317eabc..27cb7b66b 100644 --- a/admin-dev/themes/default/template/controllers/products/helpers/list/list_header.tpl +++ b/admin-dev/themes/default/template/controllers/products/helpers/list/list_header.tpl @@ -27,30 +27,6 @@ {block name=leadin} {if isset($category_tree)} -
{$category_tree} diff --git a/admin-dev/themes/default/template/controllers/products/helpers/tree/tree_associated_categories.tpl b/admin-dev/themes/default/template/controllers/products/helpers/tree/tree_associated_categories.tpl new file mode 100644 index 000000000..0239a9894 --- /dev/null +++ b/admin-dev/themes/default/template/controllers/products/helpers/tree/tree_associated_categories.tpl @@ -0,0 +1,116 @@ +{* +* 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_associated_header.tpl b/admin-dev/themes/default/template/controllers/products/helpers/tree/tree_associated_header.tpl new file mode 100644 index 000000000..416c07b1e --- /dev/null +++ b/admin-dev/themes/default/template/controllers/products/helpers/tree/tree_associated_header.tpl @@ -0,0 +1,28 @@ +{* +* 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/controllers/admin/AdminProductsController.php b/controllers/admin/AdminProductsController.php index 2573a396e..2b3014a80 100644 --- a/controllers/admin/AdminProductsController.php +++ b/controllers/admin/AdminProductsController.php @@ -2892,7 +2892,9 @@ class AdminProductsControllerCore extends AdminController $categories[] = $key; $tree = new HelperTreeCategories('associated-categories-tree', 'Associated categories'); - $tree->setRootCategory($root->id) + $tree->setTemplate('tree_associated_categories.tpl') + ->setHeaderTemplate('tree_associated_header.tpl') + ->setRootCategory($root->id) ->setUseCheckBox(true) ->setUseSearch(true) ->setSelectedCategories($categories);