Skip to content
Snippets Groups Projects
Commit 05420fde authored by Dries Buytaert's avatar Dries Buytaert
Browse files

- Patch #302120 by dmitrig01: usability improvement - make the content type admin screen prettier.

parent a6a58c16
No related merge requests found
......@@ -29,6 +29,7 @@ Drupal 7.0, xxxx-xx-xx (development version)
file copy to the includes directory).
* Added an edit tab to taxonomy term pages.
* Redesigned password strength validator.
* Redesigned the add content type screen.
- News aggregator:
* Added OPML import functionality for RSS feeds.
* Optionally, RSS feeds may be configured to not automatically generate feed blocks.
......
......@@ -12,18 +12,14 @@
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'));
$header = array(t('Name'), 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(
check_plain($name),
check_plain($type->type),
filter_xss_admin($type->description),
);
$row = array(theme('node_admin_overview', $name, $type));
// Set the edit column.
$row[] = array('data' => l(t('edit'), 'admin/build/node-type/' . $type_url_str));
......@@ -45,6 +41,13 @@ function node_overview_types() {
return theme('table', $header, $rows);
}
function theme_node_admin_overview($name, $type) {
$output = check_plain($name);
$output .= ' <small> (Machine name: ' . check_plain($type->type) . ')</small>';
$output .= '<div class="description">' . filter_xss_admin($type->description) . '</div>';
return $output;
}
/**
* Generates the node type editing form.
*/
......@@ -71,7 +74,7 @@ function node_type_form(&$form_state, $type = NULL) {
if (!$type->locked) {
$form['identity']['type'] = array(
'#title' => t('Type'),
'#title' => t('Machine name'),
'#type' => 'textfield',
'#default_value' => $type->type,
'#maxlength' => 32,
......@@ -85,7 +88,7 @@ function node_type_form(&$form_state, $type = NULL) {
'#value' => $type->type,
);
$form['identity']['type_display'] = array(
'#title' => t('Type'),
'#title' => t('Machine name'),
'#type' => 'item',
'#markup' => theme('placeholder', $type->type),
'#description' => t('The machine-readable name of this content type. This field cannot be modified for system-defined content types.'),
......
......@@ -135,6 +135,9 @@ function node_theme() {
'node_submitted' => array(
'arguments' => array('node' => NULL),
),
'node_admin_overview' => array(
'arguments' => array('name' => NULL, 'type' => NULL),
),
);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment