// no direct access defined('_JEXEC') or die('Restricted access'); defined('DS') or define('DS', DIRECTORY_SEPARATOR); // Include the syndicate functions only once require_once dirname(__FILE__) . DS . 'helper.php'; $params->def('menutype', $params->get('menu', 'mainmenu')); $params->def('startLevel', 1); $params->def('endLevel', 0); $params->def('showAllChildren', 1); $params->set('column_width', (int) $params->get('column_width', 200)); $startLevel = $params->get('startLevel'); $endLevel = $params->get('endLevel'); $list = modDJMegaMenuHelper::getList($params); $subwidth = modDJMegaMenuHelper::getSubWidth($params); $subcols = modDJMegaMenuHelper::getSubCols($params); $active = modDJMegaMenuHelper::getActive($params); $active_id = $active->id; $path = $active->tree; $showAll = $params->get('showAllChildren'); $class_sfx = ($params->get('hasSubtitles') ? 'hasSubtitles ' : '') . htmlspecialchars($params->get('class_sfx')); if (!count($list)) { return; } $app = JFactory::getApplication(); $doc = JFactory::getDocument(); $direction = $doc->direction; $version = new JVersion(); $jquery = version_compare($version->getShortVersion(), '3.0.0', '>='); if ($jquery) { JHTML::_('jquery.framework'); } else {
$animSpeed = $params->get('animation_speed'); $open_event = $params->get('event', 'mouseenter'); $fixed = $params->get('fixed', 0); $fixed_offset = $params->get('fixed_offset', 0); $theme = $params->get('theme'); $options = json_encode(array('wrap' => $wrapper_id, 'animIn' => $animIn, 'animOut' => $animOut, 'animSpeed' => $animSpeed, 'delay' => $delay, 'event' => $open_event, 'fixed' => $fixed, 'offset' => $fixed_offset, 'theme' => $theme, 'direction' => $direction)); } $mobilemenu = (int) $params->get('select', 0); if ($mobilemenu) { $doc->addScript(JURI::root(true) . '/modules/mod_djmegamenu/assets/js/' . ($jquery ? 'jquery.' : '') . 'djmobilemenu.js', 'text/javascript', $canDefer); $doc->addStyleDeclaration("\n\t\t#dj-megamenu{$module->id}" . "mobile { display: none; }\n\t\t@media (max-width: " . (int) $params->get('width') . "px) {\n\t\t\t#dj-megamenu{$module->id}, #dj-megamenu{$module->id}" . "sticky, #dj-megamenu{$module->id}" . "placeholder { display: none; }\n\t\t\t#dj-megamenu{$module->id}" . "mobile { display: block; }\n\t\t}\n\t"); if ($mobilemenu == '2') { $doc->addStyleSheet(JURI::root(true) . '/modules/mod_djmegamenu/assets/css/offcanvas.css'); $offmodules = array(); $offmodules['top'] = modDJMegaMenuHelper::loadModules('dj-offcanvas-top', $params->get('offcanvas_topmod_style', 'xhtml')); $offmodules['bottom'] = modDJMegaMenuHelper::loadModules('dj-offcanvas-bottom', $params->get('offcanvas_botmod_style', 'xhtml')); } if ($params->get('mobiletheme') != '_override') { $css = 'modules/mod_djmegamenu/mobilethemes/' . $params->get('mobiletheme', 'dark') . '/djmobilemenu.css'; } else { $params->set('mobiletheme', 'override'); $css = 'templates/' . $app->getTemplate() . '/css/djmobilemenu.css'; } // add only if theme file exists if (JFile::exists(JPATH_ROOT . DS . $css)) { $doc->addStyleSheet(JURI::root(true) . '/' . $css); } if ($direction == 'rtl') { // load rtl css if exists in theme or joomla template $css_rtl = JFile::stripExt($css) . '_rtl.css'; if (JFile::exists(JPATH_ROOT . DS . $css_rtl)) {