You are here

function image_gallery_admin_form in Image 5.2

Same name and namespace in other branches
  1. 5 contrib/image_gallery/image_gallery.module \image_gallery_admin_form()
  2. 6 contrib/image_gallery/image_gallery.admin.inc \image_gallery_admin_form()
  3. 7 contrib/image_gallery/image_gallery.admin.inc \image_gallery_admin_form()
1 string reference to 'image_gallery_admin_form'
image_gallery_admin_add in contrib/image_gallery/image_gallery.module

File

contrib/image_gallery/image_gallery.module, line 290

Code

function image_gallery_admin_form($edit = array()) {
  if (empty($edit)) {
    $edit['vid'] = _image_gallery_get_vid();
  }
  $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('Submit'),
  );
  if ($edit['tid']) {
    $form['delete'] = array(
      '#type' => 'submit',
      '#value' => t('Delete'),
    );
    $form['tid'] = array(
      '#type' => 'hidden',
      '#value' => $edit['tid'],
    );
  }
  $form['#base'] = 'image_gallery_admin';
  return $form;
}