Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into development

This commit is contained in:
gRoussac
2013-09-02 16:28:56 +02:00
2 changed files with 37 additions and 2 deletions
@@ -94,7 +94,8 @@ class AdminSuppliersControllerCore extends AdminController
'rows' => 10,
'lang' => true,
'hint' => $this->l('Invalid characters:').' <>;=#{}',
'desc' => $this->l('Will appear in the supplier list')
'desc' => $this->l('Will appear in the supplier list'),
'autoload_rte' => 'rte' //Enable TinyMCE editor for short description
),
array(
'type' => 'text',
+35 -1
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,6 +230,8 @@ class Blocktopmenu extends Module
// BEGIN Manufacturer
$this->_html .= '<optgroup label="'.$this->l('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)
$this->_html .= '<option value="MAN'.$manufacturer['id_manufacturer'].'">'.$spacer.$manufacturer['name'].'</option>';
@@ -472,12 +476,22 @@ 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 Manufacturers
case 'ALLMAN':
$this->_html .= '<option value="ALLMAN0">'.$this->l('All manufacturers').'</option>'.PHP_EOL;
break;
case 'MAN':
$manufacturer = new Manufacturer((int)$id, (int)$id_lang);
if (Validate::isLoadedObject($manufacturer))
$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))
@@ -549,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);
@@ -563,6 +587,16 @@ class Blocktopmenu extends Module
}
break;
// Case to handle the option to show all Suppliers
case 'ALLSUP':
$link = new Link;
$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;
case 'SUP':
$selected = ($this->page_name == 'supplier' && (Tools::getValue('id_supplier') == $id)) ? ' class="sfHover"' : '';
$supplier = new Supplier((int)$id, (int)$id_lang);
@@ -896,4 +930,4 @@ class Blocktopmenu extends Module
}
}
}