function hosting_client_autocomplete in Hosting 5
Same name and namespace in other branches
- 6.2 client/hosting_client.module \hosting_client_autocomplete()
- 7.4 client/hosting_client.module \hosting_client_autocomplete()
- 7.3 client/hosting_client.module \hosting_client_autocomplete()
Retrieve autocomplete suggestions
1 string reference to 'hosting_client_autocomplete'
- hosting_client_menu in client/
hosting_client.module - Implementation of hook_menu()
File
- client/
hosting_client.module, line 553
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, $keyword . "%");
while ($result = db_fetch_object($query)) {
$matches[$result->title] = $result->title;
}
}
print drupal_to_js($matches);
exit;
}