You are here

function imagepicker_get_groups in Image Picker 5.2

Same name and namespace in other branches
  1. 5 imagepicker.module \imagepicker_get_groups()
  2. 6.2 imagepicker.functions.inc \imagepicker_get_groups()
  3. 7 imagepicker.functions.inc \imagepicker_get_groups()
3 calls to imagepicker_get_groups()
imagepicker_browse_groups_form_submit in ./imagepicker.module
Submit browse groups form
imagepicker_group_images_form in ./imagepicker.module
insert a form into the edit image page to allow the image to be associated with a group
imagepicker_upload_form in ./imagepicker.module

File

./imagepicker.module, line 2975
Enables permitted roles to upload images for insertion into configured nodes.

Code

function imagepicker_get_groups($account = FALSE) {
  if ($account) {
    $user = $account;
  }
  else {
    global $user;
  }
  $result = db_query("SELECT * FROM {imagepicker_user_groups} WHERE uid = %d", array(
    $user->uid,
  ));
  $count = 0;
  while ($row = db_fetch_array($result)) {
    $data[$row['gid']] = $row['group_name'] . ($row['public'] ? ' - ' . t('Public') : ' - ' . t('Private'));
    $count++;
  }
  if ($count) {
    return $data;
  }
  return FALSE;
}