You are here

function image_gallery_admin in Image 6

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

Menu callback for gallery admin.

2 string references to 'image_gallery_admin'
image_gallery_admin_form in contrib/image_gallery/image_gallery.admin.inc
Form for editing or adding a gallery.
image_gallery_menu in contrib/image_gallery/image_gallery.module
Implementation of hook_menu().

File

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

Code

function image_gallery_admin() {
  _image_check_settings();
  $tree = taxonomy_get_tree(_image_gallery_get_vid());
  if ($tree) {
    $header = array(
      t('Name'),
      t('Operations'),
    );
    foreach ($tree as $term) {
      $rows[] = array(
        str_repeat(' -- ', $term->depth) . ' ' . l($term->name, "image/tid/{$term->tid}"),
        l(t('edit gallery'), "admin/content/image/edit/{$term->tid}"),
      );
    }
    return theme('table', $header, $rows);
  }
  else {
    return t('No galleries available');
  }
}