From: hickert Date: Mon, 25 Oct 2010 08:11:45 +0000 (+0000) Subject: Updated config mangement list X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=087f24b8a4d9710f500224ddf23952ae8f689113;p=gosa.git Updated config mangement list -Inject object definitions now. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20135 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/plugins/admin/newConfigManagement/class_ConfigManagementListing.inc b/gosa-core/plugins/admin/newConfigManagement/class_ConfigManagementListing.inc index 9153c4db9..acc0c4f0e 100644 --- a/gosa-core/plugins/admin/newConfigManagement/class_ConfigManagementListing.inc +++ b/gosa-core/plugins/admin/newConfigManagement/class_ConfigManagementListing.inc @@ -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"; + foreach($typeData as $key => $value){ + $str .= "\n\t<{$key}>{$value}"; + } + $str.= "\n\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); diff --git a/gosa-core/plugins/admin/newConfigManagement/class_filterConfigManagement.inc b/gosa-core/plugins/admin/newConfigManagement/class_filterConfigManagement.inc index 306e386ae..87697b819 100644 --- a/gosa-core/plugins/admin/newConfigManagement/class_filterConfigManagement.inc +++ b/gosa-core/plugins/admin/newConfigManagement/class_filterConfigManagement.inc @@ -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'); diff --git a/gosa-core/plugins/admin/newConfigManagement/class_newConfigManagement.inc b/gosa-core/plugins/admin/newConfigManagement/class_newConfigManagement.inc index eb7b13e73..4d5822c88 100644 --- a/gosa-core/plugins/admin/newConfigManagement/class_newConfigManagement.inc +++ b/gosa-core/plugins/admin/newConfigManagement/class_newConfigManagement.inc @@ -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(