[+] MO : add link to all manufacturer page and the feature to show All Suppliers

This commit is contained in:
gr4devel
2013-09-02 11:57:16 +02:00
parent 39c8a8fc2d
commit 6177589cd3

View File

@@ -221,6 +221,8 @@ class Blocktopmenu extends Module
// BEGIN SUPPLIER
$this->_html .= '<optgroup label="'.$this->l('Supplier').'">';
// Option to show all Suppliers
$this->_html .= '<option value="ALLSUP0">'.$this->l('All suppliers').'</option>';
$suppliers = Supplier::getSuppliers(false, $id_lang);
foreach ($suppliers as $supplier)
$this->_html .= '<option value="SUP'.$supplier['id_supplier'].'">'.$spacer.$supplier['name'].'</option>';
@@ -228,7 +230,7 @@ class Blocktopmenu extends Module
// BEGIN Manufacturer
$this->_html .= '<optgroup label="'.$this->l('Manufacturer').'">';
// Option to show all Manufacturer
// Option to show all Manufacturers
$this->_html .= '<option value="ALLMAN0">'.$this->l('All manufacturers').'</option>';
$manufacturers = Manufacturer::getManufacturers(false, $id_lang);
foreach ($manufacturers as $manufacturer)
@@ -474,7 +476,7 @@ class Blocktopmenu extends Module
$this->_html .= '<option value="CMS_CAT'.$id.'">'.$category->name.'</option>'.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 .= '<option value="ALLMAN0">'.$this->l('All manufacturers').'</option>'.PHP_EOL;
break;
@@ -485,6 +487,11 @@ class Blocktopmenu extends Module
$this->_html .= '<option value="MAN'.$id.'">'.$manufacturer->name.'</option>'.PHP_EOL;
break;
// Case to handle the option to show all Suppliers
case 'ALLSUP':
$this->_html .= '<option value="ALLSUP0">'.$this->l('All suppliers').'</option>'.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 .= '<li><a href="'.$link->getPageLink('manufacturer').'">'.$this->l('All manufacturers').'</a><ul>'.PHP_EOL;
$manufacturers = Manufacturer::getManufacturers();
foreach ($manufacturers as $key => $manufacturer)
$this->_menu .= '<li><a href="'.$link->getManufacturerLink((int)$manufacturer['id_manufacturer'], $manufacturer['link_rewrite']).'">'.$manufacturer['name'].'</a></li>'.PHP_EOL;
$this->_menu .= '</ul>';
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 .= '<li><a>'.$this->l('All manufacturers').'</a><ul>'.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 .= '<li><a href="'.$link->getManufacturerLink((int)$manufacturer['id_manufacturer'], $manufacturer['link_rewrite']).'">'.$manufacturer['name'].'</a></li>'.PHP_EOL;
}
$this->_menu .= '<li><a href="'.$link->getPageLink('supplier').'">'.$this->l('All suppliers').'</a><ul>'.PHP_EOL;
$suppliers = Supplier::getSuppliers();
foreach ($suppliers as $key => $supplier)
$this->_menu .= '<li><a href="'.$link->getSupplierLink((int)$supplier['id_supplier'], $supplier['link_rewrite']).'">'.$supplier['name'].'</a></li>'.PHP_EOL;
$this->_menu .= '</ul>';
break;