Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function install()
- {
- if (Module::isInstalled('blocktopmenu'))
- {
- require_once $_SERVER['DOCUMENT_ROOT'] . '/modules/blocktopmenu/menutoplinks.class.php';
- $languages = $this->context->controller->getLanguages();
- $shops = Shop::getContextListShopID();
- foreach ($shops as $shop_id)
- {
- $links_label = array();
- $labels = array();
- foreach ($languages as $key => $val)
- {
- $links_label[$val['id_lang']] = Context::getContext()->link->getModuleLink('my_module', 'my_controller', array(), null, $val['id_lang'], $shop_id);
- $labels[$val['id_lang']] = 'My Link Name';
- }
- $sql = 'SELECT * FROM '._DB_PREFIX_.'linksmenutop';
- if ($results = Db::getInstance()->ExecuteS($sql)) {
- $lastlink = array_pop($results);
- } else {
- return false;
- }
- if (!MenuTopLinks::add($links_label, $labels, 0, (int) $shop_id) ) {
- return false;
- }
- $this->linkname = ',LNK' . $lastlink['id_linksmenutop'];
- $modBlocktopmenuItems = Configuration::getValue['MOD_BLOCKTOPMENU_ITEMS'];
- $modBlocktopmenuItems = $modBlocktopmenuItems . $this->linkname;
- Configuration::updateValue('MOD_BLOCKTOPMENU_ITEMS', $this->linkname, false, (int)$shop_group_id, (int)$shop_id);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement