You are here

function imagepicker_group_images_form in Image Picker 7

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

Insert a form into the edit image page to allow the image to be associated with a group.

Parameters

$img_id: The id of the image to be inserted.

$account: Optional, allows the administrator to edit user settings.

Return value

Returns the group image form.

3 string references to 'imagepicker_group_images_form'
imagepicker_adminview in ./imagepicker.admin.inc
imagepicker_image_select in ./imagepicker.functions.inc
imagepicker_userview in ./imagepicker.user.inc

File

./imagepicker.functions.inc, line 1748
@author Bob Hutchinson http://drupal.org/user/52366 @copyright GNU GPL

Code

function imagepicker_group_images_form($form, &$form_state, $img_id, $account = FALSE) {
  $grouplist = imagepicker_get_groups($account);
  $enabledlist = imagepicker_get_image_groups($img_id);
  $form['group_images'] = array(
    '#type' => 'fieldset',
    '#title' => t('Groups'),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
  );
  $form['group_images']['grouplist'] = array(
    '#type' => 'checkboxes',
    '#default_value' => $enabledlist,
    '#options' => $grouplist,
    '#title' => t('Your Groups'),
  );
  $form['group_images']['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Save group settings'),
  );
  $form['img_id'] = array(
    '#type' => 'value',
    '#value' => $img_id,
  );
  return $form;
}