From cbca44a8a740bb606505c6eb59491a06f8f33f6e Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Tue, 10 Apr 2007 12:08:38 +0000 Subject: [PATCH] - Patch #113898 by chx: make it possible to remove create content links. --- modules/node/node.module | 26 ++++---------------------- 1 file changed, 4 insertions(+), 22 deletions(-) diff --git a/modules/node/node.module b/modules/node/node.module index c79aeeea017..978aceece08 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -1190,7 +1190,7 @@ function node_menu() { ); $items['node/add'] = array( 'title' => t('Create content'), - 'page callback' => 'node_add', + 'page callback' => 'system_admin_menu_block_page', 'access callback' => '_node_add_access', 'weight' => 1, ); @@ -1206,9 +1206,11 @@ function node_menu() { $type_url_str = str_replace('_', '-', $type->type); $items['node/add/'. $type_url_str] = array( 'title' => drupal_ucfirst($name), + 'page callback' => 'node_add', 'page arguments' => array(2), 'access callback' => 'node_access', 'access arguments' => array('create', $type->type), + 'description' => $type->description, ); $items['admin/content/types/'. $type_url_str] = array( 'title' => t($type->name), @@ -2177,7 +2179,7 @@ function _node_add_access() { /** * Present a node submission form or a set of links to such forms. */ -function node_add($type = NULL) { +function node_add($type) { global $user; $types = node_get_types(); @@ -2190,26 +2192,6 @@ function node_add($type = NULL) { drupal_set_title(t('Submit @name', array('@name' => $types[$type]->name))); $output = drupal_get_form($type .'_node_form', $node); } - else { - // If no (valid) node type has been provided, display a node type overview. - foreach ($types as $type) { - if (function_exists($type->module .'_form') && node_access('create', $type->type)) { - $type_url_str = str_replace('_', '-', $type->type); - $title = t('Add a new @s.', array('@s' => $type->name)); - $out = '
'. l(drupal_ucfirst($type->name), "node/add/$type_url_str", array('attributes' => array('title' => $title))) .'
'; - $out .= '
'. filter_xss_admin($type->description) .'
'; - $item[$type->type] = $out; - } - } - - if (isset($item)) { - uksort($item, 'strnatcasecmp'); - $output = '
'. implode('', $item) .'
'; - } - else { - $output = t('No content types available.'); - } - } return $output; }