getParameter('module') && in_array($sf_request->getParameter('action'), array('suppliers', 'supplierDetails', 'supplierProducts'))) { $katao_supplier_url = $sf_request->getParameter('supplier'); $katao_supplier_ids = array(); $katao_product_category_active = true; foreach (KataoSupplierPeer::getAllVisibleByCategory() as $katao_product_category => $katao_suppliers) { $katao_product_category_suppliers = array(); foreach ($katao_suppliers as $katao_supplier) { if (KataoUser::STATUS_ACTIVE == $katao_supplier['status']) { $katao_product_category_suppliers[] = array('title' => $katao_supplier['name'], 'url' => url_for('@katao_fournisseurs_details?supplier=' . $katao_supplier['url']), 'active' => $katao_supplier_url == $katao_supplier['url']); $katao_supplier_ids[$katao_supplier['id']] = true; } } if (0 < $katao_product_category_suppliers) { $active = false; foreach ($katao_product_category_suppliers as $katao_supplier_data) { $active |= !empty($katao_supplier_data['active']); } $menu[] = array('title' => $katao_product_category, 'url' => false, 'active' => $katao_product_category_active && $active, 'suppliers' => $katao_product_category_suppliers); if ($katao_product_category_active && $active) { $katao_product_category_active = false; } } } foreach (KataoSupplierPeer::getAllVisible() as $katao_supplier) { if (KataoUser::STATUS_ACTIVE == $katao_supplier['status'] && empty($katao_supplier_ids[$katao_supplier['id']])) { $menu[] = array('title' => $katao_supplier['name'], 'url' => url_for('@katao_fournisseurs_details?supplier=' . $katao_supplier['url']), 'active' => $katao_supplier_url == $katao_supplier['url']); } } } elseif ('' != $katao_product_category_url = $sf_request->getParameter('category')) { $katao_product_family_url = $sf_request->getParameter('family'); foreach (KataoProductFamilyPeer::getAllByProductCategoryUrlIdentifier($katao_product_category_url) as $katao_product_family) { $menu[] = array('title' => $katao_product_family['name'], 'url' => url_for('@katao_boutique_famille?category=' . $katao_product_category_url . '&family=' . $katao_product_family['url']), 'active' => $katao_product_family_url == $katao_product_family['url']); } } else { $CurrentNode = $ContentTree->getCurrentNode(); if ($CurrentNode != $ContentTree->getRoot()) { while ($CurrentNode && $CurrentNode->parent && $CurrentNode->parent->parent) { $CurrentNode = $CurrentNode->parent; } if ($CurrentNode) { $secondMenuItems = $CurrentNode->getVisibleChildren(); } else { $secondMenuItems = array(); } } else { $topMenu = $CurrentNode->getVisibleChildren(); if (count($topMenu) > 0) { $secondMenuItems = $topMenu[0]->getVisibleChildren(); } else { $secondMenuItems = array(); } } if (count($secondMenuItems) > 0) { foreach ($secondMenuItems as/*(ContentTreeNode)*/ $secondMenuNode) { $menu[] = array('title' => $secondMenuNode->getMenuTitle(), 'url' => $secondMenuNode->getUrl(), 'active' => $secondMenuNode->isActive()); } } } ?>