function node_add_page
Same name and namespace in other branches
- 6.x drupal-6.x/modules/node/node.pages.inc \node_add_page()
Page callback: Displays add content links for available content types.
Redirects to node/add/[type] if only one content type is available.
See also
3 string references to 'node_add_page'
- drupal-6.bare.database.php in drupal-7.x/
modules/ simpletest/ tests/ upgrade/ drupal-6.bare.database.php - Bare installation of Drupal 6.17, for test purposes.
- drupal-6.filled.database.php in drupal-7.x/
modules/ simpletest/ tests/ upgrade/ drupal-6.filled.database.php - Filled installation of Drupal 6.17, for test purposes.
- node_menu in drupal-7.x/
modules/ node/ node.module - Implements hook_menu().
Archivo
- drupal-7.x/
modules/ node/ node.pages.inc, line 24 - Page callbacks for adding, editing, deleting, and revisions management for content.
Código
function node_add_page() {
$item = menu_get_item();
$content = system_admin_menu_block($item);
// Bypass the node/add listing if only one content type is available.
if (count($content) == 1) {
$item = array_shift($content);
drupal_goto($item['href']);
}
return theme('node_add_list', array('content' => $content));
}