summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a0c6b5a)
raw | patch | inline | side by side (parent: a0c6b5a)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 22 Oct 2010 07:44:45 +0000 (07:44 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 22 Oct 2010 07:44:45 +0000 (07:44 +0000) |
-We can now list items and packages
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20122 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20122 594d385d-05f5-0310-b6e9-bd551577e9d8
diff --git a/gosa-core/plugins/admin/newConfigManagement/DeviceConfig-filter.xml b/gosa-core/plugins/admin/newConfigManagement/DeviceConfig-filter.xml
index 183ddd4ce52a3a8456fcbf7590a69e8bf4bd17f1..7a0c28d27c1b9dcd16525ccc0516f069008d2564 100644 (file)
<tag>default</tag>
<label>Default filter</label>
<query>
- <backend>DeviceItems</backend>
+ <backend>ConfigManagement</backend>
<filter>$</filter>
</query>
<autocomplete>
diff --git a/gosa-core/plugins/admin/newConfigManagement/class_filterConfigManagement.inc b/gosa-core/plugins/admin/newConfigManagement/class_filterConfigManagement.inc
--- /dev/null
@@ -0,0 +1,54 @@
+<?php
+
+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');
+
+ // Prepare filter, strip out regex regex related chars, except for *
+ $filter = preg_replace('/\*/','____STAR____', $filter);
+ $filter = preg_quote($filter,'/');
+ $filter = preg_replace('/____STAR____/','.*', $filter);
+
+ // Add entries
+ $ret = array();
+ foreach($data['children'] as $item){
+ filterDeviceItems::addEntry($ret, $item, $scope == 'sub', $filter);
+ }
+ return($ret);
+ }
+
+ static function addEntry(&$ret, $item, $recursive = FALSE, $filter)
+ {
+ if(preg_match("/".$filter."/",$item['name'])){
+ $entry = array();
+ $entry['dn'] = $item['id'];
+ $entry[] = 'dn';
+ $entry['cn'] = array($item['name'], 'count' => 1);
+ $entry[] = 'cn';
+ $entry['id'] = array($item['id'], 'count' => 1);
+ $entry[] = 'id';
+ $entry['description'] = array($item['type'], 'count' => 1);
+ $entry[] = 'description';
+ $entry['objectClass'] = array($item['type'],'count' => 1);
+ $entry[] = 'objectClass';
+ $entry['count'] = 5;
+ $ret[] = $entry;
+ }
+
+ if($recursive && isset($item['children']) && count($item['children'])){
+ foreach($item['children'] as $item){
+ filterDeviceItems::addEntry($ret, $item, $recursive,$filter);
+ }
+ }
+
+ }
+}
+
+?>
diff --git a/gosa-core/plugins/admin/newConfigManagement/class_newConfigManagement.inc b/gosa-core/plugins/admin/newConfigManagement/class_newConfigManagement.inc
index f1eb09d3afb6dd0a2419e227c4f6fae3f5afa0c5..adb8ddf201a8d7f62778188008eca12f025c76c7 100644 (file)
// to allow the configFilter to access it and display the
// packages and items.
$item = $this->dataModel->getItemByPath($this->selectedRelease);
- print_a($item);
+ session::set('CONFIG_ITEM', $item);
return($this->listing->renderList());
}