index 6a6a4216efff52f5c61a9a59d8c889acb8339bca..f44e39dcb5ec03c9cead94245d24390b19123e8b 100644 (file)
$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;
}