You are here

function hosting_client_autocomplete in Hostmaster (Aegir) 6

Retrieve autocomplete suggestions.

1 string reference to 'hosting_client_autocomplete'
hosting_client_menu in modules/hosting/client/hosting_client.module
Implementation of hook_menu().

File

modules/hosting/client/hosting_client.module, line 818

Code

function hosting_client_autocomplete($type, $keyword) {
  $matches = array();
  if ($type == 'client') {
    $query = db_query(db_rewrite_sql("SELECT * FROM {node} n WHERE type = '%s' AND title LIKE '%s%%'"), $type, addcslashes($keyword, '\\%_'));
    while ($result = db_fetch_object($query)) {
      $matches[$result->title] = $result->title;
    }
  }
  drupal_json($matches);
  exit;
}