Produced by Araxis Merge on 2021-05-13 09:08:40 +0000. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.
| # | Location | File | Last Modified |
|---|---|---|---|
| 1 | /Applications/Ampps/www/Porto 3.2.2/Theme Files/Magento 2.x/Porto Theme/app/code/Smartwave/Megamenu/Block | Topmenu.php | 2018-06-17 02:12:26 +0000 |
| 2 | /Applications/Ampps/www/Porto v4.0.0/Theme Files/Magento 2.x/Porto Theme/app/code/Smartwave/Megamenu/Block | Topmenu.php | 2021-01-11 04:30:08 +0000 |
| Description | Between Files 1 and 2 | |
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 41 | 500 |
| Changed | 40 | 80 |
| Inserted | 0 | 0 |
| Removed | 0 | 0 |
| Whitespace | Consecutive whitespace is treated as a single space |
|---|---|
| Character case | Differences in character case are significant |
| Line endings | Differences in line endings (CR and LF characters) are ignored |
| CR/LF characters | Not shown in the comparison detail |
| Active line-pairing rules |
No regular expressions were active.
| 1 | <?php | 1 | <?php | |||
| 2 | namespace Smartwave\Megamenu\Block; | 2 | namespace Smartwave\Megamenu\Block; | |||
| 3 | 3 | |||||
| 4 | class Topmenu extends \Magento\Framework\View\Element\Template | 4 | class Topmenu extends \Magento\Framework\View\Element\Template | |||
| 5 | { | 5 | { | |||
| 6 | 6 | |||||
| 7 | protected $_categoryHelper; | 7 | protected $_categoryHelper; | |||
| 8 | protected $_categoryFlatConfig; | 8 | protected $_categoryFlatConfig; | |||
| 9 | protected $_topMenu; | 9 | protected $_topMenu; | |||
| 10 | protected $_categoryFactory; | 10 | protected $_categoryFactory; | |||
| 11 | protected $_helper; | 11 | protected $_helper; | |||
| 12 | protected $_filterProvider; | 12 | protected $_filterProvider; | |||
| 13 | protected $_blockFactory; | 13 | protected $_blockFactory; | |||
| 14 | protected $_megamenuConfig; | 14 | protected $_megamenuConfig; | |||
| 15 | protected $_storeManager; | 15 | protected $_storeManager; | |||
| 16 | 16 | |||||
| 17 | public function __construct( | 17 | public function __construct( | |||
| 18 | \Magento\Framework\View\Element\Template\Context $context, | 18 | \Magento\Framework\View\Element\Template\Context $context, | |||
| 19 | \Magento\Catalog\Helper\Category $categoryHelper, | 19 | \Magento\Catalog\Helper\Category $categoryHelper, | |||
| 20 | \Smartwave\Megamenu\Helper\Data $helper, | 20 | \Smartwave\Megamenu\Helper\Data $helper, | |||
| 21 | \Magento\Catalog\Model\Indexer\Category\Flat\State $categoryFlatState, | 21 | \Magento\Catalog\Model\Indexer\Category\Flat\State $categoryFlatState, | |||
| 22 | \Magento\Catalog\Model\CategoryFactory $categoryFactory, | 22 | \Magento\Catalog\Model\CategoryFactory $categoryFactory, | |||
| 23 | \Magento\Theme\Block\Html\Topmenu $topMenu, | 23 | \Magento\Theme\Block\Html\Topmenu $topMenu, | |||
| 24 | \Magento\Cms\Model\Template\FilterProvider $filterProvider, | 24 | \Magento\Cms\Model\Template\FilterProvider $filterProvider, | |||
| 25 | \Magento\Cms\Model\BlockFactory $blockFactory | 25 | \Magento\Cms\Model\BlockFactory $blockFactory | |||
| 26 | ) { | 26 | ) { | |||
| 27 | 27 | |||||
| 28 | $this->_categoryHelper = $categoryHelper; | 28 | $this->_categoryHelper = $categoryHelper; | |||
| 29 | $this->_categoryFlatConfig = $categoryFlatState; | 29 | $this->_categoryFlatConfig = $categoryFlatState; | |||
| 30 | $this->_categoryFactory = $categoryFactory; | 30 | $this->_categoryFactory = $categoryFactory; | |||
| 31 | $this->_topMenu = $topMenu; | 31 | $this->_topMenu = $topMenu; | |||
| 32 | $this->_helper = $helper; | 32 | $this->_helper = $helper; | |||
| 33 | $this->_filterProvider = $filterProvider; | 33 | $this->_filterProvider = $filterProvider; | |||
| 34 | $this->_blockFactory = $blockFactory; | 34 | $this->_blockFactory = $blockFactory; | |||
| 35 | $this->_storeManager = $context->getStoreManager(); | 35 | $this->_storeManager = $context->getStoreManager(); | |||
| 36 | 36 | |||||
| 37 | parent::__construct($context); | 37 | parent::__construct($context); | |||
| 38 | } | 38 | } | |||
| 39 | 39 | |||||
| 40 | public function getCategoryHelper() | 40 | public function getCategoryHelper() | |||
| 41 | { | 41 | { | |||
| 42 | return $this->_categoryHelper; | 42 | return $this->_categoryHelper; | |||
| 43 | } | 43 | } | |||
| 44 | 44 | |||||
| 45 | public function getCategoryModel($id) | 45 | public function getCategoryModel($id) | |||
| 46 | { | 46 | { | |||
| 47 | $_category = $this->_categoryFactory->create(); | 47 | $_category = $this->_categoryFactory->create(); | |||
| 48 | $_category->load($id); | 48 | $_category->load($id); | |||
| 49 | 49 | |||||
| 50 | return $_category; | 50 | return $_category; | |||
| 51 | } | 51 | } | |||
| 52 | 52 | |||||
| 53 | public function getHtml($outermostClass = '', $childrenWrapClass = '', $limit = 0) | 53 | public function getHtml($outermostClass = '', $childrenWrapClass = '', $limit = 0) | |||
| 54 | { | 54 | { | |||
| 55 | return $this->_topMenu->getHtml($outermostClass, $childrenWrapClass, $limit); | 55 | return $this->_topMenu->getHtml($outermostClass, $childrenWrapClass, $limit); | |||
| 56 | } | 56 | } | |||
| 57 | 57 | |||||
| 58 | public function getStoreCategories($sorted = false, $asCollection = false, $toLoad = true) | 58 | public function getStoreCategories($sorted = false, $asCollection = false, $toLoad = true) | |||
| 59 | { | 59 | { | |||
| 60 | return $this->_categoryHelper->getStoreCategories($sorted , $asCollection, $toLoad); | 60 | return $this->_categoryHelper->getStoreCategories($sorted , $asCollection, $toLoad); | |||
| 61 | } | 61 | } | |||
| 62 | 62 | |||||
| 63 | public function getChildCategories($category) | 63 | public function getChildCategories($category) | |||
| 64 | { | 64 | { | |||
| 65 | if ($this->_categoryFlatConfig->isFlatEnabled() && $category->getUseFlatResource()) { | 65 | if ($this->_categoryFlatConfig->isFlatEnabled() && $category->getUseFlatResource()) { | |||
| 66 | $subcategories = (array)$category->getChildrenNodes(); | 66 | $subcategories = (array)$category->getChildrenNodes(); | |||
| 67 | } else { | 67 | } else { | |||
| 68 | $subcategories = $category->getChildren(); | 68 | $subcategories = $category->getChildren(); | |||
| 69 | } | 69 | } | |||
| 70 | 70 | |||||
| 71 | return $subcategories; | 71 | return $subcategories; | |||
| 72 | } | 72 | } | |||
| 73 | 73 | |||||
| 74 | public function getActiveChildCategories($category) | 74 | public function getActiveChildCategories($category) | |||
| 75 | { | 75 | { | |||
| 76 | $children = []; | 76 | $children = []; | |||
| 77 | if ($this->_categoryFlatConfig->isFlatEnabled() && $category->getUseFlatResource()) { | 77 | if ($this->_categoryFlatConfig->isFlatEnabled() && $category->getUseFlatResource()) { | |||
| 78 | $subcategories = (array)$category->getChildrenNodes(); | 78 | $subcategories = (array)$category->getChildrenNodes(); | |||
| 79 | } else { | 79 | } else { | |||
| 80 | $subcategories = $category->getChildren(); | 80 | $subcategories = $category->getChildren(); | |||
| 81 | } | 81 | } | |||
| 82 | foreach($subcategories as $category) { | 82 | foreach($subcategories as $category) { | |||
| 83 | if (!$category->getIsActive()) { | 83 | if (!$category->getIsActive()) { | |||
| 84 | continue; | 84 | continue; | |||
| 85 | } | 85 | } | |||
| 86 | $children[] = $category; | 86 | $children[] = $category; | |||
| 87 | } | 87 | } | |||
| 88 | return $children; | 88 | return $children; | |||
| 89 | } | 89 | } | |||
| 90 | 90 | |||||
| 91 | public function getBlockContent($content = '') { | 91 | public function getBlockContent($content = '') { | |||
| 92 | if(!$this->_filterProvider) | 92 | if(!$this->_filterProvider) | |||
| 93 | return $content; | 93 | return $content; | |||
| 94 | return $this->_filterProvider->getBlockFilter()->filter(trim($content)); | 94 | return $this->_filterProvider->getBlockFilter()->filter(trim($content)); | |||
| 95 | } | 95 | } | |||
| 96 | 96 | |||||
| 97 | public function getCustomBlockHtml($type='after') { | 97 | public function getCustomBlockHtml($type='after') { | |||
| 98 | $html = ''; | 98 | $html = ''; | |||
| 99 | 99 | |||||
| 100 | $block_ids = $this->_megamenuConfig['custom_links']['staticblock_'.$type]; | 100 | $block_ids = $this->_megamenuConfig['custom_links']['staticblock_'.$type]; | |||
| 101 | 101 | |||||
| 102 | if (!$block_ids) return ''; | 102 | if (!$block_ids) return ''; | |||
| 103 | 103 | |||||
| 104 | $block_ids = preg_replace('/\s/', '', $block_ids); | 104 | $block_ids = preg_replace('/\s/', '', $block_ids); | |||
| 105 | $ids = explode(',', $block_ids); | 105 | $ids = explode(',', $block_ids); | |||
| 106 | $store_id = $this->_storeManager->getStore()->getId(); | 106 | $store_id = $this->_storeManager->getStore()->getId(); | |||
| 107 | 107 | |||||
| 108 | foreach($ids as $block_id) { | 108 | foreach($ids as $block_id) { | |||
| 109 | $block = $this->_blockFactory->create(); | 109 | $block = $this->_blockFactory->create(); | |||
| 110 | $block->setStoreId($store_id)->load($block_id); | 110 | $block->setStoreId($store_id)->load($block_id); | |||
| 111 | 111 | |||||
| 112 | if(!$block) continue; | 112 | if(!$block) continue; | |||
| 113 | 113 | |||||
| 114 | $block_content = $block->getContent(); | 114 | $block_content = $block->getContent(); | |||
| 115 | 115 | |||||
| 116 | if(!$block_content) continue; | 116 | if(!$block_content) continue; | |||
| 117 | 117 | |||||
| 118 | $content = $this->_filterProvider->getBlockFilter()->setStoreId($store_id)->filter($block_content); | 118 | $content = $this->_filterProvider->getBlockFilter()->setStoreId($store_id)->filter($block_content); | |||
| 119 | if(substr($content, 0, 4) == '<ul>') | 119 | if(substr($content, 0, 4) == '<ul>') | |||
| 120 | $content = substr($content, 4); | 120 | $content = substr($content, 4); | |||
| 121 | if(substr($content, strlen($content) - 5) == '</ul>') | 121 | if(substr($content, strlen($content) - 5) == '</ul>') | |||
| 122 | $content = substr($content, 0, -5); | 122 | $content = substr($content, 0, -5); | |||
| 123 | 123 | |||||
| 124 | $html .= $content; | 124 | $html .= $content; | |||
| 125 | } | 125 | } | |||
| 126 | 126 | |||||
| 127 | return $html; | 127 | return $html; | |||
| 128 | } | 128 | } | |||
| 129 | public function getSubmenuItemsHtml($children, $level = 1, $max_level = 0, $column_width=12, $menu_type = 'fullwidth', $columns = null) | 129 | public function getSubmenuItemsHtml($children, $level = 1, $max_level = 0, $column_width=12, $menu_type = 'fullwidth', $columns = null) | |||
| 130 | { | 130 | { | |||
| 131 | $html = ''; | 131 | $html = ''; | |||
| 132 | 132 | |||||
| 133 | if(!$max_level || ($max_level && $max_level == 0) || ($max_level && $max_level > 0 && $max_level-1 >= $level)) { | 133 | if(!$max_level || ($max_level && $max_level == 0) || ($max_level && $max_level > 0 && $max_level-1 >= $level)) { | |||
| 134 | $column_class = ""; | 134 | $column_class = ""; | |||
| 135 | if($level == 1 && $columns && ($menu_type == 'fullwidth' || $menu_type == 'staticwidth')) { | 135 | if($level == 1 && $columns && ($menu_type == 'fullwidth' || $menu_type == 'staticwidth')) { | |||
| 136 | $column_class = "col-md-".$column_width." "; | 136 | $column_class = "col-md-".$column_width." "; | |||
| 137 | $column_class .= "mega-columns columns".$columns; | 137 | $column_class .= "mega-columns columns".$columns; | |||
| 138 | } | 138 | } | |||
| 139 | $html = '<ul class="subchildmenu '.$column_class.'">'; | 139 | $html = '<ul class="subchildmenu '.$column_class.'">'; | |||
| 140 | foreach($children as $child) { | 140 | foreach($children as $child) { | |||
| 141 | $cat_model = $this->getCategoryModel($child->getId()); | 141 | $cat_model = $this->getCategoryModel($child->getId()); | |||
| 142 | 142 | |||||
| 143 | $sw_menu_hide_item = $cat_model->getData('sw_menu_hide_item'); | 143 | $sw_menu_hide_item = $cat_model->getData('sw_menu_hide_item'); | |||
| 144 | 144 | |||||
| 145 | if (!$sw_menu_hide_item) { | 145 | if (!$sw_menu_hide_item) { | |||
| 146 | $sub_children = $this->getActiveChildCategories($child); | 146 | $sub_children = $this->getActiveChildCategories($child); | |||
| 147 | 147 | |||||
| 148 | $sw_menu_cat_label = $cat_model->getData('sw_menu_cat_label'); | 148 | $sw_menu_cat_label = $cat_model->getData('sw_menu_cat_label'); | |||
| 149 | $sw_menu_icon_img = $cat_model->getData('sw_menu_icon_img'); | 149 | $sw_menu_icon_img = $cat_model->getData('sw_menu_icon_img'); | |||
| 150 | $sw_menu_font_icon = $cat_model->getData('sw_menu_font_icon'); | 150 | $sw_menu_font_icon = $cat_model->getData('sw_menu_font_icon'); | |||
| 151 | 151 | |||||
| 152 | $item_class = 'level'.$level.' '; | 152 | $item_class = 'level'.$level.' '; | |||
| 153 | if(count($sub_children) > 0) | 153 | if(count($sub_children) > 0) | |||
| 154 | $item_class .= 'parent '; | 154 | $item_class .= 'parent '; | |||
| 155 | $html .= '<li class="ui-menu-item '.$item_class.'">'; | 155 | $html .= '<li class="ui-menu-item '.$item_class.'">'; | |||
| 156 | if(count($sub_children) > 0) { | 156 | if(count($sub_children) > 0) { | |||
| 157 | $html .= '<div class="open-children-toggle"></div>'; | 157 | $html .= '<div class="open-children-toggle"></div>'; | |||
| 158 | } | 158 | } | |||
| 159 | if($level == 1 && $sw_menu_icon_img) { | 159 | if($level == 1 && $sw_menu_icon_img) { | |||
| 160 | $html .= '<div class="menu-thumb-img"><a class="menu-thumb-link" href="'.$this->_categoryHelper->getCategoryUrl($child).'"><img src="' . $this->_helper->getBaseUrl().'catalog/category/' . $sw_menu_icon_img . '" alt="'.$child->getName().'"/></a></div>'; | 160 | $html .= '<div class="menu-thumb-img"><a class="menu-thumb-link" href="'.$this->_categoryHelper->getCategoryUrl($child).'"><img src="' . $this->_helper->getBaseUrl().' | |||
| 161 | } | 161 | } | |||
| 162 | $html .= '<a href="'.$this->_categoryHelper->getCategoryUrl($child).'" title="'.$child->getName().'">'; | 162 | $html .= '<a href="'.$this->_categoryHelper->getCategoryUrl($child).'" title="'.$child->getName().'">'; | |||
| 163 | if ($level > 1 && $sw_menu_icon_img) | 163 | if ($level > 1 && $sw_menu_icon_img) | |||
| 164 | $html .= '<img class="menu-thumb-icon" src="' . $this->_helper->getBaseUrl().'catalog/category/' . $sw_menu_icon_img . '" alt="'.$child->getName().'"/>'; | 164 | $html .= '<img class="menu-thumb-icon" src="' . $this->_helper->getBaseUrl().' | |||
| 165 | elseif($sw_menu_font_icon) | 165 | elseif($sw_menu_font_icon) | |||
| 166 | $html .= '<em class="menu-thumb-icon '.$sw_menu_font_icon.'"></em>'; | 166 | $html .= '<em class="menu-thumb-icon '.$sw_menu_font_icon.'"></em>'; | |||
| 167 | $html .= '<span>'.$child->getName(); | 167 | $html .= '<span>'.$child->getName(); | |||
| 168 | if($sw_menu_cat_label) | 168 | if($sw_menu_cat_label) | |||
| 169 | $html .= '<span class="cat-label cat-label-'.$sw_menu_cat_label.'">'.$this->_megamenuConfig['cat_labels'][$sw_menu_cat_label].'</span>'; | 169 | $html .= '<span class="cat-label cat-label-'.$sw_menu_cat_label.'">'.$this->_megamenuConfig['cat_labels'][$sw_menu_cat_label].'</span>'; | |||
| 170 | $html .= '</span></a>'; | 170 | $html .= '</span></a>'; | |||
| 171 | if(count($sub_children) > 0) { | 171 | if(count($sub_children) > 0) { | |||
| 172 | $html .= $this->getSubmenuItemsHtml($sub_children, $level+1, $max_level, $column_width, $menu_type); | 172 | $html .= $this->getSubmenuItemsHtml($sub_children, $level+1, $max_level, $column_width, $menu_type); | |||
| 173 | } | 173 | } | |||
| 174 | $html .= '</li>'; | 174 | $html .= '</li>'; | |||
| 175 | } | 175 | } | |||
| 176 | } | 176 | } | |||
| 177 | $html .= '</ul>'; | 177 | $html .= '</ul>'; | |||
| 178 | } | 178 | } | |||
| 179 | 179 | |||||
| 180 | return $html; | 180 | return $html; | |||
| 181 | } | 181 | } | |||
| 182 | 182 | |||||
| 183 | public function getMegamenuHtml() | 183 | public function getMegamenuHtml() | |||
| 184 | { | 184 | { | |||
| 185 | $html = ''; | 185 | $html = ''; | |||
| 186 | 186 | |||||
| 187 | $categories = $this->getStoreCategories(true,false,true); | 187 | $categories = $this->getStoreCategories(true,false,true); | |||
| 188 | 188 | |||||
| 189 | $this->_megamenuConfig = $this->_helper->getConfig('sw_megamenu'); | 189 | $this->_megamenuConfig = $this->_helper->getConfig('sw_megamenu'); | |||
| 190 | 190 | |||||
| 191 | $max_level = $this->_megamenuConfig['general']['max_level']; | 191 | $max_level = $this->_megamenuConfig['general']['max_level']; | |||
| 192 | $html .= $this->getCustomBlockHtml('before'); | 192 | $html .= $this->getCustomBlockHtml('before'); | |||
| 193 | foreach($categories as $category) { | 193 | foreach($categories as $category) { | |||
| 194 | if (!$category->getIsActive()) { | 194 | if (!$category->getIsActive()) { | |||
| 195 | continue; | 195 | continue; | |||
| 196 | } | 196 | } | |||
| 197 | 197 | |||||
| 198 | $cat_model = $this->getCategoryModel($category->getId()); | 198 | $cat_model = $this->getCategoryModel($category->getId()); | |||
| 199 | 199 | |||||
| 200 | $sw_menu_hide_item = $cat_model->getData('sw_menu_hide_item'); | 200 | $sw_menu_hide_item = $cat_model->getData('sw_menu_hide_item'); | |||
| 201 | 201 | |||||
| 202 | if(!$sw_menu_hide_item) { | 202 | if(!$sw_menu_hide_item) { | |||
| 203 | $children = $this->getActiveChildCategories($category); | 203 | $children = $this->getActiveChildCategories($category); | |||
| 204 | $sw_menu_cat_label = $cat_model->getData('sw_menu_cat_label'); | 204 | $sw_menu_cat_label = $cat_model->getData('sw_menu_cat_label'); | |||
| 205 | $sw_menu_icon_img = $cat_model->getData('sw_menu_icon_img'); | 205 | $sw_menu_icon_img = $cat_model->getData('sw_menu_icon_img'); | |||
| 206 | $sw_menu_font_icon = $cat_model->getData('sw_menu_font_icon'); | 206 | $sw_menu_font_icon = $cat_model->getData('sw_menu_font_icon'); | |||
| 207 | $sw_menu_cat_columns = $cat_model->getData('sw_menu_cat_columns'); | 207 | $sw_menu_cat_columns = $cat_model->getData('sw_menu_cat_columns'); | |||
| 208 | $sw_menu_float_type = $cat_model->getData('sw_menu_float_type'); | 208 | $sw_menu_float_type = $cat_model->getData('sw_menu_float_type'); | |||
| 209 | 209 | |||||
| 210 | if(!$sw_menu_cat_columns){ | 210 | if(!$sw_menu_cat_columns){ | |||
| 211 | $sw_menu_cat_columns = 4; | 211 | $sw_menu_cat_columns = 4; | |||
| 212 | } | 212 | } | |||
| 213 | 213 | |||||
| 214 | $menu_type = $cat_model->getData('sw_menu_type'); | 214 | $menu_type = $cat_model->getData('sw_menu_type'); | |||
| 215 | if(!$menu_type) | 215 | if(!$menu_type) | |||
| 216 | $menu_type = $this->_megamenuConfig['general']['menu_type']; | 216 | $menu_type = $this->_megamenuConfig['general']['menu_type']; | |||
| 217 | 217 | |||||
| 218 | $custom_style = ''; | 218 | $custom_style = ''; | |||
| 219 | if($menu_type=="staticwidth") | 219 | if($menu_type=="staticwidth") | |||
| 220 | $custom_style = ' style="width: 500px;"'; | 220 | $custom_style = ' style="width: 500px;"'; | |||
| 221 | 221 | |||||
| 222 | $sw_menu_static_width = $cat_model->getData('sw_menu_static_width'); | 222 | $sw_menu_static_width = $cat_model->getData('sw_menu_static_width'); | |||
| 223 | if($menu_type=="staticwidth" && $sw_menu_static_width) | 223 | if($menu_type=="staticwidth" && $sw_menu_static_width) | |||
| 224 | $custom_style = ' style="width: '.$sw_menu_static_width.';"'; | 224 | $custom_style = ' style="width: '.$sw_menu_static_width.';"'; | |||
| 225 | 225 | |||||
| 226 | $item_class = 'level0 '; | 226 | $item_class = 'level0 '; | |||
| 227 | $item_class .= $menu_type.' '; | 227 | $item_class .= $menu_type.' '; | |||
| 228 | 228 | |||||
| 229 | $menu_top_content = $cat_model->getData('sw_menu_block_top_content'); | 229 | $menu_top_content = $cat_model->getData('sw_menu_block_top_content'); | |||
| 230 | $menu_left_content = $cat_model->getData('sw_menu_block_left_content'); | 230 | $menu_left_content = $cat_model->getData('sw_menu_block_left_content'); | |||
| 231 | $menu_left_width = $cat_model->getData('sw_menu_block_left_width'); | 231 | $menu_left_width = $cat_model->getData('sw_menu_block_left_width'); | |||
| 232 | if(!$menu_left_content || !$menu_left_width) | 232 | if(!$menu_left_content || !$menu_left_width) | |||
| 233 | $menu_left_width = 0; | 233 | $menu_left_width = 0; | |||
| 234 | $menu_right_content = $cat_model->getData('sw_menu_block_right_content'); | 234 | $menu_right_content = $cat_model->getData('sw_menu_block_right_content'); | |||
| 235 | $menu_right_width = $cat_model->getData('sw_menu_block_right_width'); | 235 | $menu_right_width = $cat_model->getData('sw_menu_block_right_width'); | |||
| 236 | if(!$menu_right_content || !$menu_right_width) | 236 | if(!$menu_right_content || !$menu_right_width) | |||
| 237 | $menu_right_width = 0; | 237 | $menu_right_width = 0; | |||
| 238 | $menu_bottom_content = $cat_model->getData('sw_menu_block_bottom_content'); | 238 | $menu_bottom_content = $cat_model->getData('sw_menu_block_bottom_content'); | |||
| 239 | if($sw_menu_float_type) | 239 | if($sw_menu_float_type) | |||
| 240 | $sw_menu_float_type = 'fl-'.$sw_menu_float_type.' '; | 240 | $sw_menu_float_type = 'fl-'.$sw_menu_float_type.' '; | |||
| 241 | if(count($children) > 0 || (($menu_type=="fullwidth" || $menu_type=="staticwidth") && ($menu_top_content || $menu_left_content || $menu_right_content || $menu_bottom_content))) | 241 | if(count($children) > 0 || (($menu_type=="fullwidth" || $menu_type=="staticwidth") && ($menu_top_content || $menu_left_content || $menu_right_content || $menu_bottom_content))) | |||
| 242 | $item_class .= 'parent '; | 242 | $item_class .= 'parent '; | |||
| 243 | $html .= '<li class="ui-menu-item '.$item_class.$sw_menu_float_type.'">'; | 243 | $html .= '<li class="ui-menu-item '.$item_class.$sw_menu_float_type.'">'; | |||
| 244 | if(count($children) > 0) { | 244 | if(count($children) > 0) { | |||
| 245 | $html .= '<div class="open-children-toggle"></div>'; | 245 | $html .= '<div class="open-children-toggle"></div>'; | |||
| 246 | } | 246 | } | |||
| 247 | $html .= '<a href="'.$this->_categoryHelper->getCategoryUrl($category).'" class="level-top" title="'.$category->getName().'">'; | 247 | $html .= '<a href="'.$this->_categoryHelper->getCategoryUrl($category).'" class="level-top" title="'.$category->getName().'">'; | |||
| 248 | if ($sw_menu_icon_img) | 248 | if ($sw_menu_icon_img) | |||
| 249 | $html .= '<img class="menu-thumb-icon" src="' . $this->_helper->getBaseUrl().'catalog/category/' . $sw_menu_icon_img . '" alt="'.$category->getName().'"/>'; | 249 | $html .= '<img class="menu-thumb-icon" src="' . $this->_helper->getBaseUrl().' | |||
| 250 | elseif($sw_menu_font_icon) | 250 | elseif($sw_menu_font_icon) | |||
| 251 | $html .= '<em class="menu-thumb-icon '.$sw_menu_font_icon.'"></em>'; | 251 | $html .= '<em class="menu-thumb-icon '.$sw_menu_font_icon.'"></em>'; | |||
| 252 | $html .= '<span>'.$category->getName().'</span>'; | 252 | $html .= '<span>'.$category->getName().'</span>'; | |||
| 253 | if($sw_menu_cat_label) | 253 | if($sw_menu_cat_label) | |||
| 254 | $html .= '<span class="cat-label cat-label-'.$sw_menu_cat_label.'">'.$this->_megamenuConfig['cat_labels'][$sw_menu_cat_label].'</span>'; | 254 | $html .= '<span class="cat-label cat-label-'.$sw_menu_cat_label.'">'.$this->_megamenuConfig['cat_labels'][$sw_menu_cat_label].'</span>'; | |||
| 255 | $html .= '</a>'; | 255 | $html .= '</a>'; | |||
| 256 | if(count($children) > 0 || (($menu_type=="fullwidth" || $menu_type=="staticwidth") && ($menu_top_content || $menu_left_content || $menu_right_content || $menu_bottom_content))) { | 256 | if(count($children) > 0 || (($menu_type=="fullwidth" || $menu_type=="staticwidth") && ($menu_top_content || $menu_left_content || $menu_right_content || $menu_bottom_content))) { | |||
| 257 | $html .= '<div class="level0 submenu"'.$custom_style.'>'; | 257 | $html .= '<div class="level0 submenu"'.$custom_style.'>'; | |||
| 258 | if(($menu_type=="fullwidth" || $menu_type=="staticwidth")) { | 258 | if(($menu_type=="fullwidth" || $menu_type=="staticwidth")) { | |||
| 259 | $html .= '<div class="container">'; | 259 | $html .= '<div class="container">'; | |||
| 260 | } | 260 | } | |||
| 261 | if(($menu_type=="fullwidth" || $menu_type=="staticwidth") && $menu_top_content) { | 261 | if(($menu_type=="fullwidth" || $menu_type=="staticwidth") && $menu_top_content) { | |||
| 262 | $html .= '<div class="menu-top-block">'.$this->getBlockContent($menu_top_content).'</div>'; | 262 | $html .= '<div class="menu-top-block">'.$this->getBlockContent($menu_top_content).'</div>'; | |||
| 263 | } | 263 | } | |||
| 264 | if(count($children) > 0 || (($menu_type=="fullwidth" || $menu_type=="staticwidth") && ($menu_left_content || $menu_right_content))) { | 264 | if(count($children) > 0 || (($menu_type=="fullwidth" || $menu_type=="staticwidth") && ($menu_left_content || $menu_right_content))) { | |||
| 265 | $html .= '<div class="row">'; | 265 | $html .= '<div class="row">'; | |||
| 266 | if(($menu_type=="fullwidth" || $menu_type=="staticwidth") && $menu_left_content && $menu_left_width > 0) { | 266 | if(($menu_type=="fullwidth" || $menu_type=="staticwidth") && $menu_left_content && $menu_left_width > 0) { | |||
| 267 | $html .= '<div class="menu-left-block col-md-'.$menu_left_width.'">'.$this->getBlockContent($menu_left_content).'</div>'; | 267 | $html .= '<div class="menu-left-block col-md-'.$menu_left_width.'">'.$this->getBlockContent($menu_left_content).'</div>'; | |||
| 268 | } | 268 | } | |||
| 269 | $html .= $this->getSubmenuItemsHtml($children, 1, $max_level, 12-$menu_left_width-$menu_right_width, $menu_type, $sw_menu_cat_columns); | 269 | $html .= $this->getSubmenuItemsHtml($children, 1, $max_level, 12-$menu_left_width-$menu_right_width, $menu_type, $sw_menu_cat_columns); | |||
| 270 | if(($menu_type=="fullwidth" || $menu_type=="staticwidth") && $menu_right_content && $menu_right_width > 0) { | 270 | if(($menu_type=="fullwidth" || $menu_type=="staticwidth") && $menu_right_content && $menu_right_width > 0) { | |||
| 271 | $html .= '<div class="menu-right-block col-md-'.$menu_right_width.'">'.$this->getBlockContent($menu_right_content).'</div>'; | 271 | $html .= '<div class="menu-right-block col-md-'.$menu_right_width.'">'.$this->getBlockContent($menu_right_content).'</div>'; | |||
| 272 | } | 272 | } | |||
| 273 | $html .= '</div>'; | 273 | $html .= '</div>'; | |||
| 274 | } | 274 | } | |||
| 275 | if(($menu_type=="fullwidth" || $menu_type=="staticwidth") && $menu_bottom_content) { | 275 | if(($menu_type=="fullwidth" || $menu_type=="staticwidth") && $menu_bottom_content) { | |||
| 276 | $html .= '<div class="menu-bottom-block">'.$this->getBlockContent($menu_bottom_content).'</div>'; | 276 | $html .= '<div class="menu-bottom-block">'.$this->getBlockContent($menu_bottom_content).'</div>'; | |||
| 277 | } | 277 | } | |||
| 278 | if(($menu_type=="fullwidth" || $menu_type=="staticwidth")) { | 278 | if(($menu_type=="fullwidth" || $menu_type=="staticwidth")) { | |||
| 279 | $html .= '</div>'; | 279 | $html .= '</div>'; | |||
| 280 | } | 280 | } | |||
| 281 | $html .= '</div>'; | 281 | $html .= '</div>'; | |||
| 282 | } | 282 | } | |||
| 283 | $html .= '</li>'; | 283 | $html .= '</li>'; | |||
| 284 | } | 284 | } | |||
| 285 | } | 285 | } | |||
| 286 | $html .= $this->getCustomBlockHtml('after'); | 286 | $html .= $this->getCustomBlockHtml('after'); | |||
| 287 | 287 | |||||
| 288 | return $html; | 288 | return $html; | |||
| 289 | } | 289 | } | |||
| 290 | } | 290 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993–2019 Araxis Ltd (www.araxis.com). All rights reserved.