You are here

function biblio_overview_types in Bibliography Module 7.2

hook_menu callback function for admin/config/content/biblio/publication-types

Gives an unordered list of all the publication types we have available. Each one is presented as a link to the manage page for that type.

@todo make this a table similar to the original publication type list. See http://drupal.org/node/1537390

Return value

type

1 string reference to 'biblio_overview_types'
biblio_menu in ./biblio.module
Implements hook_menu().

File

includes/biblio.admin.inc, line 2512

Code

function biblio_overview_types($entity_type = NULL) {
  $path = current_path();
  $types = biblio_types($entity_type);
  $entity_info = entity_get_info($entity_type);
  module_load_include('inc', 'biblio', 'includes/biblio.fields');
  $header = array(
    t('Name'),
    array(
      'data' => t('Operations'),
      'colspan' => '4',
    ),
  );
  $rows = array();
  foreach ($types as $type => $info) {
    $url = $entity_info['bundles'][$type]['admin']['real path'];
    $type_url_str = str_replace('_', '-', $type);
    $row = array();

    // Name column
    $row[] = theme('biblio_admin_overview', array(
      'name' => $info->name,
      'type' => $type,
      'description' => $info->description,
      'instances missing' => biblio_field_instances_missing($type, $entity_type),
    ));

    // Edit column.
    // @todo: add edit functionality
    // $row[] = array('data' => l(t('edit'), $url));
    $row[] = array(
      'data' => l(t('manage fields'), $url . '/fields'),
    );
    $row[] = array(
      'data' => l(t('manage display'), $url . '/display'),
    );

    // @todo: add ability to add/delete a pubtype
    $rows[] = $row;
  }
  $table = theme('table', array(
    'header' => $header,
    'rows' => $rows,
  ));
  return $table;
}