From 2c94e6c0425d1ebaa9d59ec0d17f4948227998de Mon Sep 17 00:00:00 2001 From: Jerome Nadaud Date: Tue, 22 Oct 2013 19:13:10 +0200 Subject: [PATCH] // Add level depth restriction on blockcategories --- modules/blockcategories/blockcategories.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/blockcategories/blockcategories.php b/modules/blockcategories/blockcategories.php index 4d592bd26..46503ddce 100644 --- a/modules/blockcategories/blockcategories.php +++ b/modules/blockcategories/blockcategories.php @@ -117,8 +117,13 @@ class BlockCategories extends Module public function hookDisplayBackOfficeCategory($params) { + $category = new Category((int)Tools::getValue('id_category')); + + if ($category->level_depth != 2) + return; + for ($i=0;$i<3;$i++) - $images[$i] = ImageManager::thumbnail(_PS_CAT_IMG_DIR_.Tools::getValue('id_category').'-'.$i.'_thumb.jpg', $this->context->controller->table.'_'.(int)Tools::getValue('id_category').'-'.$i.'_thumb.jpg', 100, 'jpg', true); + $images[$i] = ImageManager::thumbnail(_PS_CAT_IMG_DIR_.(int)$category->id.'-'.$i.'_thumb.jpg', $this->context->controller->table.'_'.(int)$category->id.'-'.$i.'_thumb.jpg', 100, 'jpg', true); $this->smarty->assign(array( 'name' => 'thumb',