function node_overview_types

Displays the content type admin overview page.

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

File

modules/node/content_types.inc, line 11

Code

function node_overview_types() {
    $types = node_type_get_types();
    $names = node_type_get_names();
    $field_ui = module_exists('field_ui') && user_access('administer fields');
    $header = array(
        t('Name'),
        array(
            'data' => t('Operations'),
            'colspan' => $field_ui ? '4' : '2',
        ),
    );
    $rows = array();
    foreach ($names as $key => $name) {
        $type = $types[$key];
        if (node_hook($type->type, 'form')) {
            $type_url_str = str_replace('_', '-', $type->type);
            $row = array(
                theme('node_admin_overview', array(
                    'name' => $name,
                    'type' => $type,
                )),
            );
            // Set the edit column.
            $row[] = array(
                'data' => l(t('edit'), 'admin/structure/types/manage/' . $type_url_str),
            );
            if ($field_ui) {
                // Manage fields.
                $row[] = array(
                    'data' => l(t('manage fields'), 'admin/structure/types/manage/' . $type_url_str . '/fields'),
                );
                // Display fields.
                $row[] = array(
                    'data' => l(t('manage display'), 'admin/structure/types/manage/' . $type_url_str . '/display'),
                );
            }
            // Set the delete column.
            if ($type->custom) {
                $row[] = array(
                    'data' => l(t('delete'), 'admin/structure/types/manage/' . $type_url_str . '/delete'),
                );
            }
            else {
                $row[] = array(
                    'data' => '',
                );
            }
            $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;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.