function forena_fields_format_autocomplete in Forena Reports 6.2
Same name and namespace in other branches
- 6 forena.module \forena_fields_format_autocomplete()
- 7.5 forena.module \forena_fields_format_autocomplete()
- 7 forena.module \forena_fields_format_autocomplete()
- 7.2 forena.module \forena_fields_format_autocomplete()
- 7.3 forena.module \forena_fields_format_autocomplete()
- 7.4 forena.module \forena_fields_format_autocomplete()
Auto complete for formats
Parameters
$string:
Return value
unknown_type
1 string reference to 'forena_fields_format_autocomplete'
- forena_menu in ./
forena.module - Implementation of hook_menu.
File
- ./
forena.module, line 360
Code
function forena_fields_format_autocomplete($string = '') {
require_once 'forena.common.inc';
$matches = array();
$formats = FrxReportGenerator::instance()
->supported_formats();
if ($string == "*") {
$matches = $formats;
print drupal_json($matches);
return;
}
if ($formats && $string) {
foreach ($formats as $name => $value) {
if (strpos(strtolower($name), strtolower($string)) !== FALSE || strpos(strtolower($value), strtolower($string)) !== FALSE) {
$matches[$name] = $value;
}
}
}
print drupal_json($matches);
}