Merge pull request #3 from zessx/patch-2

[*] MO : Blocktopmenu allow to remove every item in menu
This commit is contained in:
Gregory Roussac
2014-05-26 15:31:22 +02:00
+5 -1
View File
@@ -146,7 +146,11 @@ class Blocktopmenu extends Module
if (Tools::isSubmit('submitBlocktopmenu')) if (Tools::isSubmit('submitBlocktopmenu'))
{ {
$items = Tools::getValue('items'); $items = Tools::getValue('items');
if (is_array($items) && count($items) && Configuration::updateValue('MOD_BLOCKTOPMENU_ITEMS', (string)implode(',', $items))) if (is_array($items) && count($items))
$updated = Configuration::updateValue('MOD_BLOCKTOPMENU_ITEMS', (string)implode(',', $items));
else
$updated = Configuration::updateValue('MOD_BLOCKTOPMENU_ITEMS', '');
if ($updated)
$this->_html .= $this->displayConfirmation($this->l('The settings have been updated.')); $this->_html .= $this->displayConfirmation($this->l('The settings have been updated.'));
else else
$this->_html .= $this->displayError($this->l('Unable to update settings.')); $this->_html .= $this->displayError($this->l('Unable to update settings.'));