node_overview_types
modules/node/content_types.inc, строка 11
- Версии
- 5 – 6
node_overview_types()
Displays the content type admin overview page.
Код
<?php
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);
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии