function user_autocomplete
Same name and namespace in other branches
- 7.x drupal-7.x/modules/user/user.pages.inc \user_autocomplete()
Menu callback; Retrieve a JSON object containing autocomplete suggestions for existing users.
1 string reference to 'user_autocomplete'
- user_menu in drupal-6.x/
modules/ user/ user.module - Implementation of hook_menu().
Archivo
- drupal-6.x/
modules/ user/ user.pages.inc, line 11 - User page callback file for the user module.
Código
function user_autocomplete($string = '') {
$matches = array();
if ($string) {
$result = db_query_range("SELECT name FROM {users} WHERE LOWER(name) LIKE LOWER('%s%%')", $string, 0, 10);
while ($user = db_fetch_object($result)) {
$matches[$user->name] = check_plain($user->name);
}
}
drupal_json($matches);
}