File
- modules/node/node.module, line 2359
- The core that allows content to be submitted to the site. Modules and scripts may
programmatically submit nodes using the usual form API pattern.
Code
function node_form_submit($form_id, $form_values) {
global $user;
$node = node_submit($form_values);
if ($node->nid) {
node_save($node);
watchdog('content', t('@type: updated %title.', array('@type' => t($node->type), '%title' => $node->title)), WATCHDOG_NOTICE, l(t('view'), 'node/' . $node->nid));
drupal_set_message(t('The %post has been updated.', array('%post' => node_get_types('name', $node))));
}
else {
node_save($node);
watchdog('content', t('@type: added %title.', array('@type' => t($node->type), '%title' => $node->title)), WATCHDOG_NOTICE, l(t('view'), "node/$node->nid"));
drupal_set_message(t('Your %post has been created.', array('%post' => node_get_types('name', $node))));
}
if ($node->nid) {
if (node_access('view', $node)) {
return 'node/' . $node->nid;
}
else {
return '';
}
}
return FALSE;
}
Login or
register to post comments