index 86b23cf0dce4c8bf6e2daba8ddb3f66caa91876a..efd72574e18683c237523fd59872278ea2f73ec6 100644 (file)
function getCombobox($element)
{
- $result= "<select name='".$element['tag']."' size='1' onClick='document.mainform.submit();'>";
+ $result= "<select name='".$element['tag']."' size='1' onChange='document.mainform.submit();'>";
// Fill with presets
foreach ($element['value'] as $value) {
}
+ 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") {
$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 ("<input type='hidden' name='FILTER_PID' value='".$this->pid."'>".$smarty->fetch(get_template_path($this->xmlData['definition']['template'], true)));
+ return ("<input type='hidden' name='FILTER_PID' value='".$this->pid."'>".$smarty->fetch($file));
}
}
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);
}
}
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;
}
}
// 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"]);