summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2008-11-02 10:52:53 +0000
committerDries Buytaert <dries@buytaert.net>2008-11-02 10:52:53 +0000
commit05420fde76b402a8c29e159d3fe78a142341f6d1 (patch)
tree897f05f4a82f59fadbc216ed1b105a0b30bdd524
parenta6a58c16ebf3907f28e16ee924704cce08a67774 (diff)
downloadbrdo-05420fde76b402a8c29e159d3fe78a142341f6d1.tar.gz
brdo-05420fde76b402a8c29e159d3fe78a142341f6d1.tar.bz2
- Patch #302120 by dmitrig01: usability improvement - make the content type admin screen prettier.
-rw-r--r--CHANGELOG.txt1
-rw-r--r--modules/node/content_types.inc19
-rw-r--r--modules/node/node.module3
3 files changed, 15 insertions, 8 deletions
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index e419c23c6..ad1d2615e 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -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.
diff --git a/modules/node/content_types.inc b/modules/node/content_types.inc
index 826deac83..c82025047 100644
--- a/modules/node/content_types.inc
+++ b/modules/node/content_types.inc
@@ -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.'),
diff --git a/modules/node/node.module b/modules/node/node.module
index 5c4bc884a..473eb857d 100644
--- a/modules/node/node.module
+++ b/modules/node/node.module
@@ -135,6 +135,9 @@ function node_theme() {
'node_submitted' => array(
'arguments' => array('node' => NULL),
),
+ 'node_admin_overview' => array(
+ 'arguments' => array('name' => NULL, 'type' => NULL),
+ ),
);
}