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 (function_exists($type->module .'_form')) {
$type_url_str = str_replace('_', '-', $type->type);
// Populate the operations field.
$operations = array();
// Set the edit column.
$operations[] = array('data' => l(t('edit'), 'admin/content/types/'. $type_url_str));
// Set the delete column.
if ($type->custom) {
$operations[] = array('data' => l(t('delete'), 'admin/content/types/'. $type_url_str .'/delete'));
}
else {
$operations[] = array('data' => '');
}
$row = array(array('data' => l($name, 'admin/content/types/'. $type_url_str), 'class' => $class), array('data' => check_plain($type->type), 'class' => $class), array('data' => check_plain($type->description), 'class' => $class));
foreach ($operations as $operation) {
$operation['class'] = $class;
$row[] = $operation;
}
$rows[] = $row;
}
}
if (empty($rows)) {
$rows[] = array(array('data' => t('No content types available.'), 'colspan' => '5', 'class' => 'message'));
}
return theme('table', $header, $rows);
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии