Code

Create array of used attributes
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 12 Dec 2007 12:18:02 +0000 (12:18 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 12 Dec 2007 12:18:02 +0000 (12:18 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8103 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/include/class_multi_plug.inc

index b74f963dc6fc787fba60ab9f2edc0e653fe350d0..06a3ccd7a210f0e80d7a9bb88cbe249b68ca84ec 100644 (file)
@@ -138,14 +138,21 @@ class multi_plug
           if(!isset($handle->by_object[$first]->attrs[$key]) || !($attr === $handle->by_object[$first]->attrs[$key])){
             unset($attrs[$key]);
           }
-          if(!is_numeric($key)){
-            if(!isset($all[$key])){
+        }
+      }
+
+      foreach($handle->by_object[$first]->attrs as $key => $attr) {
+        if(!is_numeric($key)){
+          if(!isset($all[$key])){
+            if(is_array($attr)){
               $all[$key] = $attr; 
-            }elseif(isset($attr['count'])){
-              for($i = 0; $i < $attr['count'] ; $i ++){
+            }
+          }elseif(isset($attr['count'])){
+            for($i = 0; $i < $attr['count'] ; $i ++){
+              if(!in_array($attr[$i],$all[$key])){
                 $all[$key][] = $attr[$i];
+                $all[$key]['count']++;
               }
-              $all[$key] = array_unique($all[$key]);
             }
           }
         }