From 6177589cd38cdb4978e1c24dff568dc45cf242b8 Mon Sep 17 00:00:00 2001 From: gr4devel Date: Mon, 2 Sep 2013 11:57:16 +0200 Subject: [PATCH] [+] MO : add link to all manufacturer page and the feature to show All Suppliers --- modules/blocktopmenu/blocktopmenu.php | 34 ++++++++++++++++++++------- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/modules/blocktopmenu/blocktopmenu.php b/modules/blocktopmenu/blocktopmenu.php index 39558ee6f..a5eb3b3c5 100644 --- a/modules/blocktopmenu/blocktopmenu.php +++ b/modules/blocktopmenu/blocktopmenu.php @@ -221,6 +221,8 @@ class Blocktopmenu extends Module // BEGIN SUPPLIER $this->_html .= ''; + // Option to show all Suppliers + $this->_html .= ''; $suppliers = Supplier::getSuppliers(false, $id_lang); foreach ($suppliers as $supplier) $this->_html .= ''; @@ -228,7 +230,7 @@ class Blocktopmenu extends Module // BEGIN Manufacturer $this->_html .= ''; - // Option to show all Manufacturer + // Option to show all Manufacturers $this->_html .= ''; $manufacturers = Manufacturer::getManufacturers(false, $id_lang); foreach ($manufacturers as $manufacturer) @@ -474,7 +476,7 @@ class Blocktopmenu extends Module $this->_html .= ''.PHP_EOL; break; - // Case to handle the option to show all Manufacturer + // Case to handle the option to show all Manufacturers case 'ALLMAN': $this->_html .= ''.PHP_EOL; break; @@ -485,6 +487,11 @@ class Blocktopmenu extends Module $this->_html .= ''.PHP_EOL; break; + // Case to handle the option to show all Suppliers + case 'ALLSUP': + $this->_html .= ''.PHP_EOL; + break; + case 'SUP': $supplier = new Supplier((int)$id, (int)$id_lang); if (Validate::isLoadedObject($supplier)) @@ -556,6 +563,16 @@ class Blocktopmenu extends Module } break; + // Case to handle the option to show all Manufacturers + case 'ALLMAN': + $link = new Link; + $this->_menu .= '
  • '.$this->l('All manufacturers').'
      '.PHP_EOL; + $manufacturers = Manufacturer::getManufacturers(); + foreach ($manufacturers as $key => $manufacturer) + $this->_menu .= '
    • '.$manufacturer['name'].'
    • '.PHP_EOL; + $this->_menu .= '
    '; + break; + case 'MAN': $selected = ($this->page_name == 'manufacturer' && (Tools::getValue('id_manufacturer') == $id)) ? ' class="sfHover"' : ''; $manufacturer = new Manufacturer((int)$id, (int)$id_lang); @@ -570,14 +587,13 @@ class Blocktopmenu extends Module } break; - // Case to handle the option to show all Manufacturer - case 'ALLMAN': - $this->_menu .= '
  • '.$this->l('All manufacturers').'
      '.PHP_EOL; - $manufacturers = Manufacturer::getManufacturers(); + // Case to handle the option to show all Suppliers + case 'ALLSUP': $link = new Link; - foreach ($manufacturers as $key => $manufacturer) { - $this->_menu .= '
    • '.$manufacturer['name'].'
    • '.PHP_EOL; - } + $this->_menu .= '
    • '.$this->l('All suppliers').'
        '.PHP_EOL; + $suppliers = Supplier::getSuppliers(); + foreach ($suppliers as $key => $supplier) + $this->_menu .= '
      • '.$supplier['name'].'
      • '.PHP_EOL; $this->_menu .= '
      '; break;