X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=gosa-core%2Finclude%2Fclass_filter.inc;h=efd72574e18683c237523fd59872278ea2f73ec6;hb=fa919250554e64617662c2e07e569263a53a1ee3;hp=9b2fed5458381bcf79bba4e76752ac552e2b6042;hpb=927b0e3e34d43d9f439991d841c690aa7c07eab0;p=gosa.git diff --git a/gosa-core/include/class_filter.inc b/gosa-core/include/class_filter.inc index 9b2fed545..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)); } @@ -400,10 +408,12 @@ 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); } }