function node_overview_types

Page callback: Displays the content type admin overview page.

Return value

array An array as expected by drupal_render().

See also

node_menu()

1 string reference to 'node_overview_types'
node_menu in drupal/core/modules/node/node.module
Implements hook_menu().

File

drupal/core/modules/node/content_types.inc, line 16
Content type editing user interface.

Code

function node_overview_types() {
  $types = node_type_get_types();
  $names = node_type_get_names();
  $field_ui = module_exists('field_ui');
  $header = array(
    t('Name'),
    t('Operations'),
  );
  $rows = array();
  foreach ($names as $key => $name) {
    $type = $types[$key];
    if (node_hook($type->type, 'form')) {
      $row = array(
        theme('node_admin_overview', array(
          'name' => $name,
          'type' => $type,
        )),
      );
      if ($field_ui && user_access('administer node fields')) {
        $links['fields'] = array(
          'title' => t('Manage fields'),
          'href' => 'admin/structure/types/manage/' . $type->type . '/fields',
          'weight' => 0,
        );
      }
      if ($field_ui && user_access('administer node display')) {
        $links['display'] = array(
          'title' => t('Manage display'),
          'href' => 'admin/structure/types/manage/' . $type->type . '/display',
          'weight' => 5,
        );
      }
      $links['edit'] = array(
        'title' => t('Edit'),
        'href' => 'admin/structure/types/manage/' . $type->type,
        'weight' => 10,
      );
      if ($type->custom) {
        $links['delete'] = array(
          'title' => t('Delete'),
          'href' => 'admin/structure/types/manage/' . $type->type . '/delete',
          'weight' => 15,
        );
      }
      $row[] = array(
        'data' => array(
          '#type' => 'operations',
          '#links' => $links,
        ),
      );
      $rows[] = $row;
    }
  }
  $build['node_table'] = array(
    '#theme' => 'table',
    '#header' => $header,
    '#rows' => $rows,
    '#empty' => t('No content types available. <a href="@link">Add content type</a>.', array(
      '@link' => url('admin/structure/types/add'),
    )),
  );
  return $build;
}