You are here

function forena_reports_autocomplete in Forena Reports 7.4

Same name and namespace in other branches
  1. 6.2 forena.module \forena_reports_autocomplete()
  2. 7.5 forena.module \forena_reports_autocomplete()
  3. 7.2 forena.module \forena_reports_autocomplete()
  4. 7.3 forena.module \forena_reports_autocomplete()
1 string reference to 'forena_reports_autocomplete'
forena_menu in ./forena.module
Implementation of hook_menu.

File

./forena.module, line 521

Code

function forena_reports_autocomplete($string = '', $string2 = '') {
  global $language;
  $reports = '';
  $link = '';

  // If we have two parameters.
  if ($string2) {
    $mode = $string;
    $string = $string2;
  }
  $string = '*' . $string . '*';
  $result = Frx::File()
    ->allReports();
  foreach ($result as $name => $row) {
    if (drupal_match_path($name, $string)) {
      $reports[$name] = $name . ' - ' . $row->cache['title'];
    }
  }
  return drupal_json_output($reports);
}