Code

Fixed loading of items
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 13 Apr 2011 13:59:59 +0000 (13:59 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 13 Apr 2011 13:59:59 +0000 (13:59 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20721 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/goto-ng/admin/newConfigManagement/class_newConfigManagement.inc

index 20ade7624c178fd948c791b0d6fd8b3fb6103bd2..b7372be0f3b1668bba695fd03722981141054650 100644 (file)
@@ -179,7 +179,7 @@ class newConfigManagement extends plugin
 
                 $rpc = $this->config->getRpcHandle();
                 $res = $rpc->listConfigItems($data['name']);
-                if(!$rpc->success() || !$res){
+                if(!$rpc->success()){
                     msg_dialog::display(_("Error"), 
                             sprintf(_("Failed to load distributions: %s"), 
                                 $rpc->get_error()),ERROR_DIALOG);
@@ -251,10 +251,6 @@ class newConfigManagement extends plugin
         }else{
             $this->addableContainerItems = array();
         }
-        #print_a($this->installationMethods);
-        #print_a($this->itemConfig);
-        #echo $item['type'];
-        #print_a($this->addableContainerItems);
     }
 
 
@@ -529,8 +525,8 @@ class newConfigManagement extends plugin
         while(preg_match("/\//", $fPath)){
             $fPath = preg_replace("/\/[^\/]*$/","", $fPath);
             $item = $this->dataModel->getItemByPath($fPath);
-            if(isset($this->cfgItemMap[$item['type']])){
-                return(preg_replace("/".preg_quote($item['parentPath'],'/')."/", "", $fullPath));
+            if(in_array($item['type'], array('Release', 'Distribution', 'root'))){
+                return(preg_replace("/".preg_quote($item['path'],'/')."/", "", $fullPath));
             }
         }
         return(NULL);