You are here

function node_gallery_relationship_list in Node Gallery 6.3

Displays a list of all defined Gallery-to-Image relationships.

Return value

A themed table suitable for output

1 string reference to 'node_gallery_relationship_list'
node_gallery_menu in ./node_gallery.module
Implements hook_menu().

File

./node_gallery.admin.inc, line 18

Code

function node_gallery_relationship_list() {
  $ng_rels = node_gallery_get_all_relationships();
  if (!empty($ng_rels)) {
    $headers = array(
      t('Relationship name'),
      t('Gallery type'),
      t('Image type'),
      t('Image Field'),
    );
    foreach ($ng_rels as $gallery_type => $config) {
      $image_type = content_types($config['image_type']);
      $field_link = 'admin/content/node-type/' . $image_type['url_str'] . '/fields/' . $config['imagefield_name'];
      $rows[] = array(
        array(
          'data' => check_plain($config['settings']['name']),
          'rowspan' => 2,
        ),
        check_plain($gallery_type),
        check_plain($config['image_type']),
        l($config['imagefield_name'], $field_link),
      );
      $links = theme('links', node_gallery_relationship_operations($config['rid']));
      $operations = array(
        array(
          'data' => $links,
          'align' => 'right',
          'colspan' => 3,
        ),
      );
      $rows[] = $operations;
    }
    return theme('table', $headers, $rows, array(
      'class' => 'node-gallery-config-list',
    ));
  }
  else {
    return t("There are no gallery relationships defined.");
  }
}