Commit 04306a12 authored by metzlerd's avatar metzlerd
Browse files

Fixed category autocomplete to return search strings.

parent 3a5eeb4d
......@@ -865,7 +865,19 @@ function forena_xmlpp($xml, $html_output=FALSE) {
*/
function forena_get_categories($string='') {
$data = Frx::File()->reportsByCategory();
$categories = array_keys($data);
if ($string) {
$categories = array();
foreach (array_keys($data) as $cat) {
if (strpos(strtolower($cat), strtolower(trim($string))) === 0) {
$categories[] = $cat;
}
}
}
else {
$categories = array_keys($data);
}
$categories = array_combine($categories, $categories);
return $categories;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment