You are here

function forena_fields_format_autocomplete in Forena Reports 7.3

Same name and namespace in other branches
  1. 6.2 forena.module \forena_fields_format_autocomplete()
  2. 6 forena.module \forena_fields_format_autocomplete()
  3. 7.5 forena.module \forena_fields_format_autocomplete()
  4. 7 forena.module \forena_fields_format_autocomplete()
  5. 7.2 forena.module \forena_fields_format_autocomplete()
  6. 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 416

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_output($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_output($matches);
}