Ejemplo n.º 1
0
         $item->innerstyles = "style=\"";
         $item->innerstyles .= "width: inherit;";
         if ($item->leftmargin) {
             $item->styles .= "margin-" . $direction . ":" . modMaximenuckHelper::testUnit($item->leftmargin) . ";";
         }
         if ($item->topmargin) {
             $item->styles .= "margin-top:" . modMaximenuckHelper::testUnit($item->topmargin) . ";";
         }
         if (isset($item->submenuswidth)) {
             // $item->innerstyles .= "width:" . modMaximenuckHelper::testUnit($item->submenuswidth) . ";";
             if (isset($item->colbgcolor) && $item->colbgcolor) {
                 $item->styles .= "background:" . $item->colbgcolor . ";";
             }
         }
         if (isset($item->submenucontainerheight) && $item->submenucontainerheight) {
             $item->innerstyles .= "height:" . modMaximenuckHelper::testUnit($item->submenucontainerheight) . ";";
         }
         $item->styles .= "\"";
         $item->innerstyles .= "\"";
     } else {
         $item->styles = "";
         $item->innerstyles = "";
     }
     $itemlevel == 1 ? $tmpitems['main'] .= "\n\t\t</li>" : '';
     $tmpitems['sub'] .= "\n\t<div class=\"floatck submenuck" . $item->id . "\" " . $item->styles . ">" . $close . "<div class=\"maxidrop-main\" " . $item->innerstyles . "><div class=\"maximenuck2 first \" " . $nextcolumnstyles . ">\n\t<ul class=\"maximenuck2\">";
     // if (isset($item->coltitle))
     // echo $item->coltitle;
 } elseif ($item->shallower) {
     $tmpitems['sub'] .= "\n\t</li>";
     $tmpitems['sub'] .= str_repeat("\n\t</ul>\n\t<div class=\"clr\"></div></div>\n\t<div class=\"clr\"></div></div></div>\n\t</li>", $item->level_diff - 1);
     $tmpitems['sub'] .= "\n\t</ul>\n\t<div class=\"clr\"></div></div>\n\t<div class=\"clr\"></div></div></div>";
Ejemplo n.º 2
0
	/**
	 * Get a list of the menu items.
	 *
	 * @param	JRegistry	$params	The module options.
	 *
	 * @return	array
	 */
	static function getItems(&$params)
	{
		$app = JFactory::getApplication();
		$menu = $app->getMenu();

		// If no active menu, use default
		$active = ($menu->getActive()) ? $menu->getActive() : $menu->getDefault();
		
		$user = JFactory::getUser();
		$levels = $user->getAuthorisedViewLevels();
		asort($levels);
		$key = 'menu_items'.$params.implode(',', $levels).'.'.$active->id;
		$cache = JFactory::getCache('mod_maximenuck', '');
		if (!($items = $cache->get($key)))
		{
			// Initialise variables.
			$list		= array();
			$modules	= array();
			$db			= JFactory::getDbo();
			$document = JFactory::getDocument();
			
			// load the libraries
			jimport('joomla.application.module.helper');

			$path = isset($active) ? $active->tree : array();
			$start		= (int) $params->get('startLevel');
			$end		= (int) $params->get('endLevel');
			$items 		= $menu->getItems('menutype',$params->get('menutype'));
			
			// if no items in the menu then exit
			if (!$items) return false;
			
			$lastitem	= 0;
			// list all modules
			$modulesList = modmaximenuckHelper::CreateModulesList();
			
			foreach($items as $i => $item)
			{
				$isdependant = $params->get('dependantitems', false) ? ($start > 1 && !in_array($item->tree[$start-2], $path)) : false;
				if (($start && $start > $item->level)
					|| ($end && $item->level > $end)
					|| $isdependant
				) {
					unset($items[$i]);
					continue;
				}

				$item->deeper = false;
				$item->shallower = false;
				$item->level_diff = 0;

				if (isset($items[$lastitem])) {
					$items[$lastitem]->deeper		= ($item->level > $items[$lastitem]->level);
					$items[$lastitem]->shallower	= ($item->level < $items[$lastitem]->level);
					$items[$lastitem]->level_diff	= ($items[$lastitem]->level - $item->level);
				}
				
				// Test if this is the last item
				$item->is_end = !isset($items[$i + 1]);

				$item->parent = (boolean) $menu->getItems('parent_id', (int) $item->id, true);
				$item->active		= false;
				$item->flink = $item->link;

				switch ($item->type)
				{
					case 'separator':
						// No further action needed.
						continue;

					case 'url':
						if ((strpos($item->link, 'index.php?') === 0) && (strpos($item->link, 'Itemid=') === false)) {
							// If this is an internal Joomla link, ensure the Itemid is set.
							$item->flink = $item->link.'&Itemid='.$item->id;
						}
                                                $item->flink = JFilterOutput::ampReplace(htmlspecialchars($item->flink));
						break;

					case 'alias':
						// If this is an alias use the item id stored in the parameters to make the link.
						$item->flink = 'index.php?Itemid='.$item->params->get('aliasoptions');
						break;

					default:
						$router = JSite::getRouter();
						if ($router->getMode() == JROUTER_MODE_SEF) {
							$item->flink = 'index.php?Itemid='.$item->id;
						}
						else {
							$item->flink .= '&Itemid='.$item->id;
						}
						break;
				}

				if (strcasecmp(substr($item->flink, 0, 4), 'http') && (strpos($item->flink, 'index.php?') !== false)) {
					$item->flink = JRoute::_($item->flink, true, $item->params->get('secure'));
				}
				else {
					$item->flink = JRoute::_($item->flink);
				}

				//$item->title = htmlspecialchars($item->title);
				$item->anchor_css = htmlspecialchars($item->params->get('menu-anchor_css', ''));
				$item->anchor_title = htmlspecialchars($item->params->get('menu-anchor_title', ''));
				$item->menu_image = $item->params->get('menu_image', '') ? htmlspecialchars($item->params->get('menu_image', '')) : '';
				
				
				
				//  ---------------- begin the maximenu work on items --------------------
				
				$item->ftitle = htmlspecialchars($item->title);
                                $item->ftitle = JFilterOutput::ampReplace($item->ftitle);
				$parentItem = modMaximenuckHelper::getParentItem($item->parent_id, $items);
				
				// ---- add some classes ----
				
				// add itemid class
				$item->classe = ' item' . $item->id;
				// add current class
				if (isset($active) && $active->id == $item->id) {
					$item->classe .= ' current';
				}
				// add active class
				if (	$item->type == 'alias' && is_array($path) &&
						in_array($item->params->get('aliasoptions'),$path)
					||	in_array($item->id, $path)) {
					$item->classe .= ' active';
                                        $item->active = true;
				}
				// add the parent class
				if ($item->deeper) {
					$item->classe .= ' deeper';
				}

				if ($item->parent) {
					if ($params->get('layout', 'default') != '_:flatlist')
						$item->classe .= ' parent';
				}
				
				// add last and first class
				$item->classe .= $item->is_end ? ' last' : '';
				$item->classe .= !isset($items[$i-1]) ? ' first' : '';	

                                if (isset($items[$lastitem])) {
                                    $items[$lastitem]->classe .= $items[$lastitem]->shallower ? ' last' : '';
                                    $item->classe .= $items[$lastitem]->deeper ? ' first' : '';
                                    if (isset($items[$i+1]) AND $item->level - $items[$i+1]->level > 1) {
                                            $parentItem->classe .= ' last';
                                    }
                                }


                // ---- manage params ----

				// -- manage column --
				$item->colwidth = $item->params->get('maximenu_colwidth', '180');
				$item->createnewrow = $item->params->get('maximenu_createnewrow', 0) || stristr($item->ftitle,'[newrow]');
                                // check if there is a width for the subcontainer
                                preg_match('/\[subwidth=([0-9]+)\]/', $item->ftitle, $subwidth);
                                $subwidth = isset($subwidth[1]) ? $subwidth[1] : '';
                                if ($subwidth) $item->ftitle = preg_replace('/\[subwidth=[0-9]+\]/', '', $item->ftitle);
				$item->submenucontainerwidth = $item->params->get('maximenu_submenucontainerwidth', '') + $subwidth;
				
				if ($item->params->get('maximenu_createcolumn', 0)) {
					$item->colonne = true;
					//$parentItem = modMaximenuckHelper::getParentItem($item->parent_id, $items);
					// add the value to give the total parent container width
					
					if (isset($parentItem->submenuswidth)) {
						$parentItem->submenuswidth = strval($parentItem->submenuswidth) + strval($item->colwidth);
					} else {
						$parentItem->submenuswidth = strval($item->colwidth);
					}
					// if specified by user with the plugin, then give the width to the parent container
					//if (isset($parentItem->submenucontainerwidth)) $parentItem->submenuswidth = $parentItem->submenucontainerwidth;
					if (isset($items[$lastitem]) && $items[$lastitem]->deeper) {
						$items[$lastitem]->columnwidth = $item->colwidth;
					} else {
						$item->columnwidth = $item->colwidth;
					}
				} elseif (preg_match('/\[col=([0-9]+)\]/', $item->ftitle, $resultat)) {
                                        $item->ftitle = str_replace('[newrow]', '', $item->ftitle);
					$item->ftitle = preg_replace('/\[col=[0-9]+\]/', '', $item->ftitle);
					$item->colonne = true;
					//$parentItem = modMaximenuckHelper::getParentItem($item->parent_id, $items);
					if (isset($parentItem->submenuswidth)) {
						$parentItem->submenuswidth = strval($parentItem->submenuswidth) + strval($resultat[1]);
					} else {
						$parentItem->submenuswidth = strval($resultat[1]);
					}
					if (isset($items[$lastitem]) && $items[$lastitem]->deeper) {
						$items[$lastitem]->columnwidth = $resultat[1];
					} else {
						$item->columnwidth = $resultat[1];
					}
				}
				if (isset($parentItem->submenucontainerwidth) AND $parentItem->submenucontainerwidth) $parentItem->submenuswidth = $parentItem->submenucontainerwidth; 
				
				// -- manage module --
				$moduleid = $item->params->get('maximenu_module', '');
				$style = $item->params->get('maximenu_forcemoduletitle', 0) ? 'xhtml' : '';
				if ($item->params->get('maximenu_insertmodule', 0)) {
					if (!isset($modules[$moduleid])) $modules[$moduleid] = modmaximenuckHelper::GenModuleById($moduleid, $params, $modulesList, $style);
					$item->content = '<div class="maximenuck_mod">' . $modules[$moduleid] . '<div class="clr"></div></div>';
				} elseif (preg_match('/\[modid=([0-9]+)\]/', $item->ftitle, $resultat)) { 
					$item->ftitle = preg_replace('/\[modid=[0-9]+\]/', '', $item->ftitle);
					$item->content = '<div class="maximenuck_mod">' . modmaximenuckHelper::GenModuleById($resultat[1], $params, $modulesList, $style) . '<div class="clr"></div></div>';
				}
				
				// -- manage rel attribute --
				$item->rel = '';
				if ($rel = $item->params->get('maximenu_relattr', '')) {
					$item->rel = ' rel="' . $rel . '"';
				} elseif (preg_match('/\[rel=([a-z]+)\]/i', $item->ftitle, $resultat)) {
					$item->ftitle = preg_replace('/\[rel=[a-z]+\]/i', '', $item->ftitle);
					$item->rel = ' rel="' . $resultat[1] . '"';
				}
				
				// -- manage link description --
				$item->description = $item->params->get('maximenu_desc', '');
				if ($item->description) {
					$item->desc = $item->description;
				} else {
					$resultat = explode("||", $item->ftitle);
					if (isset($resultat[1])) {
						$item->desc = $resultat[1];
					} else {
						$item->desc = '';
					}
					$item->ftitle = $resultat[0];	
				}
				

				// add styles to the page for customization
				$menuID = $params->get('menuid', 'maximenuck');
				$itemstyles = "";
				if ($item->titlecolor = $item->params->get('maximenu_titlecolor', ''))
					$itemstyles .= "div#" . $menuID . " ul.maximenuck li.item" . $item->id . " > a span.titreck {color:" . $item->titlecolor . " !important;} div#" . $menuID . " ul.maximenuck li.item" . $item->id . " > span.separator span.titreck {color:" . $item->titlecolor . " !important;}";
				if ($item->desccolor = $item->params->get('maximenu_desccolor', ''))
					$itemstyles .= "div#" . $menuID . " ul.maximenuck li.item" . $item->id . " > a span.descck {color:" . $item->desccolor . " !important;} div#" . $menuID . " ul.maximenuck li.item" . $item->id . " > span.separator span.descck {color:" . $item->desccolor . " !important;}";
				if ($item->titlehovercolor = $item->params->get('maximenu_titlehovercolor', ''))
					$itemstyles .= "div#" . $menuID . " ul.maximenuck li.item" . $item->id . " > a:hover span.titreck {color:" . $item->titlehovercolor . " !important;} div#" . $menuID . " ul.maximenuck li.item" . $item->id . " > span.separator:hover span.titreck {color:" . $item->titlehovercolor . " !important;}";
				if ($item->deschovercolor = $item->params->get('maximenu_deschovercolor', ''))
					$itemstyles .= "div#" . $menuID . " ul.maximenuck li.item" . $item->id . " > a:hover span.descck {color:" . $item->deschovercolor . " !important;} div#" . $menuID . " ul.maximenuck li.item" . $item->id . " > span.separator:hover span.descck {color:" . $item->deschovercolor . " !important;}";
				if ($item->titleactivecolor = $item->params->get('maximenu_titleactivecolor', ''))
					$itemstyles .= "div#" . $menuID . " ul.maximenuck li.active.item" . $item->id . " > a span.titreck {color:" . $item->titleactivecolor . " !important;} div#" . $menuID . " ul.maximenuck li.active.item" . $item->id . " > span.separator span.titreck {color:" . $item->titleactivecolor . " !important;}";
				if ($item->descactivecolor = $item->params->get('maximenu_descactivecolor', ''))
					$itemstyles .= "div#" . $menuID . " ul.maximenuck li.active.item" . $item->id . " > a span.descck {color:" . $item->descactivecolor . " !important;} div#" . $menuID . " ul.maximenuck li.active.item" . $item->id . " > span.separator span.descck {color:" . $item->descactivecolor . " !important;}";
				if ($item->libgcolor = $item->params->get('maximenu_libgcolor', ''))
					$itemstyles .= "div#" . $menuID . " ul.maximenuck li.item" . $item->id . " {background:" . $item->libgcolor . " !important;}";
				if ($item->lihoverbgcolor = $item->params->get('maximenu_lihoverbgcolor', ''))
					$itemstyles .= "div#" . $menuID . " ul.maximenuck li.item" . $item->id . ":hover {background:" . $item->lihoverbgcolor . " !important;}";
				if ($itemstyles)
					$document->addStyleDeclaration($itemstyles);

				// get plugin parameters that are used directly in the layout
				$item->leftmargin = $item->params->get('maximenu_leftmargin', '');
				$item->topmargin = $item->params->get('maximenu_topmargin', '');
				$item->liclass = $item->params->get('maximenu_liclass', '');
				$item->colbgcolor = $item->params->get('maximenu_colbgcolor', '');
				$item->tagcoltitle = $item->params->get('maximenu_tagcoltitle', 'none');
				
				$lastitem			= $i;
				
			} // end of boucle for each items

			// give the correct deep infos for the last item
			if (isset($items[$lastitem])) {
				$items[$lastitem]->deeper		= (($start?$start:1) > $items[$lastitem]->level);
				$items[$lastitem]->shallower	= (($start?$start:1) < $items[$lastitem]->level);
				$items[$lastitem]->level_diff	= ($items[$lastitem]->level - ($start?$start:1));
			}

			$cache->store($items, $key);
		}
		return $items;
	}
Ejemplo n.º 3
0
 /**
  * load the css properties for the module
  * @param JRegistry $params
  * @param string $menuID the module ID
  *
  * @return void
  */
 static function injectModuleCss($params, $menuID)
 {
     $document = JFactory::getDocument();
     // set the prefixes for all xml fieldset
     $prefixes = array('menustyles', 'level1itemnormalstyles', 'level1itemhoverstyles', 'level1itemactivestyles', 'level2menustyles', 'level2itemnormalstyles', 'level2itemhoverstyles', 'level2itemactivestyles', 'headingstyles');
     $css = new stdClass();
     $csstoinject = '';
     $important = false;
     foreach ($prefixes as $prefix) {
         $param = $params->get($prefix, '[]');
         $objs = json_decode(str_replace("|qq|", "\"", $param));
         //var_dump($objs);
         if (!$objs) {
             continue;
         }
         $fields = new CkCssParams();
         foreach ($objs as $obj) {
             $fieldid = str_replace($prefix . "_", "", $obj->id);
             $fields->{$fieldid} = isset($obj->value) ? $obj->value : null;
         }
         if ($prefix == 'headingstyles') {
             $important = true;
         }
         $css->{$prefix} = modMaximenuckHelper::createCss($menuID, $fields, $prefix, $important);
         // global options
         if ($prefix == 'menustyles') {
             // load the google font
             $gfont = $fields->get('menustylestextgfont', 'Droid Sans');
             if ($gfont != '0' && $fields->get('menustylesusefont')) {
                 $gfonturl = str_replace(" ", "+", $gfont);
                 $document->addStylesheet('http://fonts.googleapis.com/css?family=' . $gfonturl);
                 $document->addStyleDeclaration("div#" . $menuID . " li > a, div#" . $menuID . " li > span { font-family: " . $gfont . ";}");
             }
             // set the styles for the global menu
             $submenuwidth = $fields->get('menustylessubmenuwidth', '');
             $submenuheight = $fields->get('menustylessubmenuheight', '');
             $submenu1marginleft = $fields->get('menustylessubmenu1marginleft', '');
             $submenu1margintop = $fields->get('menustylessubmenu1margintop', '');
             $submenu2marginleft = $fields->get('menustylessubmenu2marginleft', '');
             $submenu2margintop = $fields->get('menustylessubmenu2margintop', '');
             $csstoinject = '';
             if ($submenuwidth) {
                 $csstoinject .= "\ndiv#" . $menuID . " div.maximenuck2 { width: " . self::testUnit($submenuwidth) . "; } ";
             }
             if ($submenuheight) {
                 $csstoinject .= "\ndiv#" . $menuID . " div.floatck { height: " . self::testUnit($submenuheight) . "; } ";
             }
             if ($submenu1marginleft) {
                 $csstoinject .= "\ndiv#" . $menuID . " div.floatck { margin-left: " . self::testUnit($submenu1marginleft) . "; } ";
             }
             if ($submenu1margintop) {
                 $csstoinject .= "\ndiv#" . $menuID . " div.floatck { margin-top: " . self::testUnit($submenu1margintop) . "; } ";
             }
             if ($submenu2marginleft) {
                 $csstoinject .= "\ndiv#" . $menuID . " ul.maximenuck li.maximenuck div.floatck div.floatck { margin-left: " . self::testUnit($submenu2marginleft) . "; } ";
             }
             if ($submenu2margintop) {
                 $csstoinject .= "\ndiv#" . $menuID . " ul.maximenuck li.maximenuck div.floatck div.floatck { margin-top: " . self::testUnit($submenu2margintop) . "; } ";
             }
         }
         if ($prefix == 'level1itemnormalstyles') {
             $itemparentlevel1image = $fields->get('level1itemnormalstylesparentitemimage', '');
             $itemparentlevel1paddingtop = $fields->get('level1itemnormalstylesparentitempaddingtop', '');
             $itemparentlevel1paddingright = $fields->get('level1itemnormalstylesparentitempaddingright', '');
             $itemparentlevel1paddingbottom = $fields->get('level1itemnormalstylesparentitempaddingbottom', '');
             $itemparentlevel1paddingleft = $fields->get('level1itemnormalstylesparentitempaddingleft', '');
             $itemparentlevel1background = $fields->get('level1itemnormalstylesparentitemimage') ? 'background-image: url("' . JURI::ROOT() . $fields->get('level1itemnormalstylesparentitemimage') . '") !important;' : '';
             $itemparentlevel1background .= $fields->get('level1itemnormalstylesparentitemimage') ? 'background-repeat: ' . $fields->get('level1itemnormalstylesparentitemimagerepeat') . ' !important;' : '';
             $itemparentlevel1background .= $fields->get('level1itemnormalstylesparentitemimage') ? 'background-position: ' . $fields->get('level1itemnormalstylesparentitemimagepositionx') . ' ' . $fields->get('level1itemnormalstylesparentitemimagepositiony') . ' !important;' : '';
             if ($fields->get('level1itemnormalstylesuseparentitem') && ($itemparentlevel1image || $itemparentlevel1paddingtop || $itemparentlevel1paddingright || $itemparentlevel1paddingbottom || $itemparentlevel1paddingleft)) {
                 $csstoinject .= "\ndiv#" . $menuID . " ul.maximenuck li.maximenuck.level1.parent > a, div#" . $menuID . " ul.maximenuck li.maximenuck.level1.parent > span.separator { " . $itemparentlevel1background . " padding-top: " . self::testUnit($itemparentlevel1paddingtop) . " !important; padding-right: " . self::testUnit($itemparentlevel1paddingright) . " !important; padding-bottom: " . self::testUnit($itemparentlevel1paddingbottom) . " !important; padding-left: " . self::testUnit($itemparentlevel1paddingleft) . " !important; } ";
             }
         }
         if ($prefix == 'level2itemnormalstyles') {
             $itemparentlevel2image = $fields->get('level2itemnormalstylesparentitemimage', '');
             $itemparentlevel2paddingtop = $fields->get('level2itemnormalstylesparentitempaddingtop', '');
             $itemparentlevel2paddingright = $fields->get('level2itemnormalstylesparentitempaddingright', '');
             $itemparentlevel2paddingbottom = $fields->get('level2itemnormalstylesparentitempaddingbottom', '');
             $itemparentlevel2paddingleft = $fields->get('level2itemnormalstylesparentitempaddingleft', '');
             $itemparentlevel2background = $fields->get('level2itemnormalstylesparentitemimage') ? 'background-image: url("' . JURI::ROOT() . $fields->get('level2itemnormalstylesparentitemimage') . '") !important;' : '';
             $itemparentlevel2background .= $fields->get('level2itemnormalstylesparentitemimage') ? 'background-repeat: ' . $fields->get('level2itemnormalstylesparentitemimagerepeat') . ' !important;' : '';
             $itemparentlevel2background .= $fields->get('level2itemnormalstylesparentitemimage') ? 'background-position: ' . $fields->get('level2itemnormalstylesparentitemimagepositionx') . ' ' . $fields->get('level2itemnormalstylesparentitemimagepositiony') . ' !important;' : '';
             if ($fields->get('level2itemnormalstylesuseparentitem') && ($itemparentlevel2image || $itemparentlevel2paddingtop || $itemparentlevel2paddingright || $itemparentlevel2paddingbottom || $itemparentlevel2paddingleft)) {
                 $csstoinject .= "\ndiv#" . $menuID . " ul.maximenuck li.maximenuck.level1 li.maximenuck.parent > a, div#" . $menuID . " ul.maximenuck li.maximenuck.level1 li.maximenuck.parent > span.separator, div#" . $menuID . " ul.maximenuck li.maximenuck.level1 li.maximenuck.parent:hover > a, div#" . $menuID . " ul.maximenuck li.maximenuck.level1 li.maximenuck.parent:hover > span.separator,\ndiv#" . $menuID . " .maxipushdownck li.maximenuck.parent > a, div#" . $menuID . " .maxipushdownck li.maximenuck.parent > span.separator, div#" . $menuID . " .maxipushdownck li.maximenuck.parent:hover > a, div#" . $menuID . " .maxipushdownck li.maximenuck.parent:hover > span.separator { " . $itemparentlevel2background . " padding-top: " . self::testUnit($itemparentlevel2paddingtop) . " !important; padding-right: " . self::testUnit($itemparentlevel2paddingright) . " !important; padding-bottom: " . self::testUnit($itemparentlevel2paddingbottom) . " !important; padding-left: " . self::testUnit($itemparentlevel2paddingleft) . " !important; } ";
             }
         }
     }
     // root styles
     if (isset($css->menustyles)) {
         if ($css->menustyles['padding'] || $css->menustyles['margin'] || $css->menustyles['background'] || $css->menustyles['gradient'] || $css->menustyles['borderradius'] || $css->menustyles['shadow'] || $css->menustyles['border']) {
             $csstoinject .= "\ndiv#" . $menuID . " ul.maximenuck { " . $css->menustyles['padding'] . $css->menustyles['margin'] . $css->menustyles['background'] . $css->menustyles['gradient'] . $css->menustyles['borderradius'] . $css->menustyles['shadow'] . $css->menustyles['border'] . " } ";
         }
         if ($css->menustyles['fontcolor'] || $css->menustyles['fontsize'] || $css->menustyles['textshadow']) {
             $csstoinject .= "\ndiv#" . $menuID . " ul.maximenuck li.maximenuck > a span.titreck, div#" . $menuID . " ul.maximenuck li.maximenuck > span.separator span.titreck,\ndiv#" . $menuID . " .maxipushdownck li.maximenuck > a span.titreck, div#" . $menuID . " .maxipushdownck li.maximenuck > span.separator span.titreck { " . $css->menustyles['fontcolor'] . $css->menustyles['fontsize'] . $css->menustyles['textshadow'] . " } ";
         }
         if ($css->menustyles['descfontcolor'] || $css->menustyles['descfontsize']) {
             $csstoinject .= "\ndiv#" . $menuID . " ul.maximenuck li.maximenuck > a span.descck, div#" . $menuID . " ul.maximenuck li.maximenuck > span.separator span.descck,\ndiv#" . $menuID . " .maxipushdownck li.maximenuck > a span.descck, div#" . $menuID . " .maxipushdownck li.maximenuck > span.separator span.descck { " . $css->menustyles['descfontcolor'] . $css->menustyles['descfontsize'] . " } ";
         }
     }
     // level1 normal items styles
     if (isset($css->level1itemnormalstyles)) {
         if ($css->level1itemnormalstyles['padding'] || $css->level1itemnormalstyles['margin'] || $css->level1itemnormalstyles['background'] || $css->level1itemnormalstyles['gradient'] || $css->level1itemnormalstyles['borderradius'] || $css->level1itemnormalstyles['shadow'] || $css->level1itemnormalstyles['border']) {
             $csstoinject .= "\ndiv#" . $menuID . " ul.maximenuck li.maximenuck.level1, div#" . $menuID . " ul.maximenuck li.maximenuck.level1.parent { " . $css->level1itemnormalstyles['padding'] . $css->level1itemnormalstyles['margin'] . $css->level1itemnormalstyles['background'] . $css->level1itemnormalstyles['gradient'] . $css->level1itemnormalstyles['borderradius'] . $css->level1itemnormalstyles['shadow'] . $css->level1itemnormalstyles['border'] . " } ";
         }
         if ($css->level1itemnormalstyles['fontcolor'] || $css->level1itemnormalstyles['fontsize'] || $css->level1itemnormalstyles['textshadow']) {
             $csstoinject .= "\ndiv#" . $menuID . " ul.maximenuck li.maximenuck.level1 > a span.titreck, div#" . $menuID . " ul.maximenuck li.maximenuck.level1 > span.separator span.titreck { " . $css->level1itemnormalstyles['fontcolor'] . $css->level1itemnormalstyles['fontsize'] . $css->level1itemnormalstyles['fontweight'] . $css->level1itemnormalstyles['textshadow'] . " } ";
         }
         if ($css->level1itemnormalstyles['descfontcolor'] || $css->level1itemnormalstyles['descfontsize']) {
             $csstoinject .= "\ndiv#" . $menuID . " ul.maximenuck li.maximenuck.level1 > a span.descck, div#" . $menuID . " ul.maximenuck li.maximenuck.level1 > span.separator span.descck { " . $css->level1itemnormalstyles['descfontcolor'] . $css->level1itemnormalstyles['descfontsize'] . " } ";
         }
     }
     // level1 hover items styles
     if (isset($css->level1itemhoverstyles)) {
         if ($css->level1itemhoverstyles['padding'] || $css->level1itemhoverstyles['margin'] || $css->level1itemhoverstyles['background'] || $css->level1itemhoverstyles['gradient'] || $css->level1itemhoverstyles['borderradius'] || $css->level1itemhoverstyles['shadow'] || $css->level1itemhoverstyles['border']) {
             $csstoinject .= "\ndiv#" . $menuID . " ul.maximenuck li.maximenuck.level1:hover, div#" . $menuID . " ul.maximenuck li.maximenuck.level1.parent:hover { " . $css->level1itemhoverstyles['padding'] . $css->level1itemhoverstyles['margin'] . $css->level1itemhoverstyles['background'] . $css->level1itemhoverstyles['gradient'] . $css->level1itemhoverstyles['borderradius'] . $css->level1itemhoverstyles['shadow'] . $css->level1itemhoverstyles['border'] . " } ";
         }
         if ($css->level1itemhoverstyles['fontcolor'] || $css->level1itemhoverstyles['fontsize'] || $css->level1itemhoverstyles['textshadow']) {
             $csstoinject .= "\ndiv#" . $menuID . " ul.maximenuck li.maximenuck.level1:hover > a span.titreck, div#" . $menuID . " ul.maximenuck li.maximenuck.level1:hover > span.separator span.titreck { " . $css->level1itemhoverstyles['fontcolor'] . $css->level1itemhoverstyles['fontsize'] . $css->level1itemhoverstyles['fontweight'] . $css->level1itemhoverstyles['textshadow'] . " } ";
         }
         if ($css->level1itemhoverstyles['descfontcolor'] || $css->level1itemhoverstyles['descfontsize']) {
             $csstoinject .= "\ndiv#" . $menuID . " ul.maximenuck li.maximenuck.level1:hover > a span.descck, div#" . $menuID . " ul.maximenuck li.maximenuck.level1:hover > span.separator span.descck { " . $css->level1itemhoverstyles['descfontcolor'] . $css->level1itemhoverstyles['descfontsize'] . " } ";
         }
     }
     // level1 active items styles
     if (isset($css->level1itemactivestyles)) {
         if ($css->level1itemactivestyles['padding'] || $css->level1itemactivestyles['margin'] || $css->level1itemactivestyles['background'] || $css->level1itemactivestyles['gradient'] || $css->level1itemactivestyles['borderradius'] || $css->level1itemactivestyles['shadow'] || $css->level1itemactivestyles['border']) {
             $csstoinject .= "\ndiv#" . $menuID . " ul.maximenuck li.maximenuck.level1.active { " . $css->level1itemactivestyles['padding'] . $css->level1itemactivestyles['margin'] . $css->level1itemactivestyles['background'] . $css->level1itemactivestyles['gradient'] . $css->level1itemactivestyles['borderradius'] . $css->level1itemactivestyles['shadow'] . $css->level1itemactivestyles['border'] . " } ";
         }
         if ($css->level1itemactivestyles['fontcolor'] || $css->level1itemactivestyles['fontsize'] || $css->level1itemactivestyles['textshadow']) {
             $csstoinject .= "\ndiv#" . $menuID . " ul.maximenuck li.maximenuck.level1.active > a span.titreck, div#" . $menuID . " ul.maximenuck li.maximenuck.level1.active > span.separator span.titreck { " . $css->level1itemactivestyles['fontcolor'] . $css->level1itemactivestyles['fontsize'] . $css->level1itemactivestyles['fontweight'] . $css->level1itemactivestyles['textshadow'] . " } ";
         }
         if ($css->level1itemactivestyles['descfontcolor'] || $css->level1itemactivestyles['descfontsize']) {
             $csstoinject .= "\ndiv#" . $menuID . " ul.maximenuck li.maximenuck.level1.active > a span.descck, div#" . $menuID . " ul.maximenuck li.maximenuck.level1.active > span.separator span.descck { " . $css->level1itemactivestyles['descfontcolor'] . $css->level1itemactivestyles['descfontsize'] . " } ";
         }
     }
     // submenu styles
     if (isset($css->level2menustyles)) {
         if ($css->level2menustyles['padding'] || $css->level2menustyles['margin'] || $css->level2menustyles['background'] || $css->level2menustyles['gradient'] || $css->level2menustyles['borderradius'] || $css->level2menustyles['shadow'] || $css->level2menustyles['border']) {
             $csstoinject .= "\ndiv#" . $menuID . " ul.maximenuck li.maximenuck div.floatck,\ndiv#" . $menuID . " .maxipushdownck div.floatck { " . $css->level2menustyles['padding'] . $css->level2menustyles['margin'] . $css->level2menustyles['background'] . $css->level2menustyles['gradient'] . $css->level2menustyles['borderradius'] . $css->level2menustyles['shadow'] . $css->level2menustyles['border'] . " } ";
         }
     }
     // level2 normal items styles
     if (isset($css->level2itemnormalstyles)) {
         if ($css->level2itemnormalstyles['padding'] || $css->level2itemnormalstyles['margin'] || $css->level2itemnormalstyles['background'] || $css->level2itemnormalstyles['gradient'] || $css->level2itemnormalstyles['borderradius'] || $css->level2itemnormalstyles['shadow'] || $css->level2itemnormalstyles['border']) {
             $csstoinject .= "\ndiv#" . $menuID . " ul.maximenuck li.maximenuck.level1 li.maximenuck,\ndiv#" . $menuID . " .maxipushdownck li.maximenuck { " . $css->level2itemnormalstyles['padding'] . $css->level2itemnormalstyles['margin'] . $css->level2itemnormalstyles['background'] . $css->level2itemnormalstyles['gradient'] . $css->level2itemnormalstyles['borderradius'] . $css->level2itemnormalstyles['shadow'] . $css->level2itemnormalstyles['border'] . " } ";
         }
         if ($css->level2itemnormalstyles['fontcolor'] || $css->level2itemnormalstyles['fontsize'] || $css->level2itemnormalstyles['textshadow']) {
             $csstoinject .= "\ndiv#" . $menuID . " ul.maximenuck li.maximenuck.level1 li.maximenuck > a span.titreck, div#" . $menuID . " ul.maximenuck li.maximenuck.level1 li.maximenuck > span.separator span.titreck,\ndiv#" . $menuID . " .maxipushdownck li.maximenuck > a span.titreck, div#" . $menuID . " .maxipushdownck li.maximenuck > span.separator span.titreck { " . $css->level2itemnormalstyles['fontcolor'] . $css->level2itemnormalstyles['fontsize'] . $css->level2itemnormalstyles['fontweight'] . $css->level2itemnormalstyles['textshadow'] . " } ";
         }
         if ($css->level2itemnormalstyles['descfontcolor'] || $css->level2itemnormalstyles['descfontsize']) {
             $csstoinject .= "\ndiv#" . $menuID . " ul.maximenuck li.maximenuck.level1 li.maximenuck > a span.descck, div#" . $menuID . " ul.maximenuck li.maximenuck.level1 li.maximenuck > span.separator span.descck,\ndiv#" . $menuID . " .maxipushdownck li.maximenuck > a span.descck, div#" . $menuID . " .maxipushdownck li.maximenuck > span.separator span.descck { " . $css->level2itemnormalstyles['descfontcolor'] . $css->level2itemnormalstyles['descfontsize'] . " } ";
         }
     }
     // level2 hover items styles
     if (isset($css->level2itemhoverstyles)) {
         if ($css->level2itemhoverstyles['padding'] || $css->level2itemhoverstyles['margin'] || $css->level2itemhoverstyles['background'] || $css->level2itemhoverstyles['gradient'] || $css->level2itemhoverstyles['borderradius'] || $css->level2itemhoverstyles['shadow'] || $css->level2itemhoverstyles['border']) {
             $csstoinject .= "\ndiv#" . $menuID . " ul.maximenuck li.maximenuck.level1 li.maximenuck:hover,\ndiv#" . $menuID . " .maxipushdownck li.maximenuck:hover { " . $css->level2itemhoverstyles['padding'] . $css->level2itemhoverstyles['margin'] . $css->level2itemhoverstyles['background'] . $css->level2itemhoverstyles['gradient'] . $css->level2itemhoverstyles['borderradius'] . $css->level2itemhoverstyles['shadow'] . $css->level2itemhoverstyles['border'] . " } ";
         }
         if ($css->level2itemhoverstyles['fontcolor'] || $css->level2itemhoverstyles['fontsize'] || $css->level2itemhoverstyles['textshadow']) {
             $csstoinject .= "\ndiv#" . $menuID . " ul.maximenuck li.maximenuck.level1 li.maximenuck:hover > a span.titreck, div#" . $menuID . " ul.maximenuck li.maximenuck.level1 li.maximenuck:hover > span.separator span.titreck,\ndiv#" . $menuID . " .maxipushdownck li.maximenuck:hover > a span.titreck, div#" . $menuID . " .maxipushdownck li.maximenuck:hover > span.separator span.titreck { " . $css->level2itemhoverstyles['fontcolor'] . $css->level2itemhoverstyles['fontsize'] . $css->level2itemhoverstyles['fontweight'] . $css->level2itemhoverstyles['textshadow'] . " } ";
         }
         if ($css->level2itemhoverstyles['descfontcolor'] || $css->level2itemhoverstyles['descfontsize']) {
             $csstoinject .= "\ndiv#" . $menuID . " ul.maximenuck li.maximenuck.level1 li.maximenuck:hover > a span.descck, div#" . $menuID . " ul.maximenuck li.maximenuck.level1 li.maximenuck:hover > span.separator span.descck,\ndiv#" . $menuID . " .maxipushdownck li.maximenuck:hover > a span.descck, div#" . $menuID . " .maxipushdownck li.maximenuck:hover > span.separator span.descck { " . $css->level2itemhoverstyles['descfontcolor'] . $css->level2itemhoverstyles['descfontsize'] . " } ";
         }
     }
     // level2 active items styles
     if (isset($css->level2itemactivestyles)) {
         if ($css->level2itemactivestyles['padding'] || $css->level2itemactivestyles['margin'] || $css->level2itemactivestyles['background'] || $css->level2itemactivestyles['gradient'] || $css->level2itemactivestyles['borderradius'] || $css->level2itemactivestyles['shadow'] || $css->level2itemactivestyles['border']) {
             $csstoinject .= "\ndiv#" . $menuID . " ul.maximenuck li.maximenuck.level1 li.maximenuck.active,\ndiv#" . $menuID . " .maxipushdownck li.maximenuck.active { " . $css->level2itemactivestyles['padding'] . $css->level2itemactivestyles['margin'] . $css->level2itemactivestyles['background'] . $css->level2itemactivestyles['gradient'] . $css->level2itemactivestyles['borderradius'] . $css->level2itemactivestyles['shadow'] . $css->level2itemactivestyles['border'] . " } ";
         }
         if ($css->level2itemactivestyles['fontcolor'] || $css->level2itemactivestyles['fontsize'] || $css->level2itemactivestyles['textshadow']) {
             $csstoinject .= "\ndiv#" . $menuID . " ul.maximenuck li.maximenuck.level1 li.maximenuck.active > a span.titreck, div#" . $menuID . " ul.maximenuck li.maximenuck.level1 li.maximenuck.active > span.separator span.titreck,\ndiv#" . $menuID . " .maxipushdownck li.maximenuck.active > a span.titreck, div#" . $menuID . " .maxipushdownck li.maximenuck.active > span.separator span.titreck { " . $css->level2itemactivestyles['fontcolor'] . $css->level2itemactivestyles['fontsize'] . $css->level2itemactivestyles['fontweight'] . $css->level2itemactivestyles['textshadow'] . " } ";
         }
         if ($css->level2itemactivestyles['descfontcolor'] || $css->level2itemactivestyles['descfontsize']) {
             $csstoinject .= "\ndiv#" . $menuID . " ul.maximenuck li.maximenuck.level1 li.maximenuck.active > a span.descck, div#" . $menuID . " ul.maximenuck li.maximenuck.level1 li.maximenuck.active > span.separator span.descck,\ndiv#" . $menuID . " .maxipushdownck li.maximenuck.active > a span.descck, div#" . $menuID . " .maxipushdownck li.maximenuck.active > span.separator span.descck { " . $css->level2itemactivestyles['descfontcolor'] . $css->level2itemactivestyles['descfontsize'] . " } ";
         }
     }
     // level1 normal items styles
     if (isset($css->headingstyles)) {
         $headingclass = '.separator';
         $padding = $css->headingstyles['padding'] ? trim($css->headingstyles['padding'], ";") . ";" : '';
         $margin = $css->headingstyles['margin'] ? trim($css->headingstyles['margin'], ";") . ";" : '';
         $background = $css->headingstyles['background'] ? trim($css->headingstyles['background'], ";") . ";" : '';
         $gradient = $css->headingstyles['gradient'] ? trim($css->headingstyles['gradient'], ";") . ";" : '';
         $borderradius = $css->headingstyles['borderradius'] ? trim($css->headingstyles['borderradius'], ";") . ";" : '';
         $shadow = $css->headingstyles['shadow'] ? trim($css->headingstyles['shadow'], ";") . ";" : '';
         $border = $css->headingstyles['border'] ? trim($css->headingstyles['border'], ";") . ";" : '';
         $csstoinject .= "\ndiv#" . $menuID . " ul.maximenuck > li.maximenuck.level1.parent ul.maximenuck2 li.maximenuck > " . $headingclass . ",\ndiv#" . $menuID . " .maxipushdownck ul.maximenuck2 li.maximenuck > " . $headingclass . " { " . $padding . $margin . $background . $gradient . $borderradius . $shadow . $border . " } ";
         $csstoinject .= "\ndiv#" . $menuID . " ul.maximenuck > li.maximenuck.level1.parent ul.maximenuck2 li.maximenuck > " . $headingclass . " span.titreck,\ndiv#" . $menuID . " .maxipushdownck ul.maximenuck2 li.maximenuck > " . $headingclass . " span.titreck { " . $css->headingstyles['fontcolor'] . $css->headingstyles['fontsize'] . $css->headingstyles['fontweight'] . $css->headingstyles['textshadow'] . " } ";
         $csstoinject .= "\ndiv#" . $menuID . " ul.maximenuck > li.maximenuck.level1.parent ul.maximenuck2 li.maximenuck > " . $headingclass . " span.descck,\ndiv#" . $menuID . " .maxipushdownck ul.maximenuck2 li.maximenuck > " . $headingclass . " span.descck{ " . $css->headingstyles['descfontcolor'] . $css->headingstyles['descfontsize'] . " } ";
     }
     if ($csstoinject) {
         $document->addStyleDeclaration($csstoinject);
     }
 }
 * @license		GNU/GPL
 * */

// no direct access
defined('_JEXEC') or die;
jimport('joomla.filesystem.file');


// retrieve menu items
$thirdparty = $params->get('thirdparty', 'none');
switch ($thirdparty) :
	default:
	case 'none':
		// Include the syndicate functions only once
		require_once dirname(__FILE__).'/helper.php';
		$items	= modMaximenuckHelper::getItems($params);
	break;
	case 'virtuemart':
		// Include the syndicate functions only once
		if (JFile::exists(dirname(__FILE__).'/helper_virtuemart.php')) {
			require_once dirname(__FILE__).'/helper_virtuemart.php';
			$items	= modMaximenuckvirtuemartHelper::getItems($params);
		} else {
			echo '<p style="color:red;font-weight:bold;">File helper_virtuemart.php not found ! Please download the patch for Maximenu - Virtuemart on <a href="http://www.joomlack.fr">http://www.joomlack.fr</a></p>';
			return false;
		}
	break;
        case 'hikashop':
		// Include the syndicate functions only once
		if (JFile::exists(dirname(__FILE__).'/helper_hikashop.php')) {
			require_once dirname(__FILE__).'/helper_hikashop.php';
Ejemplo n.º 5
0
 /**
  * Ajax method to clean the name of the google font
  */
 public function clean_gfont_name()
 {
     // load the helper of the module
     if (file_exists(JPATH_ROOT . '/modules/mod_maximenuck/helper.php')) {
         require_once JPATH_ROOT . '/modules/mod_maximenuck/helper.php';
     } else {
         echo JText::_('CK_MODULE_MAXIMENUCK_NOT_INSTALLED');
         die;
     }
     $input = new JInput();
     $gfont = $input->get('gfont', '', 'string');
     $cleaned_gfont = modMaximenuckHelper::clean_gfont_name($gfont);
     echo $cleaned_gfont;
     die;
 }
Ejemplo n.º 6
0
 static function createModuleCss($params, $menuID)
 {
     $document = JFactory::getDocument();
     // set the prefixes for all xml fieldset
     $prefixes = array('menustyles', 'level1itemnormalstyles', 'level1itemhoverstyles', 'level1itemactivestyles', 'level2menustyles', 'level2itemnormalstyles', 'level2itemhoverstyles', 'level2itemactivestyles', 'headingstyles');
     $css = new stdClass();
     $csstoinject = '';
     $important = false;
     $fields = array();
     // create the css rules for each prefix
     foreach ($prefixes as $prefix) {
         $param = $params->get($prefix, '[]');
         $objs = json_decode(str_replace("|qq|", "\"", $param));
         $fields[$prefix] = new CkCssParams();
         if (!$objs) {
             continue;
         }
         foreach ($objs as $obj) {
             $fieldid = str_replace($prefix . "_", "", $obj->id);
             $fields[$prefix]->{$fieldid} = isset($obj->value) ? $obj->value : null;
         }
         if ($prefix == 'headingstyles') {
             $important = true;
         }
         $css->{$prefix} = modMaximenuckHelper::createCss($menuID, $fields[$prefix], $prefix, $important, '');
     }
     $csstoinject = '';
     // get the css suffix for the module
     $menu_class = $params->get('orientation', 'horizontal') === 'horizontal' ? '.maximenuckh' : '.maximenuckv';
     switch (trim($params->get('layout', 'default'), '_:')) {
         case 'flatlist':
             $menu_begin = ' ul.maximenuck2';
             break;
         case 'nativejoomla':
             $menu_begin = ' ul';
             break;
         default:
         case 'default':
             $menu_begin = ' ul.maximenuck';
             break;
     }
     // set the specific menu ID to give more weight to the css rule
     $menuCSSID = $menuID . $menu_class . $menu_begin;
     // load the google font
     $gfont = $fields['menustyles']->get('menustylestextgfont', '');
     if ($gfont) {
         $gfontfamily = self::get_gfontfamily($gfont);
         $document->addStylesheet('https://fonts.googleapis.com/css?family=' . $gfont);
         $csstoinject .= "div#" . $menuID . " li > a, div#" . $menuID . " li > span { font-family: '" . $gfontfamily . "';}";
     }
     $gfont = $fields['level2itemnormalstyles']->get('level2itemnormalstylestextgfont', '');
     if ($gfont) {
         $gfontfamily = self::get_gfontfamily($gfont);
         $document->addStylesheet('https://fonts.googleapis.com/css?family=' . $gfont);
         $csstoinject .= "div#" . $menuID . " ul.maximenuck2 li > a, div#" . $menuID . " ul.maximenuck2 li > span { font-family: '" . $gfontfamily . "';}";
     }
     // set the styles for the global menu
     $submenuwidth = $fields['menustyles']->get('menustylessubmenuwidth', '');
     $submenuheight = $fields['menustyles']->get('menustylessubmenuheight', '');
     $submenu1marginleft = $fields['menustyles']->get('menustylessubmenu1marginleft', '');
     $submenu1margintop = $fields['menustyles']->get('menustylessubmenu1margintop', '');
     $submenu2marginleft = $fields['menustyles']->get('menustylessubmenu2marginleft', '');
     $submenu2margintop = $fields['menustyles']->get('menustylessubmenu2margintop', '');
     if ($submenuwidth) {
         $csstoinject .= "\ndiv#" . $menuCSSID . " div.maxidrop-main, div#" . $menuCSSID . " li div.maxidrop-main { width: " . self::testUnit($submenuwidth) . "; } ";
     }
     if ($submenuheight) {
         $csstoinject .= "\ndiv#" . $menuCSSID . " div.maxidrop-main, div#" . $menuCSSID . " li.maximenuck div.maxidrop-main { height: " . self::testUnit($submenuheight) . "; } ";
     }
     if ($submenu1marginleft) {
         $csstoinject .= "\ndiv#" . $menuCSSID . " div.floatck, div#" . $menuCSSID . " li.maximenuck div.floatck { margin-left: " . self::testUnit($submenu1marginleft) . "; } ";
     }
     if ($submenu1margintop) {
         $csstoinject .= "\ndiv#" . $menuCSSID . " div.floatck, div#" . $menuCSSID . " li.maximenuck div.floatck { margin-top: " . self::testUnit($submenu1margintop) . "; } ";
     }
     if ($submenu2marginleft) {
         $csstoinject .= "\ndiv#" . $menuCSSID . " li.maximenuck div.floatck div.floatck { margin-left: " . self::testUnit($submenu2marginleft) . "; } ";
     }
     if ($submenu2margintop) {
         $csstoinject .= "\ndiv#" . $menuCSSID . " li.maximenuck div.floatck div.floatck { margin-top: " . self::testUnit($submenu2margintop) . "; } ";
     }
     if ($fields['level1itemnormalstyles']->get('level1itemnormalstylesparentarrowtype', '') == 'triangle') {
         $level1itemnormalstylesparentarrowcolor = $fields['level1itemnormalstyles']->get('level1itemnormalstylesparentarrowcolor', '') ? $fields['level1itemnormalstyles']->get('level1itemnormalstylesparentarrowcolor', '') : $fields['level1itemnormalstyles']->get('level1itemnormalstylesfontcolor', '');
         // for parent arrow normal state
         if ($level1itemnormalstylesparentarrowcolor) {
             $csstoinject .= "\ndiv#" . $menuCSSID . " li.maximenuck.level1.parent > a:after, div#" . $menuCSSID . " li.maximenuck.level1.parent > span.separator:after { " . ($params->get('orientation', 'horizontal') === 'vertical' ? "border-left-color: " . $level1itemnormalstylesparentarrowcolor . ";" : "border-top-color: " . $level1itemnormalstylesparentarrowcolor . ";") . "color: " . $level1itemnormalstylesparentarrowcolor . ";" . "display:block;" . "position:absolute;" . ($fields['level1itemnormalstyles']->get('level1itemnormalstylesparentarrowmargintop', '') != '' ? "margin-top: " . self::testUnit($fields['level1itemnormalstyles']->get('level1itemnormalstylesparentarrowmargintop', '')) . ";" : "") . ($fields['level1itemnormalstyles']->get('level1itemnormalstylesparentarrowmarginright', '') != '' ? "margin-right: " . self::testUnit($fields['level1itemnormalstyles']->get('level1itemnormalstylesparentarrowmarginright', '')) . ";" : "") . ($fields['level1itemnormalstyles']->get('level1itemnormalstylesparentarrowmarginbottom', '') != '' ? "margin-bottom: " . self::testUnit($fields['level1itemnormalstyles']->get('level1itemnormalstylesparentarrowmarginbottom', '')) . ";" : "") . ($fields['level1itemnormalstyles']->get('level1itemnormalstylesparentarrowmarginleft', '') != '' ? "margin-left: " . self::testUnit($fields['level1itemnormalstyles']->get('level1itemnormalstylesparentarrowmarginleft', '')) . ";" : "") . ($fields['level1itemnormalstyles']->get('level1itemnormalstylesparentarrowpositiontop', '') != '' ? "top: " . self::testUnit($fields['level1itemnormalstyles']->get('level1itemnormalstylesparentarrowpositiontop', '')) . ";" : "") . ($fields['level1itemnormalstyles']->get('level1itemnormalstylesparentarrowpositionright', '') != '' ? "right: " . self::testUnit($fields['level1itemnormalstyles']->get('level1itemnormalstylesparentarrowpositionright', '')) . ";" : "") . ($fields['level1itemnormalstyles']->get('level1itemnormalstylesparentarrowpositionbottom', '') != '' ? "bottom: " . self::testUnit($fields['level1itemnormalstyles']->get('level1itemnormalstylesparentarrowpositionbottom', '')) . ";" : "") . ($fields['level1itemnormalstyles']->get('level1itemnormalstylesparentarrowpositionleft', '') != '' ? "left: " . self::testUnit($fields['level1itemnormalstyles']->get('level1itemnormalstylesparentarrowpositionleft', '')) . ";" : "") . "} ";
         }
         $level1itemhoverstylesparentarrowcolor = $fields['level1itemhoverstyles']->get('level1itemhoverstylesparentarrowcolor', '') ? $fields['level1itemhoverstyles']->get('level1itemhoverstylesparentarrowcolor', '') : $fields['level1itemhoverstyles']->get('level1itemhoverstylesfontcolor', '');
         // for parent arrow hover state
         if ($level1itemhoverstylesparentarrowcolor) {
             $csstoinject .= "\ndiv#" . $menuCSSID . " li.maximenuck.level1.parent:hover > a:after, div#" . $menuCSSID . " li.maximenuck.level1.parent:hover > span.separator:after { " . ($params->get('orientation', 'horizontal') === 'vertical' ? "border-left-color: " . $level1itemhoverstylesparentarrowcolor . ";" : "border-top-color: " . $level1itemhoverstylesparentarrowcolor . ";") . "color: " . $level1itemhoverstylesparentarrowcolor . ";" . "} ";
         }
     } else {
         if ($fields['level1itemnormalstyles']->get('level1itemnormalstylesparentarrowtype', '') == 'image') {
             // for parent arrow normal state
             $csstoinject .= "\ndiv#" . $menuCSSID . " li.maximenuck.level1.parent > a:after, div#" . $menuCSSID . " li.maximenuck.level1.parent > span.separator:after { " . "border: none;" . "display:block;" . "position:absolute;" . ($fields['level1itemnormalstyles']->get('level1itemnormalstylesparentitemimage', '') != '' ? "background-image: url(" . JUri::root(true) . "/" . $fields['level1itemnormalstyles']->get('level1itemnormalstylesparentitemimage', '') . ");" : "") . ($fields['level1itemnormalstyles']->get('level1itemnormalstylesparentitemimagepositionx', '') != '' && $fields['level1itemnormalstyles']->get('level1itemnormalstylesparentitemimagepositiony', '') != '' ? "background-position: " . $fields['level1itemnormalstyles']->get('level1itemnormalstylesparentitemimagepositionx', '') . " " . $fields['level1itemnormalstyles']->get('level1itemnormalstylesparentitemimagepositiony', '') . ";" : "") . ($fields['level1itemnormalstyles']->get('level1itemnormalstylesparentitemimagerepeat', '') != '' ? "background-repeat: " . $fields['level1itemnormalstyles']->get('level1itemnormalstylesparentitemimagerepeat', '') . ";" : "") . ($fields['level1itemnormalstyles']->get('level1itemnormalstylesparentarrowwidth', '') != '' ? "width: " . self::testUnit($fields['level1itemnormalstyles']->get('level1itemnormalstylesparentarrowwidth', '')) . ";" : "") . ($fields['level1itemnormalstyles']->get('level1itemnormalstylesparentarrowheight', '') != '' ? "height: " . self::testUnit($fields['level1itemnormalstyles']->get('level1itemnormalstylesparentarrowheight', '')) . ";" : "") . ($fields['level1itemnormalstyles']->get('level1itemnormalstylesparentarrowmargintop', '') != '' ? "margin-top: " . self::testUnit($fields['level1itemnormalstyles']->get('level1itemnormalstylesparentarrowmargintop', '')) . ";" : "") . ($fields['level1itemnormalstyles']->get('level1itemnormalstylesparentarrowmarginright', '') != '' ? "margin-right: " . self::testUnit($fields['level1itemnormalstyles']->get('level1itemnormalstylesparentarrowmarginright', '')) . ";" : "") . ($fields['level1itemnormalstyles']->get('level1itemnormalstylesparentarrowmarginbottom', '') != '' ? "margin-bottom: " . self::testUnit($fields['level1itemnormalstyles']->get('level1itemnormalstylesparentarrowmarginbottom', '')) . ";" : "") . ($fields['level1itemnormalstyles']->get('level1itemnormalstylesparentarrowmarginleft', '') != '' ? "margin-left: " . self::testUnit($fields['level1itemnormalstyles']->get('level1itemnormalstylesparentarrowmarginleft', '')) . ";" : "") . ($fields['level1itemnormalstyles']->get('level1itemnormalstylesparentarrowpositiontop', '') != '' ? "top: " . self::testUnit($fields['level1itemnormalstyles']->get('level1itemnormalstylesparentarrowpositiontop', '')) . ";" : "") . ($fields['level1itemnormalstyles']->get('level1itemnormalstylesparentarrowpositionright', '') != '' ? "right: " . self::testUnit($fields['level1itemnormalstyles']->get('level1itemnormalstylesparentarrowpositionright', '')) . ";" : "") . ($fields['level1itemnormalstyles']->get('level1itemnormalstylesparentarrowpositionbottom', '') != '' ? "bottom: " . self::testUnit($fields['level1itemnormalstyles']->get('level1itemnormalstylesparentarrowpositionbottom', '')) . ";" : "") . ($fields['level1itemnormalstyles']->get('level1itemnormalstylesparentarrowpositionleft', '') != '' ? "left: " . self::testUnit($fields['level1itemnormalstyles']->get('level1itemnormalstylesparentarrowpositionleft', '')) . ";" : "") . "} ";
             // for parent arrow hover state
             if ($fields['level1itemhoverstyles']->get('level1itemhoverstylesparentitemimage', '')) {
                 $csstoinject .= "\ndiv#" . $menuCSSID . " li.maximenuck.level1.parent:hover > a:after, div#" . $menuCSSID . " li.maximenuck.level1.parent:hover > span.separator:after { " . ($fields['level1itemhoverstyles']->get('level1itemhoverstylesparentitemimage', '') != '' ? "background-image: url(" . JUri::root(true) . "/" . $fields['level1itemhoverstyles']->get('level1itemhoverstylesparentitemimage', '') . ");" : "") . ($fields['level1itemhoverstyles']->get('level1itemhoverstylesparentitemimagepositionx', '') != '' && $fields['level1itemhoverstyles']->get('level1itemhoverstylesparentitemimagepositiony', '') != '' ? "background-position: " . $fields['level1itemhoverstyles']->get('level1itemhoverstylesparentitemimagepositionx', '') . " " . $fields['level1itemhoverstyles']->get('level1itemhoverstylesparentitemimagepositiony', '') . ";" : "") . ($fields['level1itemhoverstyles']->get('level1itemhoverstylesparentitemimagerepeat', '') != '' ? "background-repeat: " . $fields['level1itemhoverstyles']->get('level1itemhoverstylesparentitemimagerepeat', '') . ";" : "") . "} ";
             }
         } else {
             if ($fields['level1itemnormalstyles']->get('level1itemnormalstylesparentarrowtype', '') == 'none') {
                 $csstoinject .= "\ndiv#" . $menuCSSID . " li.maximenuck.level1.parent > a:after, div#" . $menuCSSID . " li.maximenuck.level1.parent > span.separator:after { " . "display: none;" . "}";
             }
         }
     }
     if ($fields['level2itemnormalstyles']->get('level2itemnormalstylesparentarrowtype', '') == 'triangle') {
         $level2itemnormalstylesparentarrowcolor = $fields['level2itemnormalstyles']->get('level2itemnormalstylesparentarrowcolor', '') ? $fields['level2itemnormalstyles']->get('level2itemnormalstylesparentarrowcolor', '') : $fields['level2itemnormalstyles']->get('level2itemnormalstylesfontcolor', '');
         // for parent arrow normal state
         if ($level2itemnormalstylesparentarrowcolor) {
             $csstoinject .= "\ndiv#" . $menuCSSID . " li.maximenuck.level1 li.maximenuck.parent > a:after, div#" . $menuCSSID . " li.maximenuck.level1 li.maximenuck.parent > span.separator:after,\n\tdiv#" . $menuID . " .maxipushdownck li.maximenuck.parent > a:after, div#" . $menuID . " .maxipushdownck li.maximenuck.parent > span.separator:after { " . "border-left-color: " . $level2itemnormalstylesparentarrowcolor . ";" . "color: " . $level2itemnormalstylesparentarrowcolor . ";" . ($fields['level2itemnormalstyles']->get('level2itemnormalstylesparentarrowmargintop', '') != '' ? "margin-top: " . self::testUnit($fields['level2itemnormalstyles']->get('level2itemnormalstylesparentarrowmargintop', '')) . ";" : "") . ($fields['level2itemnormalstyles']->get('level2itemnormalstylesparentarrowmarginright', '') != '' ? "margin-right: " . self::testUnit($fields['level2itemnormalstyles']->get('level2itemnormalstylesparentarrowmarginright', '')) . ";" : "") . ($fields['level2itemnormalstyles']->get('level2itemnormalstylesparentarrowmarginbottom', '') != '' ? "margin-bottom: " . self::testUnit($fields['level2itemnormalstyles']->get('level2itemnormalstylesparentarrowmarginbottom', '')) . ";" : "") . ($fields['level2itemnormalstyles']->get('level2itemnormalstylesparentarrowmarginleft', '') != '' ? "margin-left: " . self::testUnit($fields['level2itemnormalstyles']->get('level2itemnormalstylesparentarrowmarginleft', '')) . ";" : "") . "} ";
         }
         $level2itemhoverstylesparentarrowcolor = $fields['level2itemhoverstyles']->get('level2itemhoverstylesparentarrowcolor', '') ? $fields['level2itemhoverstyles']->get('level2itemhoverstylesparentarrowcolor', '') : $fields['level2itemhoverstyles']->get('level2itemhoverstylesfontcolor', '');
         // for parent arrow hover state
         if ($level2itemhoverstylesparentarrowcolor) {
             $csstoinject .= "\ndiv#" . $menuCSSID . " li.maximenuck.level1 li.maximenuck.parent:hover > a:after, div#" . $menuCSSID . " li.maximenuck.level1 li.maximenuck.parent:hover > span.separator:after,\n\tdiv#" . $menuID . " .maxipushdownck li.maximenuck.parent:hover > a:after, div#" . $menuID . " .maxipushdownck li.maximenuck.parent:hover > span.separator:after { " . "border-color: transparent transparent transparent " . $level2itemhoverstylesparentarrowcolor . ";" . "color: " . $level2itemhoverstylesparentarrowcolor . ";" . "} ";
         }
     } else {
         if ($fields['level2itemnormalstyles']->get('level2itemnormalstylesparentarrowtype', '') == 'image') {
             // for parent arrow normal state
             $csstoinject .= "\ndiv#" . $menuCSSID . " li.maximenuck.level1 li.maximenuck.parent > a:after, div#" . $menuCSSID . " li.maximenuck.level1 li.maximenuck.parent > span.separator:after,\n\tdiv#" . $menuID . " .maxipushdownck li.maximenuck.parent > a:after, div#" . $menuID . " .maxipushdownck li.maximenuck.parent > span.separator:after { " . "border: none;" . "display:block;" . "position:absolute;" . ($fields['level2itemnormalstyles']->get('level2itemnormalstylesparentitemimage', '') != '' ? "background-image: url(" . JUri::root(true) . "/" . $fields['level2itemnormalstyles']->get('level2itemnormalstylesparentitemimage', '') . ");" : "") . ($fields['level2itemnormalstyles']->get('level2itemnormalstylesparentitemimagepositionx', '') != '' && $fields['level2itemnormalstyles']->get('level2itemnormalstylesparentitemimagepositiony', '') != '' ? "background-position: " . $fields['level2itemnormalstyles']->get('level2itemnormalstylesparentitemimagepositionx', '') . " " . $fields['level2itemnormalstyles']->get('level2itemnormalstylesparentitemimagepositiony', '') . ";" : "") . ($fields['level2itemnormalstyles']->get('level2itemnormalstylesparentitemimagerepeat', '') != '' ? "background-repeat: " . $fields['level2itemnormalstyles']->get('level2itemnormalstylesparentitemimagerepeat', '') . ";" : "") . ($fields['level2itemnormalstyles']->get('level2itemnormalstylesparentarrowwidth', '') != '' ? "width: " . self::testUnit($fields['level2itemnormalstyles']->get('level2itemnormalstylesparentarrowwidth', '')) . ";" : "") . ($fields['level2itemnormalstyles']->get('level2itemnormalstylesparentarrowheight', '') != '' ? "height: " . self::testUnit($fields['level2itemnormalstyles']->get('level2itemnormalstylesparentarrowheight', '')) . ";" : "") . ($fields['level2itemnormalstyles']->get('level2itemnormalstylesparentarrowmargintop', '') != '' ? "margin-top: " . self::testUnit($fields['level2itemnormalstyles']->get('level2itemnormalstylesparentarrowmargintop', '')) . ";" : "") . ($fields['level2itemnormalstyles']->get('level2itemnormalstylesparentarrowmarginright', '') != '' ? "margin-right: " . self::testUnit($fields['level2itemnormalstyles']->get('level2itemnormalstylesparentarrowmarginright', '')) . ";" : "") . ($fields['level2itemnormalstyles']->get('level2itemnormalstylesparentarrowmarginbottom', '') != '' ? "margin-bottom: " . self::testUnit($fields['level2itemnormalstyles']->get('level2itemnormalstylesparentarrowmarginbottom', '')) . ";" : "") . ($fields['level2itemnormalstyles']->get('level2itemnormalstylesparentarrowmarginleft', '') != '' ? "margin-left: " . self::testUnit($fields['level2itemnormalstyles']->get('level2itemnormalstylesparentarrowmarginleft', '')) . ";" : "") . ($fields['level2itemnormalstyles']->get('level2itemnormalstylesparentarrowpositiontop', '') != '' ? "top: " . self::testUnit($fields['level2itemnormalstyles']->get('level2itemnormalstylesparentarrowpositiontop', '')) . ";" : "") . ($fields['level2itemnormalstyles']->get('level2itemnormalstylesparentarrowpositionright', '') != '' ? "right: " . self::testUnit($fields['level2itemnormalstyles']->get('level2itemnormalstylesparentarrowpositionright', '')) . ";" : "") . ($fields['level2itemnormalstyles']->get('level2itemnormalstylesparentarrowpositionbottom', '') != '' ? "bottom: " . self::testUnit($fields['level2itemnormalstyles']->get('level2itemnormalstylesparentarrowpositionbottom', '')) . ";" : "") . ($fields['level2itemnormalstyles']->get('level2itemnormalstylesparentarrowpositionleft', '') != '' ? "left: " . self::testUnit($fields['level2itemnormalstyles']->get('level2itemnormalstylesparentarrowpositionleft', '')) . ";" : "") . "} ";
             // for parent arrow hover state
             if ($fields['level2itemhoverstyles']->get('level2itemhoverstylesparentitemimage', '')) {
                 $csstoinject .= "\ndiv#" . $menuCSSID . " li.maximenuck.level1 li.maximenuck.parent:hover > a:after, div#" . $menuCSSID . " li.maximenuck.level1 li.maximenuck.parent:hover > span.separator:after,\n\tdiv#" . $menuID . " .maxipushdownck li.maximenuck.parent:hover > a:after, div#" . $menuID . " .maxipushdownck li.maximenuck.parent:hover > span.separator:after { " . ($fields['level2itemhoverstyles']->get('level2itemhoverstylesparentitemimage', '') != '' ? "background-image: url(" . JUri::root(true) . "/" . $fields['level2itemhoverstyles']->get('level2itemhoverstylesparentitemimage', '') . ");" : "") . ($fields['level2itemhoverstyles']->get('level2itemhoverstylesparentitemimagepositionx', '') != '' && $fields['level2itemhoverstyles']->get('level2itemhoverstylesparentitemimagepositiony', '') != '' ? "background-position: " . $fields['level2itemhoverstyles']->get('level2itemhoverstylesparentitemimagepositionx', '') . " " . $fields['level2itemhoverstyles']->get('level2itemhoverstylesparentitemimagepositiony', '') . ";" : "") . ($fields['level2itemhoverstyles']->get('level2itemhoverstylesparentitemimagerepeat', '') != '' ? "background-repeat: " . $fields['level2itemhoverstyles']->get('level2itemhoverstylesparentitemimagerepeat', '') . ";" : "") . "} ";
             }
         } else {
             if ($fields['level2itemnormalstyles']->get('level2itemnormalstylesparentarrowtype', '') == 'none') {
                 $csstoinject .= "\ndiv#" . $menuCSSID . " li.maximenuck.level1 li.maximenuck.parent > a:after, div#" . $menuCSSID . " li.maximenuck.level1 li.maximenuck.parent > span.separator:after,\n\tdiv#" . $menuID . " .maxipushdownck li.maximenuck.parent > a:after, div#" . $menuID . " .maxipushdownck li.maximenuck.parent > span.separator:after { " . "display: none;" . "}";
             }
         }
     }
     // root styles
     if (isset($css->menustyles)) {
         if ($css->menustyles['padding'] || $css->menustyles['margin'] || $css->menustyles['background'] || $css->menustyles['gradient'] || $css->menustyles['borderradius'] || $css->menustyles['shadow'] || $css->menustyles['border'] || $css->menustyles['text-align']) {
             $csstoinject .= "\ndiv#" . $menuCSSID . " { " . $css->menustyles['padding'] . $css->menustyles['margin'] . $css->menustyles['background'] . $css->menustyles['gradient'] . $css->menustyles['borderradius'] . $css->menustyles['shadow'] . $css->menustyles['border'] . $css->menustyles['text-align'] . " } ";
         }
         if ($css->menustyles['fontcolor'] || $css->menustyles['fontsize'] || $css->menustyles['textshadow']) {
             $csstoinject .= "\ndiv#" . $menuCSSID . " li.maximenuck > a span.titreck, div#" . $menuCSSID . " li.maximenuck > span.separator span.titreck,\ndiv#" . $menuID . " .maxipushdownck li.maximenuck > a span.titreck, div#" . $menuID . " .maxipushdownck li.maximenuck > span.separator span.titreck { " . $css->menustyles['fontcolor'] . $css->menustyles['fontsize'] . $css->menustyles['textshadow'] . " } ";
         }
         if ($css->menustyles['descfontcolor'] || $css->menustyles['descfontsize']) {
             $csstoinject .= "\ndiv#" . $menuCSSID . " li.maximenuck > a span.descck, div#" . $menuCSSID . " li.maximenuck > span.separator span.descck,\ndiv#" . $menuID . " .maxipushdownck li.maximenuck > a span.descck, div#" . $menuID . " .maxipushdownck li.maximenuck > span.separator span.descck { " . $css->menustyles['descfontcolor'] . $css->menustyles['descfontsize'] . " } ";
         }
     }
     // level1 normal items styles
     if (isset($css->level1itemnormalstyles)) {
         if ($css->level1itemnormalstyles['padding'] || $css->level1itemnormalstyles['margin'] || $css->level1itemnormalstyles['background'] || $css->level1itemnormalstyles['gradient'] || $css->level1itemnormalstyles['borderradius'] || $css->level1itemnormalstyles['shadow'] || $css->level1itemnormalstyles['border']) {
             $csstoinject .= "\ndiv#" . $menuCSSID . " li.maximenuck.level1, div#" . $menuCSSID . " li.maximenuck.level1.parent { " . $css->level1itemnormalstyles['margin'] . $css->level1itemnormalstyles['background'] . $css->level1itemnormalstyles['gradient'] . $css->level1itemnormalstyles['borderradius'] . $css->level1itemnormalstyles['shadow'] . $css->level1itemnormalstyles['border'] . " } ";
             $csstoinject .= "\ndiv#" . $menuCSSID . " li.maximenuck.level1 > a, div#" . $menuCSSID . " li.maximenuck.level1 > span.separator { " . $css->level1itemnormalstyles['padding'] . " } ";
         }
         if ($css->level1itemnormalstyles['fontcolor'] || $css->level1itemnormalstyles['fontsize'] || $css->level1itemnormalstyles['textshadow'] || $css->level1itemnormalstyles['text-transform']) {
             $csstoinject .= "\ndiv#" . $menuCSSID . " li.maximenuck.level1 > a span.titreck, div#" . $menuCSSID . " li.maximenuck.level1 > span.separator span.titreck { " . $css->level1itemnormalstyles['fontcolor'] . $css->level1itemnormalstyles['fontsize'] . $css->level1itemnormalstyles['fontweight'] . $css->level1itemnormalstyles['textshadow'] . $css->level1itemnormalstyles['text-transform'] . " } ";
         }
         if ($css->level1itemnormalstyles['descfontcolor'] || $css->level1itemnormalstyles['descfontsize']) {
             $csstoinject .= "\ndiv#" . $menuCSSID . " li.maximenuck.level1 > a span.descck, div#" . $menuCSSID . " li.maximenuck.level1 > span.separator span.descck { " . $css->level1itemnormalstyles['descfontcolor'] . $css->level1itemnormalstyles['descfontsize'] . " } ";
         }
     }
     // level1 hover items styles
     if (isset($fields['level1itemactivestyles']) && $fields['level1itemactivestyles']->get('level1itemactivestylesidemhover') == '1') {
         $level1active_li = "\ndiv#" . $menuCSSID . " li.maximenuck.level1.active, div#" . $menuCSSID . " li.maximenuck.level1.parent.active, ";
         $level1active_li_a = "\ndiv#" . $menuCSSID . " li.maximenuck.level1.active > a, div#" . $menuCSSID . " li.maximenuck.level1.active > span, ";
         $level1active_titreck = "\ndiv#" . $menuCSSID . " li.maximenuck.level1.active > a span.titreck, div#" . $menuCSSID . " li.maximenuck.level1.active > span.separator span.titreck, ";
         $level1active_descck = "\ndiv#" . $menuCSSID . " li.maximenuck.level1.active > a span.descck, div#" . $menuCSSID . " li.maximenuck.level1.active > span.separator span.descck, ";
     } else {
         $level1active_li = "";
         $level1active_li_a = "";
         $level1active_titreck = "";
         $level1active_descck = "";
     }
     if (isset($css->level1itemhoverstyles)) {
         if ($css->level1itemhoverstyles['padding'] || $css->level1itemhoverstyles['margin'] || $css->level1itemhoverstyles['background'] || $css->level1itemhoverstyles['gradient'] || $css->level1itemhoverstyles['borderradius'] || $css->level1itemhoverstyles['shadow'] || $css->level1itemhoverstyles['border']) {
             $csstoinject .= $level1active_li . "\ndiv#" . $menuCSSID . " li.maximenuck.level1:hover, div#" . $menuCSSID . " li.maximenuck.level1.parent:hover { " . $css->level1itemhoverstyles['margin'] . $css->level1itemhoverstyles['background'] . $css->level1itemhoverstyles['gradient'] . $css->level1itemhoverstyles['borderradius'] . $css->level1itemhoverstyles['shadow'] . $css->level1itemhoverstyles['border'] . " } ";
             $csstoinject .= $level1active_li_a . "\ndiv#" . $menuCSSID . " li.maximenuck.level1:hover > a, div#" . $menuCSSID . " li.maximenuck.level1:hover > span.separator { " . $css->level1itemhoverstyles['padding'] . " } ";
         }
         if ($css->level1itemhoverstyles['fontcolor'] || $css->level1itemhoverstyles['fontsize'] || $css->level1itemhoverstyles['textshadow']) {
             $csstoinject .= $level1active_titreck . "\ndiv#" . $menuCSSID . " li.maximenuck.level1:hover > a span.titreck, div#" . $menuCSSID . " li.maximenuck.level1:hover > span.separator span.titreck { " . $css->level1itemhoverstyles['fontcolor'] . $css->level1itemhoverstyles['fontsize'] . $css->level1itemhoverstyles['fontweight'] . $css->level1itemhoverstyles['textshadow'] . " } ";
         }
         if ($css->level1itemhoverstyles['descfontcolor'] || $css->level1itemhoverstyles['descfontsize']) {
             $csstoinject .= $level1active_descck . "\ndiv#" . $menuCSSID . " li.maximenuck.level1:hover > a span.descck, div#" . $menuCSSID . " li.maximenuck.level1:hover > span.separator span.descck { " . $css->level1itemhoverstyles['descfontcolor'] . $css->level1itemhoverstyles['descfontsize'] . " } ";
         }
     }
     if (isset($fields['level1itemactivestyles']) && $fields['level1itemactivestyles']->get('level1itemactivestylesidemhover') == '0') {
         // level1 active items styles
         if (isset($css->level1itemactivestyles)) {
             if ($css->level1itemactivestyles['padding'] || $css->level1itemactivestyles['margin'] || $css->level1itemactivestyles['background'] || $css->level1itemactivestyles['gradient'] || $css->level1itemactivestyles['borderradius'] || $css->level1itemactivestyles['shadow'] || $css->level1itemactivestyles['border']) {
                 $csstoinject .= "\ndiv#" . $menuCSSID . " li.maximenuck.level1.active { " . $css->level1itemactivestyles['margin'] . $css->level1itemactivestyles['background'] . $css->level1itemactivestyles['gradient'] . $css->level1itemactivestyles['borderradius'] . $css->level1itemactivestyles['shadow'] . $css->level1itemactivestyles['border'] . " } ";
                 $csstoinject .= "\ndiv#" . $menuCSSID . " li.maximenuck.level1.active > a, div#" . $menuCSSID . " li.maximenuck.level1.active > span.separator { " . $css->level1itemactivestyles['padding'] . " } ";
             }
             if ($css->level1itemactivestyles['fontcolor'] || $css->level1itemactivestyles['fontsize'] || $css->level1itemactivestyles['textshadow']) {
                 $csstoinject .= "\ndiv#" . $menuCSSID . " li.maximenuck.level1.active > a span.titreck, div#" . $menuCSSID . " li.maximenuck.level1.active > span.separator span.titreck { " . $css->level1itemactivestyles['fontcolor'] . $css->level1itemactivestyles['fontsize'] . $css->level1itemactivestyles['fontweight'] . $css->level1itemactivestyles['textshadow'] . " } ";
             }
             if ($css->level1itemactivestyles['descfontcolor'] || $css->level1itemactivestyles['descfontsize']) {
                 $csstoinject .= "\ndiv#" . $menuCSSID . " li.maximenuck.level1.active > a span.descck, div#" . $menuCSSID . " li.maximenuck.level1.active > span.separator span.descck { " . $css->level1itemactivestyles['descfontcolor'] . $css->level1itemactivestyles['descfontsize'] . " } ";
             }
         }
     }
     // submenu styles
     if (isset($css->level2menustyles)) {
         if ($css->level2menustyles['padding'] || $css->level2menustyles['margin'] || $css->level2menustyles['background'] || $css->level2menustyles['gradient'] || $css->level2menustyles['borderradius'] || $css->level2menustyles['shadow'] || $css->level2menustyles['border']) {
             $csstoinject .= "\ndiv#" . $menuCSSID . " li.maximenuck div.floatck, div#" . $menuCSSID . " li.maximenuck div.floatck div.floatck,\ndiv#" . $menuID . " .maxipushdownck div.floatck { " . $css->level2menustyles['padding'] . $css->level2menustyles['margin'] . $css->level2menustyles['background'] . $css->level2menustyles['gradient'] . $css->level2menustyles['borderradius'] . $css->level2menustyles['shadow'] . $css->level2menustyles['border'] . " } ";
         }
     }
     // level2 normal items styles
     if (isset($css->level2itemnormalstyles)) {
         if ($css->level2itemnormalstyles['padding'] || $css->level2itemnormalstyles['margin'] || $css->level2itemnormalstyles['background'] || $css->level2itemnormalstyles['gradient'] || $css->level2itemnormalstyles['borderradius'] || $css->level2itemnormalstyles['shadow'] || $css->level2itemnormalstyles['border']) {
             $csstoinject .= "\ndiv#" . $menuCSSID . " li.maximenuck.level1 li.maximenuck:not(.headingck), div#" . $menuID . " li.maximenuck.maximenuflatlistck:not(.level1):not(.headingck),\ndiv#" . $menuID . " .maxipushdownck li.maximenuck:not(.headingck) { " . $css->level2itemnormalstyles['margin'] . $css->level2itemnormalstyles['background'] . $css->level2itemnormalstyles['gradient'] . $css->level2itemnormalstyles['borderradius'] . $css->level2itemnormalstyles['shadow'] . $css->level2itemnormalstyles['border'] . " } ";
             $csstoinject .= "\ndiv#" . $menuCSSID . " li.maximenuck.level1 li.maximenuck:not(.headingck) > a, div#" . $menuID . " li.maximenuck.maximenuflatlistck:not(.level1):not(.headingck) > a,\ndiv#" . $menuID . " .maxipushdownck li.maximenuck:not(.headingck) > a, ndiv#" . $menuCSSID . " li.maximenuck.level1 li.maximenuck:not(.headingck) > span.separator, div#" . $menuID . " li.maximenuck.maximenuflatlistck:not(.level1):not(.headingck) > span.separator,\ndiv#" . $menuID . " .maxipushdownck li.maximenuck:not(.headingck) > span.separator { " . $css->level2itemnormalstyles['padding'] . " } ";
         }
         if ($css->level2itemnormalstyles['fontcolor'] || $css->level2itemnormalstyles['fontsize'] || $css->level2itemnormalstyles['textshadow'] || $css->level2itemnormalstyles['text-transform']) {
             $csstoinject .= "\ndiv#" . $menuCSSID . " li.maximenuck.level1 li.maximenuck > a span.titreck, div#" . $menuCSSID . " li.maximenuck.level1 li.maximenuck > span.separator span.titreck, div#" . $menuID . " li.maximenuck.maximenuflatlistck:not(.level1) span.titreck,\ndiv#" . $menuID . " .maxipushdownck li.maximenuck > a span.titreck, div#" . $menuID . " .maxipushdownck li.maximenuck > span.separator span.titreck { " . $css->level2itemnormalstyles['fontcolor'] . $css->level2itemnormalstyles['fontsize'] . $css->level2itemnormalstyles['fontweight'] . $css->level2itemnormalstyles['textshadow'] . $css->level2itemnormalstyles['text-transform'] . " } ";
         }
         if ($css->level2itemnormalstyles['descfontcolor'] || $css->level2itemnormalstyles['descfontsize']) {
             $csstoinject .= "\ndiv#" . $menuCSSID . " li.maximenuck.level1 li.maximenuck > a span.descck, div#" . $menuCSSID . " li.maximenuck.level1 li.maximenuck > span.separator span.descck, div#" . $menuID . " li.maximenuck.maximenuflatlistck:not(.level1) span.descck,\ndiv#" . $menuID . " .maxipushdownck li.maximenuck > a span.descck, div#" . $menuID . " .maxipushdownck li.maximenuck > span.separator span.descck { " . $css->level2itemnormalstyles['descfontcolor'] . $css->level2itemnormalstyles['descfontsize'] . " } ";
         }
     }
     // level2 hover items styles
     if (isset($fields['level2itemactivestyles']) && $fields['level2itemactivestyles']->get('level2itemactivestylesidemhover') == '1') {
         $level2active_li = "\ndiv#" . $menuCSSID . " li.maximenuck.level2.active:not(.headingck), div#" . $menuCSSID . " li.maximenuck.level2.parent.active:not(.headingck), div#" . $menuID . " li.maximenuck.maximenuflatlistck.active:not(.level1):not(.headingck),";
         $level2active_li_a = "\ndiv#" . $menuCSSID . " li.maximenuck.level2.active:not(.headingck), div#" . $menuCSSID . " li.maximenuck.level2.parent.active:not(.headingck), div#" . $menuID . " li.maximenuck.maximenuflatlistck.active:not(.level1):not(.headingck),";
         $level2active_titreck = "\ndiv#" . $menuCSSID . " li.maximenuck.level2.active > a span.titreck, div#" . $menuCSSID . " li.maximenuck.level2.active > span.separator span.titreck, div#" . $menuID . " li.maximenuck.maximenuflatlistck.active:not(.level1) span.titreck,";
         $level2active_descck = "\ndiv#" . $menuCSSID . " li.maximenuck.level2.active > a span.descck, div#" . $menuCSSID . " li.maximenuck.level2.active > span.separator span.descck, div#" . $menuID . " li.maximenuck.maximenuflatlistck.active:not(.level1) span.descck,";
     } else {
         $level2active_li = "";
         $level2active_li_a = "";
         $level2active_titreck = "";
         $level2active_descck = "";
     }
     if (isset($css->level2itemhoverstyles)) {
         if ($css->level2itemhoverstyles['padding'] || $css->level2itemhoverstyles['margin'] || $css->level2itemhoverstyles['background'] || $css->level2itemhoverstyles['gradient'] || $css->level2itemhoverstyles['borderradius'] || $css->level2itemhoverstyles['shadow'] || $css->level2itemhoverstyles['border']) {
             $csstoinject .= $level2active_li . "\ndiv#" . $menuID . " ul.maximenuck li.maximenuck.level1 li.maximenuck:not(.headingck):hover, div#" . $menuID . " li.maximenuck.maximenuflatlistck:hover:not(.level1):not(.headingck):hover,\ndiv#" . $menuID . " .maxipushdownck li.maximenuck:not(.headingck):hover { " . $css->level2itemhoverstyles['margin'] . $css->level2itemhoverstyles['background'] . $css->level2itemhoverstyles['gradient'] . $css->level2itemhoverstyles['borderradius'] . $css->level2itemhoverstyles['shadow'] . $css->level2itemhoverstyles['border'] . " } ";
             $csstoinject .= $level2active_li_a . "\ndiv#" . $menuID . " ul.maximenuck li.maximenuck.level1 li.maximenuck:not(.headingck):hover > a, div#" . $menuID . " li.maximenuck.maximenuflatlistck:hover:not(.level1):not(.headingck):hover > a,\ndiv#" . $menuID . " .maxipushdownck li.maximenuck:not(.headingck):hover > a, div#" . $menuID . " ul.maximenuck li.maximenuck.level1 li.maximenuck:not(.headingck):hover > span.separator, div#" . $menuID . " li.maximenuck.maximenuflatlistck:hover:not(.level1):not(.headingck):hover > span.separator,\ndiv#" . $menuID . " .maxipushdownck li.maximenuck:not(.headingck):hover > span.separator { " . $css->level2itemhoverstyles['padding'] . " } ";
         }
         if ($css->level2itemhoverstyles['fontcolor'] || $css->level2itemhoverstyles['fontsize'] || $css->level2itemhoverstyles['textshadow']) {
             $csstoinject .= $level2active_titreck . "\ndiv#" . $menuCSSID . " li.maximenuck.level1 li.maximenuck:hover > a span.titreck, div#" . $menuCSSID . " li.maximenuck.level1 li.maximenuck:hover > span.separator span.titreck, div#" . $menuID . " li.maximenuck.maximenuflatlistck:hover:not(.level1) span.titreck,\ndiv#" . $menuID . " .maxipushdownck li.maximenuck:hover > a span.titreck, div#" . $menuID . " .maxipushdownck li.maximenuck:hover > span.separator span.titreck { " . $css->level2itemhoverstyles['fontcolor'] . $css->level2itemhoverstyles['fontsize'] . $css->level2itemhoverstyles['fontweight'] . $css->level2itemhoverstyles['textshadow'] . " } ";
         }
         if ($css->level2itemhoverstyles['descfontcolor'] || $css->level2itemhoverstyles['descfontsize']) {
             $csstoinject .= $level2active_descck . "\ndiv#" . $menuCSSID . " li.maximenuck.level1 li.maximenuck:hover > a span.descck, div#" . $menuCSSID . " li.maximenuck.level1 li.maximenuck:hover > span.separator span.descck, div#" . $menuID . " li.maximenuck.maximenuflatlistck:hover:not(.level1) span.descck,\ndiv#" . $menuID . " .maxipushdownck li.maximenuck:hover > a span.descck, div#" . $menuID . " .maxipushdownck li.maximenuck:hover > span.separator span.descck { " . $css->level2itemhoverstyles['descfontcolor'] . $css->level2itemhoverstyles['descfontsize'] . " } ";
         }
     }
     if (isset($fields['level2itemactivestyles']) && $fields['level2itemactivestyles']->get('level2itemactivestylesidemhover') == '0') {
         // level2 active items styles
         if (isset($css->level2itemactivestyles)) {
             if ($css->level2itemactivestyles['padding'] || $css->level2itemactivestyles['margin'] || $css->level2itemactivestyles['background'] || $css->level2itemactivestyles['gradient'] || $css->level2itemactivestyles['borderradius'] || $css->level2itemactivestyles['shadow'] || $css->level2itemactivestyles['border']) {
                 $csstoinject .= "\ndiv#" . $menuCSSID . " li.maximenuck.level1 li.maximenuck.active:not(.headingck),\n\tdiv#" . $menuID . " .maxipushdownck li.maximenuck.active:not(.headingck) { " . $css->level2itemactivestyles['margin'] . $css->level2itemactivestyles['background'] . $css->level2itemactivestyles['gradient'] . $css->level2itemactivestyles['borderradius'] . $css->level2itemactivestyles['shadow'] . $css->level2itemactivestyles['border'] . " } ";
                 $csstoinject .= "\ndiv#" . $menuCSSID . " li.maximenuck.level1 li.maximenuck.active:not(.headingck) > a,\n\tdiv#" . $menuID . " .maxipushdownck li.maximenuck.active:not(.headingck) > a, div#" . $menuCSSID . " li.maximenuck.level1 li.maximenuck.active:not(.headingck) > span.separator,\n\tdiv#" . $menuID . " .maxipushdownck li.maximenuck.active:not(.headingck) > span.separator { " . $css->level2itemactivestyles['padding'] . " } ";
             }
             if ($css->level2itemactivestyles['fontcolor'] || $css->level2itemactivestyles['fontsize'] || $css->level2itemactivestyles['textshadow']) {
                 $csstoinject .= "\ndiv#" . $menuCSSID . " li.maximenuck.level1 li.maximenuck.active > a span.titreck, div#" . $menuCSSID . " li.maximenuck.level1 li.maximenuck.active > span.separator span.titreck,\n\tdiv#" . $menuID . " .maxipushdownck li.maximenuck.active > a span.titreck, div#" . $menuID . " .maxipushdownck li.maximenuck.active > span.separator span.titreck { " . $css->level2itemactivestyles['fontcolor'] . $css->level2itemactivestyles['fontsize'] . $css->level2itemactivestyles['fontweight'] . $css->level2itemactivestyles['textshadow'] . " } ";
             }
             if ($css->level2itemactivestyles['descfontcolor'] || $css->level2itemactivestyles['descfontsize']) {
                 $csstoinject .= "\ndiv#" . $menuCSSID . " li.maximenuck.level1 li.maximenuck.active > a span.descck, div#" . $menuCSSID . " li.maximenuck.level1 li.maximenuck.active > span.separator span.descck,\n\tdiv#" . $menuID . " .maxipushdownck li.maximenuck.active > a span.descck, div#" . $menuID . " .maxipushdownck li.maximenuck.active > span.separator span.descck { " . $css->level2itemactivestyles['descfontcolor'] . $css->level2itemactivestyles['descfontsize'] . " } ";
             }
         }
     }
     // heading items styles
     if (isset($css->headingstyles)) {
         $headingclass = '.separator';
         $padding = $css->headingstyles['padding'] ? trim($css->headingstyles['padding'], ";") . ";" : '';
         $margin = $css->headingstyles['margin'] ? trim($css->headingstyles['margin'], ";") . ";" : '';
         $background = $css->headingstyles['background'] ? trim($css->headingstyles['background'], ";") . ";" : '';
         $gradient = $css->headingstyles['gradient'] ? trim($css->headingstyles['gradient'], ";") . ";" : '';
         $borderradius = $css->headingstyles['borderradius'] ? trim($css->headingstyles['borderradius'], ";") . ";" : '';
         $shadow = $css->headingstyles['shadow'] ? trim($css->headingstyles['shadow'], ";") . ";" : '';
         $border = $css->headingstyles['border'] ? trim($css->headingstyles['border'], ";") . ";" : '';
         $csstoinject .= "\ndiv#" . $menuCSSID . " ul.maximenuck2 li.maximenuck > " . $headingclass . ",\ndiv#" . $menuID . " .maxipushdownck ul.maximenuck2 li.maximenuck > " . $headingclass . " { " . $padding . $margin . $background . $gradient . $borderradius . $shadow . $border . $css->headingstyles['text-align'] . " } ";
         $csstoinject .= "\ndiv#" . $menuCSSID . " ul.maximenuck2 li.maximenuck > " . $headingclass . " span.titreck,\ndiv#" . $menuID . " .maxipushdownck ul.maximenuck2 li.maximenuck > " . $headingclass . " span.titreck { " . $css->headingstyles['fontcolor'] . $css->headingstyles['fontsize'] . $css->headingstyles['fontweight'] . $css->headingstyles['textshadow'] . " } ";
         $csstoinject .= "\ndiv#" . $menuCSSID . " ul.maximenuck2 li.maximenuck > " . $headingclass . " span.descck,\ndiv#" . $menuID . " .maxipushdownck ul.maximenuck2 li.maximenuck > " . $headingclass . " span.descck{ " . $css->headingstyles['descfontcolor'] . $css->headingstyles['descfontsize'] . " } ";
     }
     return $csstoinject;
 }
Ejemplo n.º 7
0
    $fixedcss = "div#" . $menuID . ".maximenufixed {\n        position: fixed !important;\n        left: 0 !important;\n        " . $fixedcssposition . "\n        right: 0 !important;\n        z-index: 1000 !important;\n    }";
    if ($menuposition == 'topfixed') {
        $fixedcss .= "div#" . $menuID . ".maximenufixed ul.maximenuck {\n            top: 0 !important;\n        }";
    } else {
        if ($menuposition == 'bottomfixed') {
            $fxdirection = 'inverse';
        }
    }
    //$topfixedmenu = $params->get('topfixedmenu', '0');
    //if ($topfixedmenu)
    $document->addStyleDeclaration($fixedcss);
}
// get the css from the plugin params and inject them
// if (JPluginHelper::isEnabled('system', 'maximenuckparams')) {
if (file_exists(JPATH_ROOT . '/administrator/components/com_maximenuck/maximenuck.php')) {
    modMaximenuckHelper::injectModuleCss($params, $menuID);
}
// add compatibility css for templates
$templatelayer = $params->get('templatelayer', 'beez3-position1');
if ($templatelayer != -1) {
    $document->addStyleSheet(JURI::base(true) . '/modules/mod_maximenuck/templatelayers/' . $templatelayer . '.css');
}
// add responsive css
if ($orientation == 'horizontal' && $params->get('useresponsive', '1') == '1') {
    $document->addStyleSheet(JURI::base(true) . '/modules/mod_maximenuck/assets/maximenuresponsiveck.css');
}
JHTML::_("jquery.framework", true);
JHTML::_("jquery.ui");
if ($usejavascript && $params->get('layout', 'default') != '_:flatlist' && $params->get('layout', 'default') != '_:nativejoomla' && $params->get('layout', 'default') != '_:dropselect') {
    $document->addScript(JURI::base(true) . '/modules/mod_maximenuck/assets/maximenuck.js');
    if ($fxtransition != 'linear' || $fancytransition != 'linear') {
Ejemplo n.º 8
0
     $item->styles .= "width:" . modMaximenuckHelper::testUnit($item->submenuswidth) . ";";
 }
 if (isset($item->colbgcolor) && $item->colbgcolor) {
     $item->styles .= "background:" . $item->colbgcolor . ";";
 }
 // if (isset($item->submenucontainerheight) && $item->submenucontainerheight)
 // $item->innerstyles .= "height:" . modMaximenuckHelper::testUnit($item->submenucontainerheight) . ";";
 if ($item->level > 1) {
     $item->styles .= "top:0;bottom:0;";
 }
 if (isset($previous) && $previous->deeper && $item->level == 2) {
     $item->styles .= "display:block;";
 }
 if ($item->level >= 2) {
     if (isset($item->parent_id) && !isset($column_width->{$item->parent_id})) {
         $column_width->{$item->parent_id} = isset($item->columnwidth) ? modMaximenuckHelper::testUnit($item->columnwidth) : "100%";
     }
     if (isset($item->parent_id) && isset($column_width->{$item->parent_id})) {
         $item->styles .= "left:" . $column_width->{$item->parent_id} . ";";
     } else {
         $item->styles .= "left:100%;";
     }
 }
 $item->styles .= "\"";
 // $item->innerstyles .= "\"";
 // } else {
 // $item->styles = "";
 // $item->innerstyles = "";
 // }
 echo "\n\t<div class=\"floatck\" " . $item->styles . ">" . $close . "<div class=\"maxidrop-top\"><div class=\"maxidrop-top2\"></div></div><div class=\"maxidrop-main\" style=\"width:auto;\"><div class=\"maxidrop-main2\"><div class=\"maximenuck2 first \" " . $nextcolumnstyles . ">\n\t<ul class=\"maximenuck2\" style=\"" . $ulstyles . "\">";
 // if (isset($item->coltitle))