private function makeMegaDrown()
    {
        $IdLang = $this->context->cookie->id_lang;
        if (Tools::getIsset('id_category')) {
            $ActiveCategory = (int) Tools::getValue('id_category');
        } else {
            $ActiveCategory = null;
        }
        if (Tools::getIsset('id_product')) {
            if (!isset($this->context->cookie->last_visited_category) or !Product::idIsOnCategoryId(intval($_GET['id_product']), array('0' => array('id_category' => $this->context->cookie->last_visited_category)))) {
                $product = new Product(intval($_GET['id_product']));
                if (isset($product) and Validate::isLoadedObject($product)) {
                    $ActiveCategory = (int) $product->id_category_default;
                }
            } else {
                $ActiveCategory = (int) $this->context->cookie->last_visited_category;
            }
        }
        if ($ActiveCategory !== null) {
            $resultCat = Db::getInstance()->ExecuteS('
				SELECT *  
				FROM ' . _DB_PREFIX_ . 'admevo_button_link_cat 
				WHERE id_link_cat=' . $ActiveCategory);
        }
        $MDParameters = $this->getParameters();
        $MDConfiguration = $this->getConfigurations();
        if (sizeof($MDConfiguration)) {
            foreach ($MDConfiguration as $kButton => $ValButton) {
                $tabLinkButton[$ValButton['id_button']] = array();
                $tabIdLinkCat[$ValButton['id_button']] = array();
                $tabLinkCustom[$ValButton['id_button']] = array();
                $CatMenu = array();
                $CatMenu = $this->getButtonLinksCat($ValButton['id_button']);
                $LinkButton = $this->getButtonLinks($ValButton['id_button']);
                if (array_key_exists(0, $LinkButton)) {
                    $linkButton = $LinkButton[0]['link'];
                } else {
                    $linkButton = "";
                }
                $tabLinkButton[$ValButton['id_button']][] = basename($linkButton);
                if (sizeof($CatMenu)) {
                    foreach ($CatMenu as $kMenu => $ValCat) {
                        $tabIdLinkCat[$ValButton['id_button']][$ValCat['id_link_cat']] = $ValCat['id_link_cat'];
                        $DescendantCateogries = Db::getInstance()->ExecuteS('
							SELECT *  
							FROM ' . _DB_PREFIX_ . 'category  
							WHERE id_parent=' . $ValCat['id_link_cat']);
                        if (sizeof($DescendantCateogries)) {
                            foreach ($DescendantCateogries as $kDescCat => $ValDescCat) {
                                $tabIdLinkCat[$ValButton['id_button']][$ValDescCat['id_category']] = $ValDescCat['id_category'];
                            }
                        }
                    }
                }
                $CustomMenu = array();
                $CustomMenu = $this->getButtonLinksCustom($ValButton['id_button'], $this->context->cookie->id_lang);
                if (sizeof($CustomMenu)) {
                    foreach ($CustomMenu as $kMenu => $ValMenu) {
                        $tabLinkCustom[$ValButton['id_button']][$ValMenu['id_custom']] = basename($ValMenu['link']);
                        $CustomMenuUnder = array();
                        $CustomMenuUnder = $this->getButtonLinksCustomUnder($ValButton['id_button'], $ValMenu['id_custom'], $this->context->cookie->id_lang);
                        if (sizeof($CustomMenuUnder)) {
                            foreach ($CustomMenuUnder as $kDescCustom => $ValDescCustom) {
                                $tabLinkCustom[$ValButton['id_button']][$ValDescCustom['id_custom']] = basename($ValDescCustom['link']);
                            }
                        }
                    }
                }
            }
        }
        if (sizeof($MDConfiguration)) {
            $b = 0;
            foreach ($MDConfiguration as $kButton => $ValButton) {
                $LinkButton = $this->getButtonLinks($ValButton['id_button']);
                !array_key_exists(0, $LinkButton) ? $linkButton = "#" : ($linkButton = $LinkButton[0]['link']);
                $this->_menu .= '<li style="background-color: #' . $ValButton['buttonColor'] . '" class="liBouton liBouton' . $b . '">' . $this->eol;
                strpos(strtolower($ValButton['name_button']), "<br />") ? $decal = "margin-top : -5px;" : ($decal = "");
                $this->_menu .= '<div' . ($decal != 0 ? ' style="' . $decal . '"' : '') . '><a href="' . $linkButton . '" ' . ($linkButton == "#" ? "onclick='return false'" : false) . ' class="buttons" ' . (in_array($ActiveCategory, $tabIdLinkCat[$ValButton['id_button']]) || in_array(basename($_SERVER['REQUEST_URI']), $tabLinkCustom[$ValButton['id_button']]) || in_array(basename($_SERVER['REQUEST_URI']), $tabLinkButton[$ValButton['id_button']]) ? 'style="background-position : 0 -' . $MDParameters[0]['MenuHeight'] . 'px; color: #' . $MDParameters[0]['ColorFontMenuHover'] . '"' : false) . '>' . $ValButton['name_button'] . '</a></div>' . $this->eol;
                $CatMenu = array();
                $CatMenu = $this->getButtonLinksCat($ValButton['id_button']);
                $CustomMenu = array();
                $CustomMenu = $this->getButtonLinksCustom($ValButton['id_button'], $this->context->cookie->id_lang);
                $NbColsMax = $this->getMaxColumns($ValButton['id_button']);
                $MaxCols = 0;
                $MaxLines = 0;
                $tabLines = array();
                $m = 0;
                if (sizeof($CatMenu)) {
                    foreach ($CatMenu as $kMenu => $ValCat) {
                        $tabLines[$kButton][$ValCat['num_ligne']] = $ValCat['num_ligne'];
                        $tabLinesOrder[$kButton][$ValCat['num_ligne']][$ValCat['num_column']] = $ValCat['num_column'];
                        $tabLinesDatas[$kButton][$ValCat['num_ligne']][$ValCat['num_column']][$m] = $ValCat;
                        $tabLinesType[$kButton][$ValCat['num_ligne']][$ValCat['num_column']][$m] = 'category';
                        $tabColumn[$kButton][$ValCat['num_ligne']] = $ValCat['num_column'];
                        $tabColumnOrder[$kButton][$ValCat['num_column']][$ValCat['num_ligne']] = $ValCat['num_ligne'];
                        $tabColumnDatas[$kButton][$ValCat['num_column']][$ValCat['num_ligne']][$m] = $ValCat;
                        $tabColumnType[$kButton][$ValCat['num_column']][$ValCat['num_ligne']][$m] = 'category';
                        $m++;
                        $MaxCols < $ValCat['num_column'] * 1 ? $MaxCols = $ValCat['num_column'] : false;
                        $MaxLines < $ValCat['num_ligne'] * 1 ? $MaxLines = $ValCat['num_ligne'] : false;
                    }
                }
                if (sizeof($CustomMenu)) {
                    foreach ($CustomMenu as $kCustom => $ValCustom) {
                        $tabLines[$kButton][$ValCustom['num_ligne']] = $ValCustom['num_ligne'];
                        $tabLinesOrder[$kButton][$ValCustom['num_ligne']][$ValCustom['num_column']] = $ValCustom['num_column'];
                        $tabLinesDatas[$kButton][$ValCustom['num_ligne']][$ValCustom['num_column']][$m] = $ValCustom;
                        $tabLinesType[$kButton][$ValCustom['num_ligne']][$ValCustom['num_column']][$m] = 'custom';
                        $tabColumn[$kButton][$ValCustom['num_ligne']] = $ValCustom['num_column'];
                        $tabColumnOrder[$kButton][$ValCustom['num_column']][$ValCustom['num_ligne']] = $ValCustom['num_ligne'];
                        $tabColumnDatas[$kButton][$ValCustom['num_column']][$ValCustom['num_ligne']][$m] = $ValCustom;
                        $tabColumnType[$kButton][$ValCustom['num_column']][$ValCustom['num_ligne']][$m] = 'custom';
                        $m++;
                        $MaxCols < $ValCustom['num_column'] * 1 ? $MaxCols = $ValCustom['num_column'] : false;
                        $MaxLines < $ValCustom['num_ligne'] * 1 ? $MaxLines = $ValCustom['num_ligne'] : false;
                    }
                }
                if (array_key_exists($kButton, $tabLines)) {
                    if (sizeof($tabLines[$kButton])) {
                        $this->_menu .= '<div class="sub" style="width: ' . ($MDParameters[0]['MenuWidth'] - 2) . 'px;  background-color: #' . $ValButton['buttonColor'] . '; ' . ($ValButton['img_name_background'] != "" ? 'background-image: url(' . $this->_path . 'views/img/menu/' . $ValButton['img_name_background'] . '); background-repeat:no-repeat; background-position:top left; ' : false) . ' ">' . $this->eol;
                        $this->_menu .= '<table class="megaDrownTable" cellpadding="0" cellspacing="0" width="100%">';
                        if ($MDParameters[0]['stateTR1'] == "on") {
                            $this->_menu .= '<tr style="height:' . $MDParameters[0]['heightTR1'] . 'px">';
                            $MDParameters[0]['stateTD1'] == "on" ? $nbColspan = 2 : ($nbColspan = 1);
                            $this->_menu .= '<td class="megaDrownTR1" valign="top" colspan="' . $nbColspan . '">' . $this->eol;
                            $this->_menu .= $ValButton['detailSubTR'] == "" ? "&nbsp;" : html_entity_decode($ValButton['detailSubTR']);
                            $this->_menu .= '</td>';
                            $this->_menu .= '<td rowspan="2" class="megaDrownTD3" valign="top" style="width:' . $MDParameters[0]['widthTD3'] . 'px">' . ($ValButton['detailSub'] == "" ? "&nbsp;" : html_entity_decode($ValButton['detailSub'])) . '</td>' . $this->eol;
                            $this->_menu .= '</tr>';
                        }
                        $this->_menu .= '<tr>';
                        if ($MDParameters[0]['stateTD1'] == "on") {
                            $this->_menu .= '<td class="megaDrownTD1" valign="top" style="width:' . $MDParameters[0]['widthTD1'] . 'px">' . $this->eol;
                            if ($ValButton['img_name'] != '') {
                                if ($ValButton['img_link'] != '') {
                                    $this->_menu .= '<a href="' . urldecode($ValButton['img_link']) . '" style="float:none; margin:0; padding:0">';
                                }
                                $this->_menu .= '<img src="' . $this->_path . 'views/img/menu/' . $ValButton['img_name'] . '" style="border:0px" alt="' . $ValButton['img_name'] . '"/>' . $this->eol;
                                if ($ValButton['img_link'] != '') {
                                    $this->_menu .= '</a>';
                                }
                            }
                            $this->_menu .= '<br />' . html_entity_decode($ValButton['detailSubLeft']) . '</td>';
                        }
                        $this->_menu .= '<td class="megaDrownTD2" valign="top">' . $this->eol;
                        $this->_menu .= '<table class="MegaEvoLinks" style="border:0px">' . $this->eol;
                        $this->_menu .= '<tr>' . $this->eol;
                        for ($c = 1; $c <= $MaxCols; $c++) {
                            $this->_menu .= '<td valign="top" class="col' . $c . '">' . $this->eol;
                            for ($l = 1; $l <= $MaxLines; $l++) {
                                if (array_key_exists($c, $tabColumnDatas[$kButton])) {
                                    if (array_key_exists($l, $tabColumnDatas[$kButton][$c])) {
                                        if (sizeof(@$tabColumnDatas[$kButton][$c][$l])) {
                                            $this->_menu .= '<table border="0" style="width:' . $MDParameters[0]['columnSize'] . 'px">' . $this->eol;
                                            foreach ($tabColumnDatas[$kButton][$c][$l] as $keyMenu => $ValMenu) {
                                                $this->_menu .= '<tr>' . $this->eol;
                                                $this->_menu .= '<td style="width:' . $MDParameters[0]['columnSize'] . 'px" class="ligne' . $l . '">' . $this->eol;
                                                switch ($tabColumnType[$kButton][$c][$l][$keyMenu]) {
                                                    case 'category':
                                                        $category = new Category((int) $ValMenu['id_link_cat']);
                                                        if (!$category->checkAccess($this->context->customer->id)) {
                                                            break;
                                                        } else {
                                                            $this->_menu .= '<ul>' . $this->eol;
                                                            $NameCategory = $this->getNameCategory($ValMenu['id_link_cat'], $this->context->cookie->id_lang, $ValButton['id_button']);
                                                            $NameSubstitute = $this->getNameSubstitute($ValMenu['id_link_cat'], $this->context->cookie->id_lang, $ValButton['id_button']);
                                                            $Category = new Category(intval($ValMenu['id_link_cat']), intval($this->context->cookie->id_lang));
                                                            $rewrited_url = $this->link->getCategoryLink($ValMenu['id_link_cat'], $Category->link_rewrite);
                                                            $this->_menu .= '	<li class="stitle">
																						<a href="' . $rewrited_url . '" style="text-align:left">' . (trim($NameSubstitute[0]['name_substitute']) != '' ? $NameSubstitute[0]['name_substitute'] : $NameCategory[0]['name']) . '</a>
																					</li>' . $this->eol;
                                                            if ($ValMenu['view_products'] != 'on') {
                                                                $NameCategoryUnder = array();
                                                                $NameCategoryUnder = $this->getNameCategoryUnder($ValMenu['id_link_cat'], $ValButton['id_button']);
                                                                if (sizeof($NameCategoryUnder)) {
                                                                    foreach ($NameCategoryUnder as $KUnderCat => $ValUnderCat) {
                                                                        $Category = new Category(intval($ValUnderCat['id_category']), intval($this->context->cookie->id_lang));
                                                                        if ($Category->checkAccess($this->context->customer->id)) {
                                                                            $rewrited_url = $this->link->getCategoryLink($ValUnderCat['id_category'], $Category->link_rewrite);
                                                                            $NameCategoryUnder = $this->getNameCategory($ValUnderCat['id_category'], $this->context->cookie->id_lang, $ValButton['id_button']);
                                                                            $NameSubstitute = $this->getNameSubstitute($ValUnderCat['id_category'], $this->context->cookie->id_lang, $ValButton['id_button']);
                                                                            $this->_menu .= '	<li>
																										<a href="' . $rewrited_url . '" style="text-align:left">' . (trim($NameSubstitute[0]['name_substitute']) != '' ? $NameSubstitute[0]['name_substitute'] : $NameCategoryUnder[0]['name']) . '
																										</a>
																									</li>' . $this->eol;
                                                                        }
                                                                    }
                                                                }
                                                            } else {
                                                                $NameProductsUnder = array();
                                                                $NameProductsUnder = $this->getProductsUnder($ValMenu['id_link_cat'], $this->context->cookie->id_lang, $this->context->shop->id);
                                                                if (sizeof($NameProductsUnder)) {
                                                                    foreach ($NameProductsUnder as $KUnderProd => $ValUnderProd) {
                                                                        $Products = new Product(intval($ValUnderProd['id_product']), true, intval($this->context->cookie->id_lang));
                                                                        $rewrited_url = $Products->getLink();
                                                                        $NameProduct = $Products->name;
                                                                        $this->_menu .= '<li><a href="' . $rewrited_url . '" style="text-align:left">' . (strlen($NameProduct) > 20 ? substr($NameProduct, 0, 40) . "..." : $NameProduct) . '</a></li>' . $this->eol;
                                                                    }
                                                                }
                                                            }
                                                            $this->_menu .= '</ul>' . $this->eol;
                                                        }
                                                        break;
                                                    case 'custom':
                                                        $this->_menu .= '<ul>' . $this->eol;
                                                        $this->_menu .= '<li class="stitle"><a href="' . $ValMenu['link'] . '" ' . ($ValMenu['link'] == "#" || $ValMenu['link'] == "" ? "onclick='return false'" : false) . ' style="text-align:left">' . $ValMenu['name_menu'] . '</a></li>' . $this->eol;
                                                        $NameLinkUnder = array();
                                                        $NameLinkUnder = $this->getButtonLinksCustomUnder($ValButton['id_button'], $ValMenu['id_custom'], $this->context->cookie->id_lang);
                                                        if (sizeof($NameLinkUnder)) {
                                                            foreach ($NameLinkUnder as $KUnderLink => $ValUnderLink) {
                                                                $this->_menu .= '<li><a href="' . $ValUnderLink['link'] . '" ' . ($ValUnderLink['link'] == "#" || $ValUnderLink['link'] == "" ? "onclick='return false'" : false) . ' style="text-align:left">' . $ValUnderLink['name_menu'] . '</a></li>' . $this->eol;
                                                            }
                                                        }
                                                        $this->_menu .= '</ul>' . $this->eol;
                                                        break;
                                                }
                                                $this->_menu .= '</td>' . $this->eol;
                                                $this->_menu .= '</tr>' . $this->eol;
                                            }
                                            $this->_menu .= '</table>' . $this->eol;
                                        }
                                    }
                                }
                            }
                            $this->_menu .= '</td>' . $this->eol;
                        }
                        $this->_menu .= '</tr>' . $this->eol;
                        $this->_menu .= '</table>' . $this->eol;
                        $this->_menu .= '</td>' . $this->eol;
                        //Colonne droite;
                        if ($MDParameters[0]['stateTD3'] == "on" && $MDParameters[0]['stateTR1'] != "on") {
                            $this->_menu .= '<td class="megaDrownTD3" valign="top" style="width:' . $MDParameters[0]['widthTD3'] . 'px">' . ($ValButton['detailSub'] == "" ? "&nbsp;" : html_entity_decode($ValButton['detailSub'])) . '</td>' . $this->eol;
                        }
                        $this->_menu .= '</tr></table></div>' . $this->eol;
                    }
                }
                $this->_menu .= '</li>' . $this->eol;
                $b++;
            }
        }
    }