Code

Updated config mangement list
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 25 Oct 2010 08:11:45 +0000 (08:11 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 25 Oct 2010 08:11:45 +0000 (08:11 +0000)
-Inject object definitions now.

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20135 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/plugins/admin/newConfigManagement/class_ConfigManagementListing.inc
gosa-core/plugins/admin/newConfigManagement/class_filterConfigManagement.inc
gosa-core/plugins/admin/newConfigManagement/class_newConfigManagement.inc

index 9153c4db90073a15d6f5a99b88792155935ffec6..acc0c4f0ecf2eac6cb3028d58bebe896a8ab6f26 100644 (file)
@@ -8,6 +8,7 @@ class ConfigManagementListing extends management
     private $containerSelector = NULL;
     private $itemSelector = NULL;
 
+    private $objectTypeStr = "";
 
     function __construct($config, $ui)
     {
@@ -74,6 +75,22 @@ class ConfigManagementListing extends management
 
     }
 
+
+    function setListingTypes($types)
+    {
+        $str = "";
+        foreach($types as $typeData){
+            $str.= "\n<objectType>";
+            foreach($typeData as $key => $value){
+                $str .= "\n\t<{$key}>{$value}</{$key}>";
+            }
+            $str.= "\n</objectType>\n";
+
+        }
+        $this->objectTypeStr = $str;
+        $this->rebuildListing();
+    }
+
    
     function rebuildListing()
     {
@@ -86,9 +103,13 @@ class ConfigManagementListing extends management
         }
         $this->setFilter($filter);
 
+        
+
         // Load service xml file and fill in placeholders
         $contents = file_get_contents(get_template_path("DeviceConfig-list.xml", true));
+        $contents = preg_replace("/%TYPES%/", $this->objectTypeStr, $contents);
         $contents = preg_replace("/%ITEMS%/", "", $contents);
+
         $headpage = new listing($contents,TRUE);
         $headpage->setBase($this->base);
         $headpage->setFilter($filter);
index 306e386ae7b524c36d05b0a7b57bc5bb2552f211..87697b8198420c689c2946a4df4d80df8877f748 100644 (file)
@@ -4,9 +4,6 @@ class filterConfigManagement {
 
     static function query($base, $scope, $filter, $attributes, $category, $objectStorage= "")
     {
-
-        echo $base;
-
         // Walk through the data array till we reach the correct level, then 
         //  create the list of entries.
         $data = session::get('CONFIG_ITEM');
index eb7b13e7355c7cb042de187e927d2d8aba30cb93..4d5822c88b70dd83d07cd184bd31f481d6eebbd3 100644 (file)
@@ -139,6 +139,7 @@ class newConfigManagement extends plugin
         $path = $this->selectedContainer.$this->selectedItem;
         $item = $this->dataModel->getItemByPath($path);
         session::set('CONFIG_ITEM', $item);
+        $this->listing->setListingTypes($this->getListingTypes());
 
         return($this->listing->renderList());
     }
@@ -223,6 +224,24 @@ class newConfigManagement extends plugin
     }
 
 
+    function getListingTypes()
+    {
+        $types= array();
+        $types['Distribution']['objectClass'] = 'Distribution';
+        $types['Distribution']['label'] = _('Distribution');
+        $types['Distribution']['image'] = 'images/lists/edit.png';
+        $types['Distribution']['category'] = 'Device';
+        $types['Distribution']['class'] = 'Device';
+
+        $types['Release']['objectClass'] = 'Release';
+        $types['Release']['label'] = _('Release');
+        $types['Release']['image'] = 'images/lists/edit.png';
+        $types['Release']['category'] = 'Device';
+        $types['Release']['class'] = 'Device';
+        return($types);
+    }
+
+
     public static function plInfo()
     {
         return (array(