You are here

function image_gallery_admin_form in Image 7

Same name and namespace in other branches
  1. 5.2 contrib/image_gallery/image_gallery.module \image_gallery_admin_form()
  2. 5 contrib/image_gallery/image_gallery.module \image_gallery_admin_form()
  3. 6 contrib/image_gallery/image_gallery.admin.inc \image_gallery_admin_form()

Form for editing or adding a gallery.

1 string reference to 'image_gallery_admin_form'
image_gallery_admin_edit in contrib/image_gallery/image_gallery.admin.inc
Menu callback for editing or adding a gallery.

File

contrib/image_gallery/image_gallery.admin.inc, line 120
Contains menu callbacks for image_gallery admin pages.

Code

function image_gallery_admin_form(&$form_state, $edit = array()) {
  $form['name'] = array(
    '#type' => 'textfield',
    '#title' => t('Gallery name'),
    '#default_value' => $edit['name'],
    '#size' => 60,
    '#maxlength' => 64,
    '#description' => t('The name is used to identify the gallery.'),
    '#required' => TRUE,
  );
  $form['description'] = array(
    '#type' => 'textarea',
    '#title' => t('Description'),
    '#default_value' => $edit['description'],
    '#cols' => 60,
    '#rows' => 5,
    '#description' => t('The description can be used to provide more information about the image gallery.'),
  );
  $form['parent']['#tree'] = TRUE;
  $form['parent'][0] = _image_gallery_parent_select($edit['tid'], t('Parent'), 'forum');
  $form['weight'] = array(
    '#type' => 'weight',
    '#title' => t('Weight'),
    '#default_value' => $edit['weight'],
    '#delta' => 10,
    '#description' => t('When listing galleries, those with with light (small) weights get listed before containers with heavier (larger) weights. Galleries with equal weights are sorted alphabetically.'),
  );
  $form['vid'] = array(
    '#type' => 'hidden',
    '#value' => _image_gallery_get_vid(),
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Save'),
  );
  if ($edit['tid']) {
    $form['delete'] = array(
      '#type' => 'submit',
      '#value' => t('Delete'),
    );
    $form['tid'] = array(
      '#type' => 'hidden',
      '#value' => $edit['tid'],
    );
  }
  $form['#submit'][] = 'image_gallery_admin_submit';
  $form['#theme'][] = 'image_gallery_admin';
  return $form;
}