You are here

function masquerade_autocomplete in Masquerade 5

Same name and namespace in other branches
  1. 6 masquerade.module \masquerade_autocomplete()
  2. 7 masquerade.module \masquerade_autocomplete()

Returns JS array for Masquerade autocomplete fields.

1 string reference to 'masquerade_autocomplete'
masquerade_menu in ./masquerade.module
Implementation of hook_menu().

File

./masquerade.module, line 312
masquerade.module

Code

function masquerade_autocomplete($string) {
  $matches = array();
  $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);
  }
  print drupal_to_js($matches);
  exit;
}