// BugFix : BlockTopMenu is not visible when user is connected
This commit is contained in:
1 parent
bd100751ca
commit
7bf31d2e8e
3 files changed
+456
-451
No files matched your search
@@ -1404,6 +1404,7 @@ INSERT INTO `PREFIX_module_group` (`id_group`, `id_module`) VALUES
|
|||||||
("1", "53"),
|
("1", "53"),
|
||||||
("1", "54"),
|
("1", "54"),
|
||||||
("1", "55"),
|
("1", "55"),
|
||||||
|
("1", "56");
|
||||||
("2", "1"),
|
("2", "1"),
|
||||||
("2", "2"),
|
("2", "2"),
|
||||||
("2", "3"),
|
("2", "3"),
|
||||||
@@ -1456,6 +1457,7 @@ INSERT INTO `PREFIX_module_group` (`id_group`, `id_module`) VALUES
|
|||||||
("2", "53"),
|
("2", "53"),
|
||||||
("2", "54"),
|
("2", "54"),
|
||||||
("2", "55"),
|
("2", "55"),
|
||||||
|
("2", "56");
|
||||||
("3", "1"),
|
("3", "1"),
|
||||||
("3", "2"),
|
("3", "2"),
|
||||||
("3", "3"),
|
("3", "3"),
|
||||||
@@ -1508,6 +1510,7 @@ INSERT INTO `PREFIX_module_group` (`id_group`, `id_module`) VALUES
|
|||||||
("3", "53"),
|
("3", "53"),
|
||||||
("3", "54"),
|
("3", "54"),
|
||||||
("3", "55");
|
("3", "55");
|
||||||
|
("3", "56");
|
||||||
|
|
||||||
INSERT INTO `PREFIX_stock_available` (`id_stock_available`, `id_product`, `id_product_attribute`, `id_shop`, `id_group_shop`, `quantity`, `depends_on_stock`, `out_of_stock`) VALUES
|
INSERT INTO `PREFIX_stock_available` (`id_stock_available`, `id_product`, `id_product_attribute`, `id_shop`, `id_group_shop`, `quantity`, `depends_on_stock`, `out_of_stock`) VALUES
|
||||||
(1, 1, 25, 1, 0, 10, 0, 0),
|
(1, 1, 25, 1, 0, 10, 0, 0),
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/*/*
|
/*
|
||||||
* 2007-2011 PrestaShop
|
* 2007-2011 PrestaShop
|
||||||
*
|
*
|
||||||
* NOTICE OF LICENSE
|
* NOTICE OF LICENSE
|
||||||
*
|
*
|
||||||
@@ -28,233 +28,233 @@
|
|||||||
include _PS_MODULE_DIR_.'blocktopmenu/menutoplinks.class.php';
|
include _PS_MODULE_DIR_.'blocktopmenu/menutoplinks.class.php';
|
||||||
class blocktopmenu extends Module
|
class blocktopmenu extends Module
|
||||||
{
|
{
|
||||||
private $_menu = '';
|
private $_menu = '';
|
||||||
private $_html = '';
|
private $_html = '';
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->name = 'blocktopmenu';
|
$this->name = 'blocktopmenu';
|
||||||
$this->tab = 'Julien Breux Developpement';
|
$this->tab = 'Julien Breux Developpement';
|
||||||
$this->version = 1.3;
|
$this->version = 1.3;
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
$this->displayName = $this->l('Top horizontal menu');
|
$this->displayName = $this->l('Top horizontal menu');
|
||||||
$this->description = $this->l('Add a new menu on top of your shop.');
|
$this->description = $this->l('Add a new menu on top of your shop.');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function install()
|
public function install()
|
||||||
{
|
{
|
||||||
if(!parent::install() ||
|
if(!parent::install() ||
|
||||||
!$this->registerHook('top') ||
|
!$this->registerHook('top') ||
|
||||||
!Configuration::updateValue('MOD_BLOCKTOPMENU_ITEMS', 'CAT1,CMS1,CMS2,PRD1') ||
|
!Configuration::updateValue('MOD_BLOCKTOPMENU_ITEMS', 'CAT1,CMS1,CMS2,PRD1') ||
|
||||||
!Configuration::updateValue('MOD_BLOCKTOPMENU_SEARCH', '1') ||
|
!Configuration::updateValue('MOD_BLOCKTOPMENU_SEARCH', '1') ||
|
||||||
!$this->installDB())
|
!$this->installDB())
|
||||||
return false;
|
return false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function installDb()
|
public function installDb()
|
||||||
{
|
{
|
||||||
return (Db::getInstance()->execute('
|
return (Db::getInstance()->execute('
|
||||||
CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'linksmenutop` (
|
CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'linksmenutop` (
|
||||||
`id_link` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
`id_link` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||||
`id_shop` INT UNSIGNED NOT NULL,
|
`id_shop` INT UNSIGNED NOT NULL,
|
||||||
`new_window` TINYINT( 1 ) NOT NULL,
|
`new_window` TINYINT( 1 ) NOT NULL,
|
||||||
`link` VARCHAR( 128 ) NOT NULL,
|
`link` VARCHAR( 128 ) NOT NULL,
|
||||||
INDEX (`id_shop`)
|
INDEX (`id_shop`)
|
||||||
) ENGINE = MYISAM CHARACTER SET utf8 COLLATE utf8_general_ci;') AND
|
) ENGINE = MYISAM CHARACTER SET utf8 COLLATE utf8_general_ci;') AND
|
||||||
Db::getInstance()->execute('
|
Db::getInstance()->execute('
|
||||||
CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'linksmenutop_lang` (
|
CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'linksmenutop_lang` (
|
||||||
`id_link` INT NOT NULL,
|
`id_link` INT NOT NULL,
|
||||||
`id_lang` INT NOT NULL,
|
`id_lang` INT NOT NULL,
|
||||||
`id_shop` INT NOT NULL,
|
`id_shop` INT NOT NULL,
|
||||||
`label` VARCHAR( 128 ) NOT NULL ,
|
`label` VARCHAR( 128 ) NOT NULL ,
|
||||||
INDEX ( `id_link` , `id_lang`, `id_shop`)
|
INDEX ( `id_link` , `id_lang`, `id_shop`)
|
||||||
) ENGINE = MYISAM CHARACTER SET utf8 COLLATE utf8_general_ci;'));
|
) ENGINE = MYISAM CHARACTER SET utf8 COLLATE utf8_general_ci;'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function uninstall()
|
public function uninstall()
|
||||||
{
|
{
|
||||||
if(!parent::uninstall() ||
|
if(!parent::uninstall() ||
|
||||||
!Configuration::deleteByName('MOD_BLOCKTOPMENU_ITEMS') ||
|
!Configuration::deleteByName('MOD_BLOCKTOPMENU_ITEMS') ||
|
||||||
!Configuration::deleteByName('MOD_BLOCKTOPMENU_SEARCH') ||
|
!Configuration::deleteByName('MOD_BLOCKTOPMENU_SEARCH') ||
|
||||||
!$this->uninstallDB())
|
!$this->uninstallDB())
|
||||||
return false;
|
return false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function uninstallDb()
|
private function uninstallDb()
|
||||||
{
|
{
|
||||||
Db::getInstance()->execute('DROP TABLE `'._DB_PREFIX_.'linksmenutop`');
|
Db::getInstance()->execute('DROP TABLE `'._DB_PREFIX_.'linksmenutop`');
|
||||||
Db::getInstance()->execute('DROP TABLE `'._DB_PREFIX_.'linksmenutop_lang`');
|
Db::getInstance()->execute('DROP TABLE `'._DB_PREFIX_.'linksmenutop_lang`');
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getContent()
|
public function getContent()
|
||||||
{
|
{
|
||||||
global $cookie;
|
global $cookie;
|
||||||
if(Tools::isSubmit('submitBlocktopmenu'))
|
if(Tools::isSubmit('submitBlocktopmenu'))
|
||||||
{
|
{
|
||||||
if(Configuration::updateValue('MOD_BLOCKTOPMENU_ITEMS', Tools::getValue('items')))
|
if(Configuration::updateValue('MOD_BLOCKTOPMENU_ITEMS', Tools::getValue('items')))
|
||||||
$this->_html .= $this->displayConfirmation($this->l('Settings Updated'));
|
$this->_html .= $this->displayConfirmation($this->l('Settings Updated'));
|
||||||
else
|
else
|
||||||
$this->_html .= $this->displayError($this->l('Unable to update settings'));
|
$this->_html .= $this->displayError($this->l('Unable to update settings'));
|
||||||
Configuration::updateValue('MOD_BLOCKTOPMENU_SEARCH', (bool)Tools::getValue('search'));
|
Configuration::updateValue('MOD_BLOCKTOPMENU_SEARCH', (bool)Tools::getValue('search'));
|
||||||
}
|
}
|
||||||
if(Tools::isSubmit('submitBlocktopmenuLinks'))
|
if(Tools::isSubmit('submitBlocktopmenuLinks'))
|
||||||
{
|
{
|
||||||
if(Tools::getValue('link') == '')
|
if(Tools::getValue('link') == '')
|
||||||
{
|
{
|
||||||
$this->_html .= $this->displayError($this->l('Unable to add this link'));
|
$this->_html .= $this->displayError($this->l('Unable to add this link'));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
MenuTopLinks::add(Tools::getValue('link'), Tools::getValue('label'), Tools::getValue('new_window', 0), (int)$this->context->shop->id);
|
MenuTopLinks::add(Tools::getValue('link'), Tools::getValue('label'), Tools::getValue('new_window', 0), (int)$this->context->shop->id);
|
||||||
$this->_html .= $this->displayConfirmation($this->l('The link has been added'));
|
$this->_html .= $this->displayConfirmation($this->l('The link has been added'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(Tools::isSubmit('submitBlocktopmenuRemove'))
|
if(Tools::isSubmit('submitBlocktopmenuRemove'))
|
||||||
{
|
{
|
||||||
$id_link = Tools::getValue('id_link', 0);
|
$id_link = Tools::getValue('id_link', 0);
|
||||||
MenuTopLinks::remove($id_link, (int)$this->context->shop->id);
|
MenuTopLinks::remove($id_link, (int)$this->context->shop->id);
|
||||||
Configuration::updateValue('MOD_BLOCKTOPMENU_ITEMS', str_replace(array('LNK'.$id_link.',', 'LNK'.$id_link), '', Configuration::get('MOD_BLOCKTOPMENU_ITEMS')));
|
Configuration::updateValue('MOD_BLOCKTOPMENU_ITEMS', str_replace(array('LNK'.$id_link.',', 'LNK'.$id_link), '', Configuration::get('MOD_BLOCKTOPMENU_ITEMS')));
|
||||||
$this->_html .= $this->displayConfirmation($this->l('The link has been removed'));
|
$this->_html .= $this->displayConfirmation($this->l('The link has been removed'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->_html .= '
|
$this->_html .= '
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<div class="multishop_info">
|
<div class="multishop_info">
|
||||||
'.$this->l('The modifications will be applied to').' '.(Context::shop() == Shop::CONTEXT_SHOP ? $this->l('shop:').' '.$this->context->shop->name : $this->l('all shops')).'.
|
'.$this->l('The modifications will be applied to').' '.(Context::shop() == Shop::CONTEXT_SHOP ? $this->l('shop:').' '.$this->context->shop->name : $this->l('all shops')).'.
|
||||||
</div>
|
</div>
|
||||||
<legend><img src="'.$this->_path.'logo.gif" alt="" title="" />'.$this->l('Settings').'</legend>
|
<legend><img src="'.$this->_path.'logo.gif" alt="" title="" />'.$this->l('Settings').'</legend>
|
||||||
<form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post" id="form">
|
<form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post" id="form">
|
||||||
<div style="display: none">
|
<div style="display: none">
|
||||||
<label>'.$this->l('Items').'</label>
|
<label>'.$this->l('Items').'</label>
|
||||||
<div class="margin-form">
|
<div class="margin-form">
|
||||||
<input type="text" name="items" id="itemsInput" value="'.Configuration::get('MOD_BLOCKTOPMENU_ITEMS').'" size="70" />
|
<input type="text" name="items" id="itemsInput" value="'.Configuration::get('MOD_BLOCKTOPMENU_ITEMS').'" size="70" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="clear"> </div>
|
<div class="clear"> </div>
|
||||||
<table style="margin-left: 130px;">
|
<table style="margin-left: 130px;">
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<select multiple="multiple" id="items" style="width: 300px; height: 160px;">';
|
<select multiple="multiple" id="items" style="width: 300px; height: 160px;">';
|
||||||
$this->makeMenuOption();
|
$this->makeMenuOption();
|
||||||
$this->_html .= '</select><br/>
|
$this->_html .= '</select><br/>
|
||||||
<br/>
|
<br/>
|
||||||
<a href="#" id="removeItem" style="border: 1px solid rgb(170, 170, 170); margin: 2px; padding: 2px; text-align: center; display: block; text-decoration: none; background-color: rgb(250, 250, 250); color: rgb(18, 52, 86);">'.$this->l('Remove').' >></a>
|
<a href="#" id="removeItem" style="border: 1px solid rgb(170, 170, 170); margin: 2px; padding: 2px; text-align: center; display: block; text-decoration: none; background-color: rgb(250, 250, 250); color: rgb(18, 52, 86);">'.$this->l('Remove').' >></a>
|
||||||
</td>
|
</td>
|
||||||
<td style="padding-left: 20px;">
|
<td style="padding-left: 20px;">
|
||||||
<select multiple="multiple" id="availableItems" style="width: 300px; height: 160px;">';
|
<select multiple="multiple" id="availableItems" style="width: 300px; height: 160px;">';
|
||||||
// BEGIN CMS
|
// BEGIN CMS
|
||||||
$this->_html .= '<optgroup label="'.$this->l('CMS').'">';
|
$this->_html .= '<optgroup label="'.$this->l('CMS').'">';
|
||||||
$_cms = CMS::listCms($cookie->id_lang);
|
$_cms = CMS::listCms($cookie->id_lang);
|
||||||
foreach($_cms as $cms)
|
foreach($_cms as $cms)
|
||||||
$this->_html .= '<option value="CMS'.$cms['id_cms'].'" style="margin-left:10px;">'.$cms['meta_title'].'</option>';
|
$this->_html .= '<option value="CMS'.$cms['id_cms'].'" style="margin-left:10px;">'.$cms['meta_title'].'</option>';
|
||||||
$this->_html .= '</optgroup>';
|
$this->_html .= '</optgroup>';
|
||||||
// END CMS
|
// END CMS
|
||||||
// BEGIN SUPPLIER
|
// BEGIN SUPPLIER
|
||||||
$this->_html .= '<optgroup label="'.$this->l('Supplier').'">';
|
$this->_html .= '<optgroup label="'.$this->l('Supplier').'">';
|
||||||
$suppliers = Supplier::getSuppliers(false, $cookie->id_lang);
|
$suppliers = Supplier::getSuppliers(false, $cookie->id_lang);
|
||||||
foreach($suppliers as $supplier)
|
foreach($suppliers as $supplier)
|
||||||
$this->_html .= '<option value="SUP'.$supplier['id_supplier'].'" style="margin-left:10px;">'.$supplier['name'].'</option>';
|
$this->_html .= '<option value="SUP'.$supplier['id_supplier'].'" style="margin-left:10px;">'.$supplier['name'].'</option>';
|
||||||
$this->_html .= '</optgroup>';
|
$this->_html .= '</optgroup>';
|
||||||
// END SUPPLIER
|
// END SUPPLIER
|
||||||
// BEGIN Manufacturer
|
// BEGIN Manufacturer
|
||||||
$this->_html .= '<optgroup label="'.$this->l('Manufacturer').'">';
|
$this->_html .= '<optgroup label="'.$this->l('Manufacturer').'">';
|
||||||
$manufacturers = Manufacturer::getManufacturers(false, $cookie->id_lang);
|
$manufacturers = Manufacturer::getManufacturers(false, $cookie->id_lang);
|
||||||
foreach($manufacturers as $manufacturer)
|
foreach($manufacturers as $manufacturer)
|
||||||
$this->_html .= '<option value="MAN'.$manufacturer['id_manufacturer'].'" style="margin-left:10px;">'.$manufacturer['name'].'</option>';
|
$this->_html .= '<option value="MAN'.$manufacturer['id_manufacturer'].'" style="margin-left:10px;">'.$manufacturer['name'].'</option>';
|
||||||
$this->_html .= '</optgroup>';
|
$this->_html .= '</optgroup>';
|
||||||
// END Manufacturer
|
// END Manufacturer
|
||||||
// BEGIN Categories
|
// BEGIN Categories
|
||||||
$this->_html .= '<optgroup label="'.$this->l('Categories').'">';
|
$this->_html .= '<optgroup label="'.$this->l('Categories').'">';
|
||||||
$this->getCategoryOption(1, $cookie->id_lang);
|
$this->getCategoryOption(1, $cookie->id_lang);
|
||||||
$this->_html .= '</optgroup>';
|
$this->_html .= '</optgroup>';
|
||||||
// END Categories
|
// END Categories
|
||||||
// BEGIN Products
|
// BEGIN Products
|
||||||
$this->_html .= '<optgroup label="'.$this->l('Products').'">';
|
$this->_html .= '<optgroup label="'.$this->l('Products').'">';
|
||||||
$this->_html .= '<option value="PRODUCT" style="margin-left:10px;font-style:italic">'.$this->l('Choose ID product').'</option>';
|
$this->_html .= '<option value="PRODUCT" style="margin-left:10px;font-style:italic">'.$this->l('Choose ID product').'</option>';
|
||||||
$this->_html .= '</optgroup>';
|
$this->_html .= '</optgroup>';
|
||||||
// END Products
|
// END Products
|
||||||
// BEGIN Menu Top Links
|
// BEGIN Menu Top Links
|
||||||
$this->_html .= '<optgroup label="'.$this->l('Menu Top Links').'">';
|
$this->_html .= '<optgroup label="'.$this->l('Menu Top Links').'">';
|
||||||
$links = MenuTopLinks::gets($cookie->id_lang, null, (int)$this->context->shop->id);
|
$links = MenuTopLinks::gets($cookie->id_lang, null, (int)$this->context->shop->id);
|
||||||
foreach($links as $link)
|
foreach($links as $link)
|
||||||
$this->_html .= '<option value="LNK'.$link['id_link'].'" style="margin-left:10px;">'.$link['label'].'</option>';
|
$this->_html .= '<option value="LNK'.$link['id_link'].'" style="margin-left:10px;">'.$link['label'].'</option>';
|
||||||
$this->_html .= '</optgroup>';
|
$this->_html .= '</optgroup>';
|
||||||
// END Menu Top Links
|
// END Menu Top Links
|
||||||
$this->_html .= '</select><br />
|
$this->_html .= '</select><br />
|
||||||
<br />
|
<br />
|
||||||
<a href="#" id="addItem" style="border: 1px solid rgb(170, 170, 170); margin: 2px; padding: 2px; text-align: center; display: block; text-decoration: none; background-color: rgb(250, 250, 250); color: rgb(18, 52, 86);"><< '.$this->l('Add').'</a>
|
<a href="#" id="addItem" style="border: 1px solid rgb(170, 170, 170); margin: 2px; padding: 2px; text-align: center; display: block; text-decoration: none; background-color: rgb(250, 250, 250); color: rgb(18, 52, 86);"><< '.$this->l('Add').'</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<div class="clear"> </div>
|
<div class="clear"> </div>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
$("#addItem").click(add);
|
$("#addItem").click(add);
|
||||||
$("#availableItems").dblclick(add);
|
$("#availableItems").dblclick(add);
|
||||||
$("#removeItem").click(remove);
|
$("#removeItem").click(remove);
|
||||||
$("#items").dblclick(remove);
|
$("#items").dblclick(remove);
|
||||||
function add()
|
function add()
|
||||||
{
|
{
|
||||||
$("#availableItems option:selected").each(function(i){
|
$("#availableItems option:selected").each(function(i){
|
||||||
var val = $(this).val();
|
var val = $(this).val();
|
||||||
var text = $(this).text();
|
var text = $(this).text();
|
||||||
if(val == "PRODUCT")
|
if(val == "PRODUCT")
|
||||||
{
|
{
|
||||||
val = prompt("'.$this->l('Set ID product').'");
|
val = prompt("'.$this->l('Set ID product').'");
|
||||||
if(val == null || val == "" || isNaN(val))
|
if(val == null || val == "" || isNaN(val))
|
||||||
return;
|
return;
|
||||||
text = "'.$this->l('Product ID').' "+val;
|
text = "'.$this->l('Product ID').' "+val;
|
||||||
val = "PRD"+val;
|
val = "PRD"+val;
|
||||||
}
|
}
|
||||||
$("#items").append("<option value=\""+val+"\">"+text+"</option>");
|
$("#items").append("<option value=\""+val+"\">"+text+"</option>");
|
||||||
});
|
});
|
||||||
serialize();
|
serialize();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
function remove()
|
function remove()
|
||||||
{
|
{
|
||||||
$("#items option:selected").each(function(i){
|
$("#items option:selected").each(function(i){
|
||||||
$(this).remove();
|
$(this).remove();
|
||||||
});
|
});
|
||||||
serialize();
|
serialize();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
function serialize()
|
function serialize()
|
||||||
{
|
{
|
||||||
var options = "";
|
var options = "";
|
||||||
$("#items option").each(function(i){
|
$("#items option").each(function(i){
|
||||||
options += $(this).val()+",";
|
options += $(this).val()+",";
|
||||||
});
|
});
|
||||||
$("#itemsInput").val(options.substr(0, options.length - 1));
|
$("#itemsInput").val(options.substr(0, options.length - 1));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<label for="s">'.$this->l('Search Bar').'</label>
|
<label for="s">'.$this->l('Search Bar').'</label>
|
||||||
<div class="margin-form">
|
<div class="margin-form">
|
||||||
<input type="checkbox" name="search" id="s" value="1"'.((Configuration::get('MOD_BLOCKTOPMENU_SEARCH')) ? ' checked=""': '').'/>
|
<input type="checkbox" name="search" id="s" value="1"'.((Configuration::get('MOD_BLOCKTOPMENU_SEARCH')) ? ' checked=""': '').'/>
|
||||||
</div>
|
</div>
|
||||||
<p class="center">
|
<p class="center">
|
||||||
<input type="submit" name="submitBlocktopmenu" value="'.$this->l(' Save ').'" class="button" />
|
<input type="submit" name="submitBlocktopmenu" value="'.$this->l(' Save ').'" class="button" />
|
||||||
</p>
|
</p>
|
||||||
</form>
|
</form>
|
||||||
</fieldset><br />';
|
</fieldset><br />';
|
||||||
|
|
||||||
$defaultLanguage = intval(Configuration::get('PS_LANG_DEFAULT'));
|
$defaultLanguage = intval(Configuration::get('PS_LANG_DEFAULT'));
|
||||||
$languages = Language::getLanguages();
|
$languages = Language::getLanguages();
|
||||||
$iso = Language::getIsoById($defaultLanguage);
|
$iso = Language::getIsoById($defaultLanguage);
|
||||||
$divLangName = 'link_label';
|
$divLangName = 'link_label';
|
||||||
$this->_html .= '
|
$this->_html .= '
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<legend><img src="../img/admin/add.gif" alt="" title="" />'.$this->l('Add Menu Top Link').'</legend>
|
<legend><img src="../img/admin/add.gif" alt="" title="" />'.$this->l('Add Menu Top Link').'</legend>
|
||||||
<form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post" id="form">
|
<form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post" id="form">
|
||||||
<label>'.$this->l('Label').'</label>
|
<label>'.$this->l('Label').'</label>
|
||||||
<div class="margin-form">';
|
<div class="margin-form">';
|
||||||
foreach ($languages as $language)
|
foreach ($languages as $language)
|
||||||
{
|
{
|
||||||
$this->_html .= '
|
$this->_html .= '
|
||||||
@@ -264,228 +264,230 @@ class blocktopmenu extends Module
|
|||||||
}
|
}
|
||||||
$this->_html .= $this->displayFlags($languages, $defaultLanguage, $divLangName, 'link_label', true);
|
$this->_html .= $this->displayFlags($languages, $defaultLanguage, $divLangName, 'link_label', true);
|
||||||
|
|
||||||
$this->_html .= '</div><p class="clear"> </p>
|
$this->_html .= '</div><p class="clear"> </p>
|
||||||
<label>'.$this->l('Link').'</label>
|
<label>'.$this->l('Link').'</label>
|
||||||
<div class="margin-form">
|
<div class="margin-form">
|
||||||
<input type="text" name="link" value="" size="70" />
|
<input type="text" name="link" value="" size="70" />
|
||||||
</div>
|
</div>
|
||||||
<label>'.$this->l('New Window').'</label>
|
<label>'.$this->l('New Window').'</label>
|
||||||
<div class="margin-form">
|
<div class="margin-form">
|
||||||
<input type="checkbox" name="new_window" value="1" />
|
<input type="checkbox" name="new_window" value="1" />
|
||||||
</div>
|
</div>
|
||||||
<p class="center">
|
<p class="center">
|
||||||
<input type="submit" name="submitBlocktopmenuLinks" value="'.$this->l(' Add ').'" class="button" />
|
<input type="submit" name="submitBlocktopmenuLinks" value="'.$this->l(' Add ').'" class="button" />
|
||||||
</p>
|
</p>
|
||||||
</form>
|
</form>
|
||||||
</fieldset><br />';
|
</fieldset><br />';
|
||||||
|
|
||||||
$this->_html .= '
|
$this->_html .= '
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<legend><img src="../img/admin/details.gif" alt="" title="" />'.$this->l('List Menu Top Link').'</legend>
|
<legend><img src="../img/admin/details.gif" alt="" title="" />'.$this->l('List Menu Top Link').'</legend>
|
||||||
<table style="width:100%;">
|
<table style="width:100%;">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>'.$this->l('Id Link').'</th>
|
<th>'.$this->l('Id Link').'</th>
|
||||||
<th>'.$this->l('Label').'</th>
|
<th>'.$this->l('Label').'</th>
|
||||||
<th>'.$this->l('Link').'</th>
|
<th>'.$this->l('Link').'</th>
|
||||||
<th>'.$this->l('New Window').'</th>
|
<th>'.$this->l('New Window').'</th>
|
||||||
<th>'.$this->l('Action').'</th>
|
<th>'.$this->l('Action').'</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>';
|
<tbody>';
|
||||||
$links = MenuTopLinks::gets($cookie->id_lang, null, $this->context->shop->id);
|
$links = MenuTopLinks::gets($cookie->id_lang, null, $this->context->shop->id);
|
||||||
foreach($links as $link)
|
foreach($links as $link)
|
||||||
{
|
{
|
||||||
$this->_html .= '
|
$this->_html .= '
|
||||||
<tr>
|
<tr>
|
||||||
<td>'.$link['id_link'].'</td>
|
<td>'.$link['id_link'].'</td>
|
||||||
<td>'.$link['label'].'</td>
|
<td>'.$link['label'].'</td>
|
||||||
<td>'.$link['link'].'</td>
|
<td>'.$link['link'].'</td>
|
||||||
<td>'.(($link['new_window']) ? $this->l('Yes') : $this->l('No')).'</td>
|
<td>'.(($link['new_window']) ? $this->l('Yes') : $this->l('No')).'</td>
|
||||||
<td>
|
<td>
|
||||||
<form action="'.$_SERVER['REQUEST_URI'].'" method="post">
|
<form action="'.$_SERVER['REQUEST_URI'].'" method="post">
|
||||||
<input type="hidden" name="id_link" value="'.$link['id_link'].'" />
|
<input type="hidden" name="id_link" value="'.$link['id_link'].'" />
|
||||||
<input type="submit" name="submitBlocktopmenuRemove" value="'.$this->l('Remove').'" class="button" />
|
<input type="submit" name="submitBlocktopmenuRemove" value="'.$this->l('Remove').'" class="button" />
|
||||||
</form>
|
</form>
|
||||||
</td>
|
</td>
|
||||||
</tr>';
|
</tr>';
|
||||||
}
|
}
|
||||||
$this->_html .= '</tbody>
|
$this->_html .= '</tbody>
|
||||||
</table>
|
</table>
|
||||||
</fieldset>';
|
</fieldset>';
|
||||||
return $this->_html;
|
return $this->_html;
|
||||||
}
|
|
||||||
|
|
||||||
private function getMenuItems()
|
|
||||||
{
|
|
||||||
if (Context::shop() == Shop::CONTEXT_SHOP)
|
|
||||||
{
|
|
||||||
if (!Configuration::isOverridenByCurrentContext('MOD_BLOCKTOPMENU_ITEMS'))
|
|
||||||
$items_shop = Configuration::get('MOD_BLOCKTOPMENU_ITEMS');
|
|
||||||
}
|
|
||||||
if (!isset($items_shop))
|
|
||||||
$items_shop = '';
|
|
||||||
|
|
||||||
$items_shop = explode(',', $items_shop);
|
|
||||||
$items_global = Configuration::getGlobalValue('MOD_BLOCKTOPMENU_ITEMS');
|
|
||||||
$items_global = explode(',', $items_global);
|
|
||||||
|
|
||||||
return array('global' => $items_global, 'shop' => $items_shop);
|
|
||||||
}
|
|
||||||
|
|
||||||
private function makeMenuOption()
|
|
||||||
{
|
|
||||||
global $cookie;
|
|
||||||
foreach($this->getMenuItems() as $type => $items)
|
|
||||||
{
|
|
||||||
foreach ($items as $item)
|
|
||||||
{
|
|
||||||
$id = (int)substr($item, 3, strlen($item));
|
|
||||||
$disabled = ((Context::shop() == Shop::CONTEXT_SHOP && $type == 'global') ? ' disabled="disabled"': '');
|
|
||||||
switch(substr($item, 0, 3))
|
|
||||||
{
|
|
||||||
case'CAT':
|
|
||||||
$this->getCategoryOption($id, $cookie->id_lang, false);
|
|
||||||
break;
|
|
||||||
case'PRD':
|
|
||||||
$product = new Product($id, true, $cookie->id_lang);
|
|
||||||
if(!is_null($product->id))
|
|
||||||
$this->_html .= '<option value="PRD'.$id.'"'.$disabled.'>'.$product->name.'</option>'.PHP_EOL;
|
|
||||||
break;
|
|
||||||
case'CMS':
|
|
||||||
$cms = CMS::getLinks($cookie->id_lang, array($id));
|
|
||||||
if(count($cms))
|
|
||||||
$this->_html .= '<option value="CMS'.$id.'"'.$disabled.'>'.$cms[0]['meta_title'].'</option>'.PHP_EOL;
|
|
||||||
break;
|
|
||||||
case'MAN':
|
|
||||||
$manufacturer = new Manufacturer($id, $cookie->id_lang);
|
|
||||||
if(!is_null($manufacturer->id))
|
|
||||||
$this->_html .= '<option value="MAN'.$id.'"'.$disabled.'>'.$manufacturer->name.'</option>'.PHP_EOL;
|
|
||||||
break;
|
|
||||||
case'SUP':
|
|
||||||
$supplier = new Supplier($id, $cookie->id_lang);
|
|
||||||
if(!is_null($supplier->id))
|
|
||||||
$this->_html .= '<option value="SUP'.$id.'"'.$disabled.'>'.$supplier->name.'</option>'.PHP_EOL;
|
|
||||||
break;
|
|
||||||
case'LNK':
|
|
||||||
$link = MenuTopLinks::get($id, $cookie->id_lang, (int)$this->context->shop->id);
|
|
||||||
if(count($link))
|
|
||||||
$this->_html .= '<option value="LNK'.$id.'"'.$disabled.'>'.$link[0]['label'].'</option>'.PHP_EOL;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private function makeMenu()
|
|
||||||
{
|
|
||||||
global $cookie, $page_name;
|
|
||||||
foreach($this->getMenuItems() as $type => $items)
|
|
||||||
{
|
|
||||||
foreach ($items as $item)
|
|
||||||
{
|
|
||||||
$id = (int)substr($item, 3, strlen($item));
|
|
||||||
switch(substr($item, 0, 3))
|
|
||||||
{
|
|
||||||
case'CAT':
|
|
||||||
$this->getCategory($id, $cookie->id_lang);
|
|
||||||
break;
|
|
||||||
case'PRD':
|
|
||||||
$selected = ($page_name == 'product' && (Tools::getValue('id_product') == $id)) ? ' class="sfHover"' : '';
|
|
||||||
$product = new Product($id, true, $cookie->id_lang);
|
|
||||||
if(!is_null($product->id))
|
|
||||||
$this->_menu .= '<li'.$selected.'><a href="'.$product->getLink().'">'.$product->name.'</a></li>'.PHP_EOL;
|
|
||||||
break;
|
|
||||||
case'CMS':
|
|
||||||
$selected = ($page_name == 'cms' && (Tools::getValue('id_cms') == $id)) ? ' class="sfHover"' : '';
|
|
||||||
$cms = CMS::getLinks($cookie->id_lang, array($id));
|
|
||||||
if(count($cms))
|
|
||||||
$this->_menu .= '<li'.$selected.'><a href="'.$cms[0]['link'].'">'.$cms[0]['meta_title'].'</a></li>'.PHP_EOL;
|
|
||||||
break;
|
|
||||||
case'MAN':
|
|
||||||
$selected = ($page_name == 'manufacturer' && (Tools::getValue('id_manufacturer') == $id)) ? ' class="sfHover"' : '';
|
|
||||||
$manufacturer = new Manufacturer($id, $cookie->id_lang);
|
|
||||||
if(!is_null($manufacturer->id))
|
|
||||||
{
|
|
||||||
if (intval(Configuration::get('PS_REWRITING_SETTINGS')))
|
|
||||||
$manufacturer->link_rewrite = Tools::link_rewrite($manufacturer->name, false);
|
|
||||||
else
|
|
||||||
$manufacturer->link_rewrite = 0;
|
|
||||||
$link = new Link;
|
|
||||||
$this->_menu .= '<li'.$selected.'><a href="'.$link->getManufacturerLink($id, $manufacturer->link_rewrite).'">'.$manufacturer->name.'</a></li>'.PHP_EOL;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case'SUP':
|
|
||||||
$selected = ($page_name == 'supplier' && (Tools::getValue('id_supplier') == $id)) ? ' class="sfHover"' : '';
|
|
||||||
$supplier = new Supplier($id, $cookie->id_lang);
|
|
||||||
if(!is_null($supplier->id))
|
|
||||||
{
|
|
||||||
$link = new Link;
|
|
||||||
$this->_menu .= '<li'.$selected.'><a href="'.$link->getSupplierLink($id, $supplier->link_rewrite).'">'.$supplier->name.'</a></li>'.PHP_EOL;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case'LNK':
|
|
||||||
$link = MenuTopLinks::get($id, $cookie->id_lang, (int)$this->context->shop->id);
|
|
||||||
if(count($link))
|
|
||||||
$this->_menu .= '<li><a href="'.$link[0]['link'].'"'.(($link[0]['new_window']) ? ' target="_blank"': '').'>'.$link[0]['label'].'</a></li>'.PHP_EOL;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
private function getCategoryOption($id_category, $id_lang, $children = true)
|
private function getMenuItems()
|
||||||
{
|
{
|
||||||
$categorie = new Category($id_category, $id_lang);
|
if (Context::shop() == Shop::CONTEXT_SHOP)
|
||||||
if(is_null($categorie->id))
|
{
|
||||||
return;
|
if (!Configuration::isOverridenByCurrentContext('MOD_BLOCKTOPMENU_ITEMS'))
|
||||||
if(count(explode('.', $categorie->name)) > 1)
|
$items_shop = Configuration::get('MOD_BLOCKTOPMENU_ITEMS');
|
||||||
$name = str_replace('.', '', strstr($categorie->name, '.'));
|
}
|
||||||
else
|
if (!isset($items_shop))
|
||||||
$name = $categorie->name;
|
$items_shop = '';
|
||||||
$this->_html .= '<option value="CAT'.$categorie->id.'" style="margin-left:'.(($children) ? round(15+(15*(int)$categorie->level_depth)) : 0).'px;">'.$name.'</option>';
|
|
||||||
if($children)
|
$items_shop = explode(',', $items_shop);
|
||||||
{
|
$items_global = Configuration::getGlobalValue('MOD_BLOCKTOPMENU_ITEMS');
|
||||||
$childrens = Category::getChildren($id_category, $id_lang);
|
$items_global = explode(',', $items_global);
|
||||||
if(count($childrens))
|
|
||||||
foreach($childrens as $children)
|
return array('global' => $items_global, 'shop' => $items_shop);
|
||||||
$this->getCategoryOption($children['id_category'], $id_lang);
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private function getCategory($id_category, $id_lang)
|
private function makeMenuOption()
|
||||||
{
|
{
|
||||||
global $page_name;
|
global $cookie;
|
||||||
|
foreach($this->getMenuItems() as $type => $items)
|
||||||
|
{
|
||||||
|
foreach ($items as $item)
|
||||||
|
{
|
||||||
|
$id = (int)substr($item, 3, strlen($item));
|
||||||
|
$disabled = ((Context::shop() == Shop::CONTEXT_SHOP && $type == 'global') ? ' disabled="disabled"': '');
|
||||||
|
switch(substr($item, 0, 3))
|
||||||
|
{
|
||||||
|
case'CAT':
|
||||||
|
$this->getCategoryOption($id, $cookie->id_lang, false);
|
||||||
|
break;
|
||||||
|
case'PRD':
|
||||||
|
$product = new Product($id, true, $cookie->id_lang);
|
||||||
|
if(!is_null($product->id))
|
||||||
|
$this->_html .= '<option value="PRD'.$id.'"'.$disabled.'>'.$product->name.'</option>'.PHP_EOL;
|
||||||
|
break;
|
||||||
|
case'CMS':
|
||||||
|
$cms = CMS::getLinks($cookie->id_lang, array($id));
|
||||||
|
if(count($cms))
|
||||||
|
$this->_html .= '<option value="CMS'.$id.'"'.$disabled.'>'.$cms[0]['meta_title'].'</option>'.PHP_EOL;
|
||||||
|
break;
|
||||||
|
case'MAN':
|
||||||
|
$manufacturer = new Manufacturer($id, $cookie->id_lang);
|
||||||
|
if(!is_null($manufacturer->id))
|
||||||
|
$this->_html .= '<option value="MAN'.$id.'"'.$disabled.'>'.$manufacturer->name.'</option>'.PHP_EOL;
|
||||||
|
break;
|
||||||
|
case'SUP':
|
||||||
|
$supplier = new Supplier($id, $cookie->id_lang);
|
||||||
|
if(!is_null($supplier->id))
|
||||||
|
$this->_html .= '<option value="SUP'.$id.'"'.$disabled.'>'.$supplier->name.'</option>'.PHP_EOL;
|
||||||
|
break;
|
||||||
|
case'LNK':
|
||||||
|
$link = MenuTopLinks::get($id, $cookie->id_lang, (int)$this->context->shop->id);
|
||||||
|
if(count($link))
|
||||||
|
$this->_html .= '<option value="LNK'.$id.'"'.$disabled.'>'.$link[0]['label'].'</option>'.PHP_EOL;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$categorie = new Category($id_category, $id_lang);
|
private function makeMenu()
|
||||||
if(is_null($categorie->id))
|
{
|
||||||
return;
|
global $cookie, $page_name;
|
||||||
$selected = ($page_name == 'category' && ((int)Tools::getValue('id_category') == $id_category)) ? ' class="sfHoverForce"' : '';
|
foreach($this->getMenuItems() as $type => $items)
|
||||||
$this->_menu .= '<li'.$selected.'>';
|
{
|
||||||
if(count(explode('.', $categorie->name)) > 1)
|
foreach ($items as $item)
|
||||||
$name = str_replace('.', '', strstr($categorie->name, '.'));
|
{
|
||||||
else
|
$id = (int)substr($item, 3, strlen($item));
|
||||||
$name = $categorie->name;
|
switch(substr($item, 0, 3))
|
||||||
$this->_menu .= '<a href="'.$categorie->getLink().'">'.$name.'</a>';
|
{
|
||||||
$childrens = Category::getChildren($id_category, $id_lang);
|
case'CAT':
|
||||||
if(count($childrens))
|
$this->getCategory($id, $cookie->id_lang);
|
||||||
{
|
break;
|
||||||
$this->_menu .= '<ul>';
|
case'PRD':
|
||||||
foreach($childrens as $children)
|
$selected = ($page_name == 'product' && (Tools::getValue('id_product') == $id)) ? ' class="sfHover"' : '';
|
||||||
$this->getCategory($children['id_category'], $id_lang);
|
$product = new Product($id, true, $cookie->id_lang);
|
||||||
$this->_menu .= '</ul>';
|
if(!is_null($product->id))
|
||||||
}
|
$this->_menu .= '<li'.$selected.'><a href="'.$product->getLink().'">'.$product->name.'</a></li>'.PHP_EOL;
|
||||||
$this->_menu .= '</li>';
|
break;
|
||||||
}
|
case'CMS':
|
||||||
|
$selected = ($page_name == 'cms' && (Tools::getValue('id_cms') == $id)) ? ' class="sfHover"' : '';
|
||||||
|
$cms = CMS::getLinks($cookie->id_lang, array($id));
|
||||||
|
if(count($cms))
|
||||||
|
$this->_menu .= '<li'.$selected.'><a href="'.$cms[0]['link'].'">'.$cms[0]['meta_title'].'</a></li>'.PHP_EOL;
|
||||||
|
break;
|
||||||
|
case'MAN':
|
||||||
|
$selected = ($page_name == 'manufacturer' && (Tools::getValue('id_manufacturer') == $id)) ? ' class="sfHover"' : '';
|
||||||
|
$manufacturer = new Manufacturer($id, $cookie->id_lang);
|
||||||
|
if(!is_null($manufacturer->id))
|
||||||
|
{
|
||||||
|
if (intval(Configuration::get('PS_REWRITING_SETTINGS')))
|
||||||
|
$manufacturer->link_rewrite = Tools::link_rewrite($manufacturer->name, false);
|
||||||
|
else
|
||||||
|
$manufacturer->link_rewrite = 0;
|
||||||
|
$link = new Link;
|
||||||
|
$this->_menu .= '<li'.$selected.'><a href="'.$link->getManufacturerLink($id, $manufacturer->link_rewrite).'">'.$manufacturer->name.'</a></li>'.PHP_EOL;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case'SUP':
|
||||||
|
$selected = ($page_name == 'supplier' && (Tools::getValue('id_supplier') == $id)) ? ' class="sfHover"' : '';
|
||||||
|
$supplier = new Supplier($id, $cookie->id_lang);
|
||||||
|
if(!is_null($supplier->id))
|
||||||
|
{
|
||||||
|
$link = new Link;
|
||||||
|
$this->_menu .= '<li'.$selected.'><a href="'.$link->getSupplierLink($id, $supplier->link_rewrite).'">'.$supplier->name.'</a></li>'.PHP_EOL;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case'LNK':
|
||||||
|
$link = MenuTopLinks::get($id, $cookie->id_lang, (int)$this->context->shop->id);
|
||||||
|
if(count($link))
|
||||||
|
$this->_menu .= '<li><a href="'.$link[0]['link'].'"'.(($link[0]['new_window']) ? ' target="_blank"': '').'>'.$link[0]['label'].'</a></li>'.PHP_EOL;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public function hooktop($param)
|
private function getCategoryOption($id_category, $id_lang, $children = true)
|
||||||
{
|
{
|
||||||
|
$categorie = new Category($id_category, $id_lang);
|
||||||
|
if(is_null($categorie->id))
|
||||||
|
return;
|
||||||
|
if(count(explode('.', $categorie->name)) > 1)
|
||||||
|
$name = str_replace('.', '', strstr($categorie->name, '.'));
|
||||||
|
else
|
||||||
|
$name = $categorie->name;
|
||||||
|
$this->_html .= '<option value="CAT'.$categorie->id.'" style="margin-left:'.(($children) ? round(15+(15*(int)$categorie->level_depth)) : 0).'px;">'.$name.'</option>';
|
||||||
|
if($children)
|
||||||
|
{
|
||||||
|
$childrens = Category::getChildren($id_category, $id_lang);
|
||||||
|
if(count($childrens))
|
||||||
|
foreach($childrens as $children)
|
||||||
|
$this->getCategoryOption($children['id_category'], $id_lang);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function getCategory($id_category, $id_lang)
|
||||||
|
{
|
||||||
|
global $page_name;
|
||||||
|
|
||||||
|
$categorie = new Category($id_category, $id_lang);
|
||||||
|
if(is_null($categorie->id))
|
||||||
|
return;
|
||||||
|
$selected = ($page_name == 'category' && ((int)Tools::getValue('id_category') == $id_category)) ? ' class="sfHoverForce"' : '';
|
||||||
|
$this->_menu .= '<li'.$selected.'>';
|
||||||
|
if(count(explode('.', $categorie->name)) > 1)
|
||||||
|
$name = str_replace('.', '', strstr($categorie->name, '.'));
|
||||||
|
else
|
||||||
|
$name = $categorie->name;
|
||||||
|
$this->_menu .= '<a href="'.$categorie->getLink().'">'.$name.'</a>';
|
||||||
|
$childrens = Category::getChildren($id_category, $id_lang);
|
||||||
|
if(count($childrens))
|
||||||
|
{
|
||||||
|
$this->_menu .= '<ul>';
|
||||||
|
foreach($childrens as $children)
|
||||||
|
$this->getCategory($children['id_category'], $id_lang);
|
||||||
|
$this->_menu .= '</ul>';
|
||||||
|
}
|
||||||
|
$this->_menu .= '</li>';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function hookTop($param)
|
||||||
|
{
|
||||||
|
elog('rrrrrr');
|
||||||
|
caller();
|
||||||
global $smarty;
|
global $smarty;
|
||||||
$this->makeMenu();
|
$this->makeMenu();
|
||||||
$smarty->assign('MENU_SEARCH', Configuration::get('MOD_BLOCKTOPMENU_SEARCH'));
|
$smarty->assign('MENU_SEARCH', Configuration::get('MOD_BLOCKTOPMENU_SEARCH'));
|
||||||
$smarty->assign('MENU', $this->_menu);
|
$smarty->assign('MENU', $this->_menu);
|
||||||
$smarty->assign('this_path', $this->_path);
|
$smarty->assign('this_path', $this->_path);
|
||||||
return $this->display(__FILE__, 'blocktopmenu.tpl');
|
return $this->display(__FILE__, 'blocktopmenu.tpl');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
|
||||||
@@ -1,22 +1,22 @@
|
|||||||
{if $MENU != ''}
|
{if $MENU != ''}
|
||||||
</div>
|
</div>
|
||||||
<!-- Menu -->
|
<!-- Menu -->
|
||||||
<div class="sf-contener clearfix">
|
<div class="sf-contener clearfix">
|
||||||
<ul class="sf-menu clearfix">
|
<ul class="sf-menu clearfix">
|
||||||
{$MENU}
|
{$MENU}
|
||||||
{if $MENU_SEARCH}
|
{if $MENU_SEARCH}
|
||||||
<li class="sf-search noBack" style="float:right">
|
<li class="sf-search noBack" style="float:right">
|
||||||
<form id="searchbox" action="search.php" method="get">
|
<form id="searchbox" action="search.php" method="get">
|
||||||
<input type="hidden" value="position" name="orderby"/>
|
<input type="hidden" value="position" name="orderby"/>
|
||||||
<input type="hidden" value="desc" name="orderway"/>
|
<input type="hidden" value="desc" name="orderway"/>
|
||||||
<input type="text" name="search_query" value="{if isset($smarty.get.search_query)}{$smarty.get.search_query}{/if}" />
|
<input type="text" name="search_query" value="{if isset($smarty.get.search_query)}{$smarty.get.search_query}{/if}" />
|
||||||
</form>
|
</form>
|
||||||
</li>
|
</li>
|
||||||
{/if}
|
{/if}
|
||||||
</ul>
|
</ul>
|
||||||
<div class="sf-right"> </div>
|
<div class="sf-right"> </div>
|
||||||
<script type="text/javascript" src="{$this_path}js/hoverIntent.js"></script>
|
<script type="text/javascript" src="{$this_path}js/hoverIntent.js"></script>
|
||||||
<script type="text/javascript" src="{$this_path}js/superfish-modified.js"></script>
|
<script type="text/javascript" src="{$this_path}js/superfish-modified.js"></script>
|
||||||
<link rel="stylesheet" type="text/css" href="{$this_path}css/superfish-modified.css" media="screen">
|
<link rel="stylesheet" type="text/css" href="{$this_path}css/superfish-modified.css" media="screen">
|
||||||
<!--/ Menu -->
|
<!--/ Menu -->
|
||||||
{/if}
|
{/if}
|
||||||
Reference in new issue
Block a user