You are here

function image_gallery_admin_edit in Image 7

Same name and namespace in other branches
  1. 6 contrib/image_gallery/image_gallery.admin.inc \image_gallery_admin_edit()

Menu callback for editing or adding a gallery.

1 string reference to 'image_gallery_admin_edit'
image_gallery_menu in contrib/image_gallery/image_gallery.module
Implementation of hook_menu().

File

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

Code

function image_gallery_admin_edit($tid = NULL) {
  if (isset($_POST['op']) && $_POST['op'] == t('Delete') || isset($_POST['confirm'])) {
    return drupal_get_form('image_gallery_confirm_delete_form', $tid);
  }
  if (is_numeric($tid)) {
    $edit = (array) taxonomy_get_term($tid);
  }
  else {
    $edit = array(
      'name' => '',
      'description' => '',
      'vid' => _image_gallery_get_vid(),
      'tid' => NULL,
      'weight' => 0,
    );
  }
  return drupal_get_form('image_gallery_admin_form', $edit);
}