Code

Added dependency field
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 27 Oct 2009 09:33:46 +0000 (09:33 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 27 Oct 2009 09:33:46 +0000 (09:33 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14645 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/include/class_listing.inc

index 24b8cba925d46491d0b023a313ff0896311e5cd1..c672cacf3c01cc5edab60be213c429c9ddca0ce3 100644 (file)
@@ -1036,6 +1036,7 @@ class listing {
 
   function recurseActions($actions)
   {
+    global $class_mapping;
     static $level= 2;
     $result= "<ul class='level$level'>";
     $separator= "";
@@ -1047,6 +1048,16 @@ class listing {
         continue;
       }
 
+      // Skip entry if there're missing dependencies
+      if (isset($action['depends'])) {
+        $deps= is_array($action['depends'])?$action['depends']:array($action['depends']);
+        foreach($deps as $clazz) {
+          if (!isset($class_mapping[$clazz])){
+            continue 2;
+          }
+        }
+      }
+
       // Fill image if set
       $img= "";
       if (isset($action['image'])){