X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=gosa-core%2Finclude%2Fclass_filter.inc;h=efd72574e18683c237523fd59872278ea2f73ec6;hb=fa919250554e64617662c2e07e569263a53a1ee3;hp=286725978de42d16a0ae507d2dd0f39f7e2a7513;hpb=099fb791bb6d2c03127ac3d547d1540a456218e1;p=gosa.git diff --git a/gosa-core/include/class_filter.inc b/gosa-core/include/class_filter.inc index 286725978..efd72574e 100644 --- a/gosa-core/include/class_filter.inc +++ b/gosa-core/include/class_filter.inc @@ -351,8 +351,16 @@ class filter { $smarty->assign("$tag", $htmlCode); } + // Try to load template from plugin the folder first... + $file = get_template_path($this->xmlData['definition']['template'], true); + + // ... if this fails, try to load the file from the theme folder. + if(!file_exists($file)){ + $file = get_template_path($this->xmlData['definition']['template']); + } + // Load template - return ("".$smarty->fetch(get_template_path($this->xmlData['definition']['template'], true))); + return ("".$smarty->fetch($file)); } @@ -383,9 +391,6 @@ class filter { $filter= $query['filter']; $attributes= $query['attribute']; - $method = ""; - if(isset($query['method'])) $method = $query['method']; - // Generate final filter foreach ($this->elements as $tag => $element) { if (!isset($element['set']) || !isset($element['unset'])) { @@ -403,16 +408,17 @@ class filter { } if ($this->elementValues[$tag] == "") { - $e_unset= preg_replace('/\$/', normalizeLdap($this->elementValues[$tag]), $e_unset); + $e_unset= preg_replace('/[^\\\\]\$/', normalizeLdap($this->elementValues[$tag]), $e_unset); + $e_unset= preg_replace('/\\\\\$/','$', $e_unset); $filter= preg_replace("/\\$$tag/", $e_unset, $filter); } else { - $e_set= preg_replace('/\$/', normalizeLdap($this->elementValues[$tag]), $e_set); + $e_set= preg_replace('/[^\\\\]\$/', normalizeLdap($this->elementValues[$tag]), $e_set); + $e_set= preg_replace('/\\\\\$/','$', $e_set); $filter= preg_replace("/\\$$tag/", $e_set, $filter); } } - $result= array_merge($result, call_user_func(array($backend, 'query'), $this->base, $this->scope, $filter, $attributes, $this->category,$method, $this->objectStorage)); - $result = call_user_func(array($backend, 'unifyResults'), $result); + $result= array_merge($result, call_user_func(array($backend, 'query'), $this->base, $this->scope, $filter, $attributes, $this->category, $this->objectStorage)); } return ($result);