function node_add
Same name and namespace in other branches
- 6.x drupal-6.x/modules/node/node.pages.inc \node_add()
Returns a node submission form.
Parameters
$type: The node type for the submitted node.
Return value
The themed form.
3 string references to 'node_add'
- 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 72 - Page callbacks for adding, editing, deleting, and revisions management for content.
Código
function node_add($type) {
global $user;
$types = node_type_get_types();
$node = (object) array(
'uid' => $user->uid,
'name' => (isset($user->name) ? $user->name : ''),
'type' => $type,
'language' => LANGUAGE_NONE,
);
drupal_set_title(t('Create @name', array('@name' => $types[$type]->name)), PASS_THROUGH);
$output = drupal_get_form($type . '_node_form', $node);
return $output;
}