Bläddra i källkod

- Template menus with now template (!) act as simple separators in the menu... should use MenuGroup to be not top-level instead (??)

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@559 a333f486-631f-4898-b8df-5754b55c2be0
dflaven 15 år sedan
förälder
incheckning
20be4b9dc4
2 ändrade filer med 23 tillägg och 2 borttagningar
  1. 17 2
      application/menunode.class.inc.php
  2. 6 0
      css/light-grey.css

+ 17 - 2
application/menunode.class.inc.php

@@ -130,9 +130,18 @@ class ApplicationMenu
 		{
 			$index = $aMenu['index'];
 			$oMenu = self::GetMenuNode($index);
-			$oPage->AddToMenu('<li><a href="'.$oMenu->GetHyperlink($aExtraParams).'">'.$oMenu->GetTitle().'</a></li>');
-			$aCurrentMenu = self::$aMenusIndex[$index];
 			$aChildren = self::GetChildren($index);
+			$sCSSClass = (count($aChildren) > 0) ? ' class="submenu"' : '';
+			$sHyperlink = $oMenu->GetHyperlink($aExtraParams);
+			if ($sHyperlink != '')
+			{
+				$oPage->AddToMenu('<li'.$sCSSClass.'><a href="'.$oMenu->GetHyperlink($aExtraParams).'">'.$oMenu->GetTitle().'</a></li>');
+			}
+			else
+			{
+				$oPage->AddToMenu('<li'.$sCSSClass.'>'.$oMenu->GetTitle().'</li>');
+			}
+			$aCurrentMenu = self::$aMenusIndex[$index];
 			if ($iActiveMenu == $index)
 			{
 				$bActive = true;
@@ -355,6 +364,12 @@ class TemplateMenuNode extends MenuNode
 		$this->sTemplateFile = $sTemplateFile;
 	}
 	
+	public function GetHyperlink($aExtraParams)
+	{
+		if ($this->sTemplateFile == '') return '';
+		return parent::GetHyperlink($aExtraParams);
+	}
+	
 	public function RenderContent(WebPage $oPage, $aExtraParams = array())
 	{
 		$sTemplate = @file_get_contents($this->sTemplateFile);

+ 6 - 0
css/light-grey.css

@@ -236,6 +236,11 @@ input.textSearch {
 .ui-accordion-content ul {
     list-style:none;
     padding-left:16px;
+	margin-top: 8px;
+}	
+
+.ui-accordion-content li.submenu {
+	margin-top: 8px;
 }	
 
 .ui-accordion-content ul ul {
@@ -244,6 +249,7 @@ input.textSearch {
     list-style:none;
     border: 0;
 }	
+	
 .nothing {
     noborder-top: 1px solid #8b8b8b;
     padding: 4px 0px 0px 16px;