function node_add

cis7 node.pages.inc node_add($type)
cle7 node.pages.inc node_add($type)
elmsmedia7 node.pages.inc node_add($type)
icor7 node.pages.inc node_add($type)
meedjum_blog7 node.pages.inc node_add($type)
mooc7 node.pages.inc node_add($type)

Returns a node submission form.

Parameters

$type: The node type for the submitted node.

Return value

The themed form.

8 string references to 'node_add'
ctools_context_create_node_add_form in sites/all/modules/ulmus/ctools/plugins/contexts/node_add_form.inc
It's important to remember that $conf is optional here, because contexts are not always created from the UI.
drupal-6.bare.database.php in modules/simpletest/tests/upgrade/drupal-6.bare.database.php
Bare installation of Drupal 6.17, for test purposes.
drupal-6.filled.database.php in modules/simpletest/tests/upgrade/drupal-6.filled.database.php
Filled installation of Drupal 6.17, for test purposes.
drupal-6.og-ui.database.php in sites/all/modules/ulmus/og/og_ui/tests/drupal-6.og-ui.database.php
Filled installation of Drupal 6.17, for test purposes.
drupal-6.og.database.php in sites/all/modules/ulmus/og/tests/drupal-6.og.database.php
Filled installation of Drupal 6.17, for test purposes.

... See full list

File

modules/node/node.pages.inc, line 72
Page callbacks for adding, editing, deleting, and revisions management for content.

Code

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;
}