From 2866d92d2b05764df1c324dba7ab490c9c991956 Mon Sep 17 00:00:00 2001 From: vChabot Date: Thu, 26 Apr 2012 14:16:47 +0000 Subject: [PATCH] [-] MO : BugFix #PSCFV-2114 blocktopmenu : filter the categories that the user is allowed to see and browse git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@14913 b9a71923-0436-4b27-9f14-aed3839534dd --- modules/blocktopmenu/blocktopmenu.php | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/modules/blocktopmenu/blocktopmenu.php b/modules/blocktopmenu/blocktopmenu.php index f505bb677..dbb3ca1fa 100644 --- a/modules/blocktopmenu/blocktopmenu.php +++ b/modules/blocktopmenu/blocktopmenu.php @@ -554,19 +554,25 @@ class Blocktopmenu extends Module $children = Category::getChildren((int)$id_category, (int)$id_lang, true, (int)$id_shop); $selected = ($this->page_name == 'category' && ((int)Tools::getValue('id_category') == $id_category)) ? ' class="sfHoverForce"' : ''; - $this->_menu .= '
  • '; - $this->_menu .= ''.$category->name.''; - - if (count($children)) + $user_groups = Context::getContext()->customer->isLogged() ? Context::getContext()->customer->getGroups() : array(Configuration::get('PS_UNIDENTIFIED_GROUP')); + $is_intersected = array_intersect($category->getGroups(), $user_groups); + // filter the categories that the user is allowed to see and browse + if (!empty($is_intersected)) { - $this->_menu .= ''; + } + $this->_menu .= '
  • '; } - $this->_menu .= ''; } private function getCMSMenuItems($parent, $depth = 1, $id_lang = false)