index 3a9e38d75856c25e3fa1bb45c3019d840dfa3fc5..f44e39dcb5ec03c9cead94245d24390b19123e8b 100644 (file)
$checked= " checked";
}
- $result= "<input class='filter_checkbox' name='$tag' type='checkbox' onClick='document.mainform.submit();' value='true'$checked>";
+ $result= "<input class='filter_checkbox' id='$tag' name='$tag' type='checkbox' onClick='document.mainform.submit();' value='true'$checked>";
return $result;
}
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") {
function renderScope()
{
$checked= $this->scope == "sub"?" checked":"";
- return "<input type='checkbox' name='SCOPE' value='1' onClick='document.mainform.submit();'$checked> "._("Search in subtrees");
+ return "<input type='checkbox' id='SCOPE' name='SCOPE' value='1' onClick='document.mainform.submit();'$checked> <LABEL for='SCOPE'>"._("Search in subtrees")."</LABEL>";
}
$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));
}
$e_unset= is_array($element['unset'])?"":$element['unset'];
}
+ // Do not replace escaped \$ - This is required to be able to search for e.g. windows machines.
if ($this->elementValues[$tag] == "") {
- $e_unset= preg_replace('/\$/', normalizeLdap($this->elementValues[$tag]), $e_unset);
+ $e_unset= preg_replace('/([^\\\\])\$/', '${1}'.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('/([^\\\\])\$/', '${1}'.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"]);
echo '<ul>';
foreach ($result as $entry) {
- echo '<li>'.$entry.'</li>';
+ echo '<li>'.mark($_POST[$tag], $entry).'</li>';
if ($max-- == 0) {
break;
}