diff --git a/core/modules/node/node.pages.inc b/core/modules/node/node.pages.inc index 12437e1..43f908e 100644 --- a/core/modules/node/node.pages.inc +++ b/core/modules/node/node.pages.inc @@ -59,9 +59,17 @@ function theme_node_add_list($variables) { $output = ''; if ($content) { + if (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 = 'admin/structure/types/manage/' . $item->type; + } + } $output = '
'; foreach ($content as $type) { - $output .= '
' . l($type->name, 'node/add/' . $type->type) . '
'; + $output .= '
' . l($type->name, 'node/add/' . $type->type); + $output .= isset($type->edit_href) ? ' [ ' . l(t('Edit content type'), $type->edit_href) . ' ]' : ''; + $output .= '
'; $output .= '
' . filter_xss_admin($type->description) . '
'; } $output .= '
'; diff --git a/core/themes/seven/style.css b/core/themes/seven/style.css index 24b0035..7939919 100644 --- a/core/themes/seven/style.css +++ b/core/themes/seven/style.css @@ -992,3 +992,9 @@ div.add-or-remove-shortcuts { color: #fff; border-radius: 8px; } + +/* Add content page */ +.node-type-edit { + font-size: .8em; + margin-left: .5em; +} diff --git a/core/themes/seven/template.php b/core/themes/seven/template.php index a8643ab..c51da59 100644 --- a/core/themes/seven/template.php +++ b/core/themes/seven/template.php @@ -44,10 +44,17 @@ function seven_node_add_list($variables) { $content = $variables['content']; $output = ''; if ($content) { + if (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 = 'admin/structure/types/manage/'.$item->type; + } + } $output = '