diff --git a/core/modules/node/node.admin.css b/core/modules/node/node.admin.css index 5777b1f..d20e5d9 100644 --- a/core/modules/node/node.admin.css +++ b/core/modules/node/node.admin.css @@ -10,3 +10,7 @@ .revision-current { background: #ffc; } +.node-type-edit { + font-size: .8em; + margin-left: .5em; +} diff --git a/core/modules/node/node.pages.inc b/core/modules/node/node.pages.inc index 4e94b26..914d4bf 100644 --- a/core/modules/node/node.pages.inc +++ b/core/modules/node/node.pages.inc @@ -34,6 +34,12 @@ function node_add_page() { $item = array_shift($content); drupal_goto($item['href']); } + elseif (user_access('administer content types')) { + // Generate links to edit content type if the current user has proper permissions. + foreach ($content as $key => $item) { + $content[$key]['edit_href'] = str_replace('node/add', 'admin/structure/types/manage', $item['href']); + } + } return theme('node_add_list', array('content' => $content)); } @@ -54,7 +60,9 @@ function theme_node_add_list($variables) { if ($content) { $output = '
'; foreach ($content as $item) { - $output .= '
' . l($item['title'], $item['href'], $item['localized_options']) . '
'; + $output .= '
' . l($item['title'], $item['href'], $item['localized_options']); + $output .= isset($item['edit_href']) ? ' [ ' . l(t('Edit content type'), $item['edit_href']) . ' ]' : ''; + $output .= '
'; $output .= '
' . filter_xss_admin($item['description']) . '
'; } $output .= '
'; diff --git a/core/themes/seven/template.php b/core/themes/seven/template.php index a9cc3c3..529f83d 100644 --- a/core/themes/seven/template.php +++ b/core/themes/seven/template.php @@ -48,6 +48,7 @@ function seven_node_add_list($variables) { foreach ($content as $item) { $output .= '
  • '; $output .= '' . l($item['title'], $item['href'], $item['localized_options']) . ''; + $output .= isset($item['edit_href']) ? ' [ ' . l(t('Edit content type'), $item['edit_href']) . ' ]' : ''; $output .= '
    ' . filter_xss_admin($item['description']) . '
    '; $output .= '
  • '; }