You are here

function imagepicker_group_search_autocomplete in Image Picker 6.2

Same name and namespace in other branches
  1. 5.2 imagepicker.module \imagepicker_group_search_autocomplete()
  2. 7 imagepicker.admin.inc \imagepicker_group_search_autocomplete()

Retrieve a pipe delimited string of autocomplete suggestions for existing groups

1 string reference to 'imagepicker_group_search_autocomplete'
imagepicker_menu in ./imagepicker.module
Implementation of hook_menu().

File

./imagepicker.admin.inc, line 2117
admin settings functions

Code

function imagepicker_group_search_autocomplete($string = '') {
  $matches = array();
  if ($string) {
    $result = db_query_range("SELECT group_name FROM {imagepicker_user_groups} WHERE LOWER(group_name) LIKE LOWER('%s%%')", $string, 0, 10);
    while ($group = db_fetch_object($result)) {
      $matches[$group->group_name] = check_plain($group->group_name);
    }
  }
  print drupal_to_js($matches);
  exit;
}