From 48350e1be164fccbbee8f7c679b75e064534776a Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 4 May 2010 14:52:19 +0000 Subject: [PATCH] Created some kind of simple filtering git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@18047 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../configViewer/class_filterProperties.inc | 16 +++++++- .../addons/configViewer/property-filter.xml | 12 +++--- .../addons/configViewer/property-list.tpl | 6 --- .../addons/configViewer/property-list.xml | 38 +++++++++++++++++-- 4 files changed, 56 insertions(+), 16 deletions(-) diff --git a/gosa-core/plugins/addons/configViewer/class_filterProperties.inc b/gosa-core/plugins/addons/configViewer/class_filterProperties.inc index d89d15e5d..b95a1eec3 100644 --- a/gosa-core/plugins/addons/configViewer/class_filterProperties.inc +++ b/gosa-core/plugins/addons/configViewer/class_filterProperties.inc @@ -9,6 +9,7 @@ class filterCONFIGPROPERTIES { $all = $config->configRegistry->getAllProperties(); $ret = array(); foreach($all as $property){ + $entry = array(); $entry = filterCONFIGPROPERTIES::fakeLdapResult($entry, 'cn', $property->getName()); $entry = filterCONFIGPROPERTIES::fakeLdapResult($entry, 'objectClass', $property->getStatus()); @@ -21,7 +22,20 @@ class filterCONFIGPROPERTIES { $entry = filterCONFIGPROPERTIES::fakeLdapResult($entry, 'migrate', $property->getMigrate()); $entry = filterCONFIGPROPERTIES::fakeLdapResult($entry, 'group', $property->getGroup()); $entry['dn'] = $property->getName(); - $ret[] = $entry; + + $found =TRUE; + if(!empty($filter)){ + $tests = preg_split("/§/", $filter); + foreach($tests as $test){ + list($name,$value) = preg_split("/=/",$test); + $value =preg_replace("/\*/",'',$value); + if(empty($value)) $value='.*'; + if(!isset($entry[$name][0]) || !preg_match("/{$value}/",$entry[$name][0])){ + $found = false; + } + } + } + if($found) $ret[] = $entry; } return($ret); diff --git a/gosa-core/plugins/addons/configViewer/property-filter.xml b/gosa-core/plugins/addons/configViewer/property-filter.xml index cf8f5cb8d..dde011cfc 100644 --- a/gosa-core/plugins/addons/configViewer/property-filter.xml +++ b/gosa-core/plugins/addons/configViewer/property-filter.xml @@ -12,13 +12,13 @@ default - + CONFIGPROPERTIES - state=* + status=(ldap|file)§cn=$ - state + status 0.5 3 @@ -26,13 +26,13 @@ default2 - + CONFIGPROPERTIES - state=modified + cn=$ - state + status 0.5 3 diff --git a/gosa-core/plugins/addons/configViewer/property-list.tpl b/gosa-core/plugins/addons/configViewer/property-list.tpl index c80f9a238..008ab32be 100644 --- a/gosa-core/plugins/addons/configViewer/property-list.tpl +++ b/gosa-core/plugins/addons/configViewer/property-list.tpl @@ -5,9 +5,6 @@
- - - @@ -15,10 +12,7 @@
{$ROOT}{$BACK}{$HOME} {$RELOAD} {$ACTIONS} {$FILTER}
- {$LIST}
- - diff --git a/gosa-core/plugins/addons/configViewer/property-list.xml b/gosa-core/plugins/addons/configViewer/property-list.xml index 891c5a499..2c452ac4e 100644 --- a/gosa-core/plugins/addons/configViewer/property-list.xml +++ b/gosa-core/plugins/addons/configViewer/property-list.xml @@ -12,11 +12,35 @@ 1 - - none + + undefined all all - plugins/sudo/images/select_sudo.png + images/lists/element.png + + + + + modified + all + all + plugins/configViewer/images/ldap.png[new] + + + + + ldap + all + all + plugins/configViewer/images/ldap.png + + + + + file + all + all + plugins/configViewer/images/file.png @@ -44,6 +68,14 @@ true + + + value + string + %{value} + true + + description -- 2.30.2