function imagepicker_user_autocomplete in Image Picker 5.2
Same name and namespace in other branches
- 6.2 imagepicker.admin.inc \imagepicker_user_autocomplete()
- 7 imagepicker.admin.inc \imagepicker_user_autocomplete()
Retrieve a pipe delimited string of autocomplete suggestions for existing users
1 string reference to 'imagepicker_user_autocomplete'
- imagepicker_menu in ./
imagepicker.module - Implementation of hook_menu().
File
- ./
imagepicker.module, line 3863 - Enables permitted roles to upload images for insertion into configured nodes.
Code
function imagepicker_user_autocomplete($string = '') {
$matches = array();
if ($string) {
$result = db_query_range("SELECT u.name FROM {users} u, {imagepicker} i WHERE LOWER(u.name) LIKE LOWER('%s%%') AND u.uid=i.uid", $string, 0, 10);
while ($user = db_fetch_object($result)) {
$matches[$user->name] = check_plain($user->name);
}
}
print drupal_to_js($matches);
exit;
}