index 885643d1e9c3f86c0be689356530ea047ae3fad9..f44e39dcb5ec03c9cead94245d24390b19123e8b 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) {
$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);
}
}
echo '<ul>';
foreach ($result as $entry) {
- echo '<li>'.$entry.'</li>';
+ echo '<li>'.mark($_POST[$tag], $entry).'</li>';
if ($max-- == 0) {
break;
}