function node_overview_types in Drupal 6
Same name and namespace in other branches
- 5 modules/node/content_types.inc \node_overview_types()
- 7 modules/node/content_types.inc \node_overview_types()
Displays the content type admin overview page.
1 string reference to 'node_overview_types'
- node_menu in modules/
node/ node.module - Implementation of hook_menu().
File
- modules/
node/ content_types.inc, line 11 - Content type editing UI.
Code
function node_overview_types() {
$types = node_get_types();
$names = node_get_types('names');
$header = array(
t('Name'),
t('Type'),
t('Description'),
array(
'data' => t('Operations'),
'colspan' => '2',
),
);
$rows = array();
foreach ($names as $key => $name) {
$type = $types[$key];
if (node_hook($type, 'form')) {
$type_url_str = str_replace('_', '-', $type->type);
$row = array(
l($name, 'admin/content/node-type/' . $type_url_str),
check_plain($type->type),
filter_xss_admin($type->description),
);
// Set the edit column.
$row[] = array(
'data' => l(t('edit'), 'admin/content/node-type/' . $type_url_str),
);
// Set the delete column.
if ($type->custom) {
$row[] = array(
'data' => l(t('delete'), 'admin/content/node-type/' . $type_url_str . '/delete'),
);
}
else {
$row[] = array(
'data' => '',
);
}
$rows[] = $row;
}
}
if (empty($rows)) {
$rows[] = array(
array(
'data' => t('No content types available.'),
'colspan' => '5',
'class' => 'message',
),
);
}
return theme('table', $header, $rows);
}