You are here

function imagepicker_browse_groups_form in Image Picker 5.2

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

browse groups form

2 string references to 'imagepicker_browse_groups_form'
_imagepicker_browse in ./imagepicker.module
_imagepicker_browse_admin in ./imagepicker.module

File

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

Code

function imagepicker_browse_groups_form($account = FALSE) {
  if ($account) {
    $user = $account;
  }
  else {
    global $user;
  }

  // all the groups for the current user which have images attached
  $grouplist = imagepicker_get_grouplist($user);
  if ($account) {
    $enabledlist = variable_get('imagepicker_currentgroup', 0);
  }
  else {
    $enabledlist = imagepicker_get_enabled_group($user);
  }
  $form['gid'] = array(
    '#type' => 'select',
    '#default_value' => $enabledlist,
    '#options' => $grouplist,
    '#title' => t('Group'),
    '#prefix' => '<div id="imgp_groups_form" class="container-inline">',
  );
  if ($account) {
    $form['uid'] = array(
      '#type' => 'hidden',
      '#value' => $user->uid,
    );
  }
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Go'),
    '#suffix' => '</div>',
  );
  return $form;
}