Code

Updated Menu generation
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 26 Feb 2010 15:20:20 +0000 (15:20 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 26 Feb 2010 15:20:20 +0000 (15:20 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15761 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/html/main.php
gosa-core/ihtml/themes/modern/framework.tpl
gosa-core/include/class_pluglist.inc

index f66b548e7a8be43e8dc87ebd0d7367e8b8c83b5f..56ca32356bebd3105c62e157ad47f8a322c62016 100644 (file)
@@ -300,6 +300,7 @@ if($reload_navigation){
   $plist->menu="";
 }
 $smarty->assign ("menu", $plist->gen_menu());
+$smarty->assign ("pathMenu", $plist->genPathMenu());
 $smarty->assign ("plug", "$plug");
 
 $smarty->assign("iePngWorkaround", $config->get_cfg_value("iePngWorkaround","false" ) == "true");
index e098fb7851ae51a7b95b2b12babab6969ba56b0c..78ed0e1fc62f377f9a3a3467420396d1be67b130 100644 (file)
   <form action='main.php{$plug}' name='mainform' method='post' enctype='multipart/form-data'>
   {$menu}
 
+
   {$msg_dialogs}
 
   <!-- Plugin area -->
   <div class='plugin-area'>
-    <div class='plugin-path'>
-     <ul class='path-navigation'>
-      <li class='left right-border' onClick="openPlugin('');">
-        <div class='nav-home'></div>
-      </li>
-      <li class='left'>Welcome to GOsa</li>
-      <li class='right left-border'>Help</li>
-      <li class='right left-border'>Change password</li>
-      <li class='right left-border'>My account</li>
-     </ul>
-    </div>
+    {$pathMenu}
     {$contents}
   </div>
 
index 433bb753cbfc66dadcf6942c7e96213864d79312..e4602283a8db3205f7f97ca20ee3c4fc43d4e9ad 100644 (file)
@@ -281,27 +281,35 @@ class pluglist {
   }
 
 
-  function genPathNavigator()
+  function genPathMenu()
   {
-    $cfg= &$this->config->data['PATHMENU'];
+    if(1 | empty($this->pathMenu)){
+
+      $this->pathMenu = 
+        "\n    <div class='plugin-path'>".
+        "\n     <ul class='path-navigation'>".
+        "\n      <li class='left right-border' onClick=\"openPlugin('');\">".
+        "\n       <div class='nav-home'></div>".
+        "\n      </li>".
+        "\n      <li class='left'>Welcome to GOsa</li>";
+
+      $cfg= &$this->config->data['PATHMENU'];
+      $rcfg = array_reverse($cfg);
+      foreach($rcfg as $id => $plug){
+
+        // Do not add inaccessible plugins
+        if (!$this->check_access($plug['ACL'])){
+          unset($rcfg[$id]);
+          continue; 
+        }
 
-    foreach($cfg as $plug){
-      list($index, $title, $desc, $icon) = $this->getPlugData($plug['CLASS']);
+        list($index, $title, $desc, $icon) = $this->getPlugData($plug['CLASS']);
+        $this->pathMenu.= "\n     <li class='right left-border'>{$title}</li>";
+      }
+      $this->pathMenu.= "\n    </ul>";
+      $this->pathMenu.= "\n    </div>";
     } 
-
-    return("    <div class='plugin-path'>
-     <ul class='path-navigation'>
-      <li class='left right-border' onClick=\"openPlugin('');\">
-        <div class='nav-home'></div>
-      </li>
-      <li class='left'>Welcome to GOsa</li>
-      <li class='right left-border'>Help</li>
-      <li class='right left-border'>Change password</li>
-      <li class='right left-border'>My account</li>
-     </ul>
-    </div>
-");
-  
+    return($this->pathMenu); 
   }