X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=gosa-core%2Finclude%2Fclass_filter.inc;h=efd72574e18683c237523fd59872278ea2f73ec6;hb=fa919250554e64617662c2e07e569263a53a1ee3;hp=86b23cf0dce4c8bf6e2daba8ddb3f66caa91876a;hpb=1d3872e5ffbf5dcc21d24d02fc2899dc34d6c3b4;p=gosa.git diff --git a/gosa-core/include/class_filter.inc b/gosa-core/include/class_filter.inc index 86b23cf0d..efd72574e 100644 --- a/gosa-core/include/class_filter.inc +++ b/gosa-core/include/class_filter.inc @@ -183,7 +183,7 @@ class filter { function getCombobox($element) { - $result= ""; // Fill with presets foreach ($element['value'] as $value) { @@ -214,6 +214,18 @@ class filter { } + function setComboBoxOptions($tag, $options) + { + if (isset($this->elements[$tag]) && $this->elements[$tag]['type'] == "combobox") { + + $this->elements[$tag]['value']= array(); + foreach ($options as $key => $label) { + $this->elements[$tag]['value'][]= array('label' => $label, 'key' => $key); + } + } + } + + function getCurrentBase() { if (isset($this->search->base) && (string)$this->search->scope != "auto") { @@ -339,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)); } @@ -388,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); } } @@ -418,13 +440,9 @@ class filter { function update() { - /* React on alphabet links if needed */ if (isset($_GET['filter'])){ - $s= mb_substr(validate($_GET['filter']), 0, 1, "UTF8")."*"; - if ($s == "**"){ - $s= "*"; - } + $s= mb_substr(validate($_GET['filter']), 0, 1, "UTF8"); foreach ($this->alphabetElements as $tag) { $this->elementValues[$tag]= $s; } @@ -469,7 +487,7 @@ class filter { } // Make filter - $filter= preg_replace("/\\$$tag/", normalizeLDAP($value), $filter); + $filter= preg_replace("/\\$$tag/", normalizeLdap($value), $filter); if (isset($config['base']) && isset($config['scope']) && isset($config['category'])) { $result= call_user_func(array($backend, 'query'), $config['base'], $config['scope'], $filter, $attributes, $config["category"], $config["objectStorage"]);