// Add level depth restriction on blockcategories

This commit is contained in:
Jerome Nadaud
2013-10-22 19:13:10 +02:00
parent dfa59fa8f7
commit 2c94e6c042
+6 -1
View File
@@ -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',