You are here

function imagepicker_get_groups in Image Picker 6.2

Same name and namespace in other branches
  1. 5.2 imagepicker.module \imagepicker_get_groups()
  2. 5 imagepicker.module \imagepicker_get_groups()
  3. 7 imagepicker.functions.inc \imagepicker_get_groups()

get all the groups for the current user

5 calls to imagepicker_get_groups()
imagepicker_browse_groups_form_submit in ./imagepicker.functions.inc
Submit browse groups form
imagepicker_group_images_form in ./imagepicker.functions.inc
Insert a form into the edit image page to allow the image to be associated with a group.
imagepicker_import_form in ./imagepicker.import.inc
Function to display the image import form.
imagepicker_multitask_groups_form in ./imagepicker.functions.inc
imagepicker_upload_form in ./imagepicker.upload.inc

File

./imagepicker.functions.inc, line 1356
Imagepicker functions

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;
}