diff --git a/modules/blocktopmenu/blocktopmenu.php b/modules/blocktopmenu/blocktopmenu.php
index cc1a58f12..5205514f3 100644
--- a/modules/blocktopmenu/blocktopmenu.php
+++ b/modules/blocktopmenu/blocktopmenu.php
@@ -32,21 +32,21 @@ class Blocktopmenu extends Module
private $_menu = '';
private $_html = '';
- /*
- * Pattern for matching config values
- */
- private $pattern = '/^([A-Z_]*)[0-9]+/';
+ /*
+ * Pattern for matching config values
+ */
+ private $pattern = '/^([A-Z_]*)[0-9]+/';
- /*
- * Name of the controller
- * Used to set item selected or not in top menu
- */
- private $page_name = '';
+ /*
+ * Name of the controller
+ * Used to set item selected or not in top menu
+ */
+ private $page_name = '';
- /*
- * Spaces per depth in BO
- */
- private $spacer_size = '5';
+ /*
+ * Spaces per depth in BO
+ */
+ private $spacer_size = '5';
public function __construct()
{
@@ -111,13 +111,13 @@ class Blocktopmenu extends Module
public function getContent()
{
- $id_lang = (int)Context::getContext()->language->id;
- $languages = $this->context->controller->getLanguages();
- $default_language = Configuration::get('PS_LANG_DEFAULT');
+ $id_lang = (int)Context::getContext()->language->id;
+ $languages = $this->context->controller->getLanguages();
+ $default_language = Configuration::get('PS_LANG_DEFAULT');
- $labels = Tools::getValue('label') ? array_filter(Tools::getValue('label'), 'strlen') : array();
- $spacer = str_repeat(' ', $this->spacer_size);
- $divLangName = 'link_label';
+ $labels = Tools::getValue('label') ? array_filter(Tools::getValue('label'), 'strlen') : array();
+ $spacer = str_repeat(' ', $this->spacer_size);
+ $divLangName = 'link_label';
if (Tools::isSubmit('submitBlocktopmenu'))
{
@@ -130,14 +130,14 @@ class Blocktopmenu extends Module
else if (Tools::isSubmit('submitBlocktopmenuLinks'))
{
- if ((Tools::getValue('link') == '') && (!count($labels)))
- ;
- else if (Tools::getValue('link') == '')
- $this->_html .= $this->displayError($this->l('Please, fill the "Link" field'));
- else if (!count($labels))
- $this->_html .= $this->displayError($this->l('Please add a label'));
- else if (!isset($labels[$default_language]))
- $this->_html .= $this->displayError($this->l('Please add a label for your default language'));
+ if ((Tools::getValue('link') == '') && (!count($labels)))
+ ;
+ else if (Tools::getValue('link') == '')
+ $this->_html .= $this->displayError($this->l('Please, fill the "Link" field'));
+ else if (!count($labels))
+ $this->_html .= $this->displayError($this->l('Please add a label'));
+ else if (!isset($labels[$default_language]))
+ $this->_html .= $this->displayError($this->l('Please add a label for your default language'));
else
{
MenuTopLinks::add(Tools::getValue('link'), Tools::getValue('label'), Tools::getValue('new_window', 0), (int)Shop::getContextShopID());
@@ -182,7 +182,7 @@ class Blocktopmenu extends Module
// BEGIN CMS
$this->_html .= '';
// BEGIN SUPPLIER
@@ -213,15 +213,15 @@ class Blocktopmenu extends Module
$this->_html .= '';
$this->_html .= '
@@ -243,7 +243,7 @@ class Blocktopmenu extends Module
$("#availableItems option:selected").each(function(i){
var val = $(this).val();
var text = $(this).text();
- text = text.replace(/(^\s*)|(\s*$)/gi,"");
+ text = text.replace(/(^\s*)|(\s*$)/gi,"");
if (val == "PRODUCT")
{
val = prompt("'.$this->l('Set ID product').'");
@@ -315,10 +315,10 @@ class Blocktopmenu extends Module
';
- $links = MenuTopLinks::gets($id_lang, null, Shop::getContextShopID());
+ $links = MenuTopLinks::gets($id_lang, null, Shop::getContextShopID());
- if (!count($links))
- return $this->_html;
+ if (!count($links))
+ return $this->_html;
$this->_html .= '