From dfbe8a9c67fd2535b67eb42202bf6a54aa177ba8 Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 30 Sep 2010 15:06:55 +0000 Subject: [PATCH] Dynamically add object types for the management list s git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19876 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../systems/goto/Config/DeviceConfig-list.xml | 22 +++++-------------- .../goto/Config/class_DeviceConfig.inc | 16 ++++++++++++++ .../goto/Config/class_filterDeviceItems.inc | 4 ++-- 3 files changed, 24 insertions(+), 18 deletions(-) diff --git a/gosa-plugins/goto/admin/systems/goto/Config/DeviceConfig-list.xml b/gosa-plugins/goto/admin/systems/goto/Config/DeviceConfig-list.xml index ba1af7e99..9a6812df0 100644 --- a/gosa-plugins/goto/admin/systems/goto/Config/DeviceConfig-list.xml +++ b/gosa-plugins/goto/admin/systems/goto/Config/DeviceConfig-list.xml @@ -10,21 +10,7 @@ 1 - - - FAKE_OC_DeviceItem - Device - Item - images/lists/edit.png - - - - - 1FAKE_OC_DeviceItem - Device - 1Item - 1images/lists/edit.png - + %TYPES% @@ -35,11 +21,15 @@ %{filter:objectType(dn,objectClass)} + + %{filter:departmentLink(row,dn,description)} + 2 + + %{filter:objectType(dn,objectClass)} - cn diff --git a/gosa-plugins/goto/admin/systems/goto/Config/class_DeviceConfig.inc b/gosa-plugins/goto/admin/systems/goto/Config/class_DeviceConfig.inc index 6df4b513b..7f213e87c 100644 --- a/gosa-plugins/goto/admin/systems/goto/Config/class_DeviceConfig.inc +++ b/gosa-plugins/goto/admin/systems/goto/Config/class_DeviceConfig.inc @@ -304,6 +304,22 @@ class DeviceConfig extends management // Load service xml file and fill in placeholders $contents =file_get_contents(get_template_path("goto/Config/DeviceConfig-list.xml", true)); + // Build up device-list configuration + $types =""; + foreach($this->itemConfig as $type => $item){ + $desc = $item['description']; + $img = 'images/lists/trash.png'; + $types .= + " ". + " ". + " {$type}". + " Device". + " dummy". + " {$img}". + " "; + } + $contents = preg_replace("/%TYPES%/", $types, $contents); + $items = ""; foreach($this->addableContainerItems as $item){ diff --git a/gosa-plugins/goto/admin/systems/goto/Config/class_filterDeviceItems.inc b/gosa-plugins/goto/admin/systems/goto/Config/class_filterDeviceItems.inc index b44d8d1de..d6dd7c912 100644 --- a/gosa-plugins/goto/admin/systems/goto/Config/class_filterDeviceItems.inc +++ b/gosa-plugins/goto/admin/systems/goto/Config/class_filterDeviceItems.inc @@ -39,9 +39,9 @@ class filterDeviceItems { $entry[] = 'id'; $entry['description'] = array($item['type'], 'count' => 1); $entry[] = 'description'; - $entry['objectClass'] = array('FAKE_OC_DeviceItem','count' => 1); + $entry['objectClass'] = array($item['type'],'count' => 1); $entry[] = 'objectClass'; - $entry['count'] = 4; + $entry['count'] = 5; $ret[] = $entry; } -- 2.30.2