summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b89eb74)
raw | patch | inline | side by side (parent: b89eb74)
author | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 21 Sep 2007 11:33:31 +0000 (11:33 +0000) | ||
committer | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 21 Sep 2007 11:33:31 +0000 (11:33 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7369 594d385d-05f5-0310-b6e9-bd551577e9d8
include/class_config.inc | patch | blob | history | |
include/functions.inc | patch | blob | history |
index d8d28684e18860b91da9267f428fd5bc162503bb..da6ca043213d14d660e4afb4c24ed13699dc093f 100644 (file)
--- a/include/class_config.inc
+++ b/include/class_config.inc
return FALSE;
}
+
+ function __search(&$arr, $name, $return)
+ {
+ $return= strtoupper($return);
+ if (is_array($arr)){
+ foreach ($arr as &$a){
+ if (isset($a['CLASS']) && preg_match("/^$name$/i", $a['CLASS'])){
+ return(isset($a[$return])?$a[$return]:"");
+ } else {
+ $res= $this->__search ($a, $name, $return);
+ if ($res != ""){
+ return $res;
+ }
+ }
+ }
+ }
+ return ("");
+ }
+
+
+ function search($class, $value, $categories= "")
+ {
+ if (is_array($categories)){
+ foreach ($categories as $category){
+ $res= $this->__search($this->data[strtoupper($category)], $class, $value);
+ if ($res != ""){
+ return $res;
+ }
+ }
+ } else {
+ if ($categories == "") {
+ return $this->__search($this->data, $class, $value);
+ } else {
+ return $this->__search($this->data[strtoupper($categories)], $class, $value);
+ }
+ }
+
+ return ("");
+ }
+
}
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
diff --git a/include/functions.inc b/include/functions.inc
index ba51ca91134912fb964f36dc4d721629d9be64a4..23335677d478f78e08d324fab677b4be0fd53603 100644 (file)
--- a/include/functions.inc
+++ b/include/functions.inc
}
-function search_config(&$arr, $name, $return)
-{
- $lname= strtolower($name);
- if (is_array($arr)){
- foreach ($arr as $a){
- if (isset($a['CLASS']) && strtolower($a['CLASS']) == $lname){
-
- if (isset($a[$return])){
- return ($a[$return]);
- } else {
- return ("");
- }
- } else {
- $res= search_config ($a, $name, $return);
- if ($res != ""){
- return $res;
- }
- }
- }
- }
- return ("");
-}
-
-
function array_differs($src, $dst)
{
/* If the count is differing, the arrays differ */