Project

General

Profile

« Previous | Next » 

Revision 5ab7edf7

Added by Andreas Kohlbecker over 2 years ago

fixing git auto-merge error

View differences:

modules/cdm_dataportal/ext_links/ext_links.module
283 283
  drupal_json_output($matches);
284 284
}
285 285

  
286
/**
287
 * Autocomplete function called via the menu hook ext_links/category/autocomplete
288
 *
289
 * @param $query_string
290
 *  the string to search for
291
 */
292
function ext_links_category_autocomplete($query_string){
293
  $matches = array();
294
  $sql = 'SELECT * FROM {ext_links} WHERE category LIKE :category';
295
  $args = [':category' => '%' . db_like($query_string) . '%'];
296
  $result = db_query($sql, $args);
297
  foreach ($result as $row) {
298
    $matches[$row->category] = check_plain($row->category);
299
  }
300
  // Return the result to the form in json
301
  drupal_json_output($matches);
302
}
303

  
304

  
305 286
/**
306 287
 * Returns the genus and the first epithet from the object taxon.
307 288
 *

Also available in: Unified diff