File
- modules/node.module, line 1897
- The core that allows content to be submitted to the site.
Code
function node_form_submit($form_id, $edit) {
global $user;
$node = node_submit($edit);
if ($node->nid) {
$original_node = node_load($node->nid); if (node_access('update', $original_node)) {
node_save($node);
watchdog('content', t('%type: updated %title.', array('%type' => theme('placeholder', t($node->type)), '%title' => theme('placeholder', $node->title))), WATCHDOG_NOTICE, l(t('view'), 'node/' . $node->nid));
drupal_set_message(t('The %post was updated.', array('%post' => node_get_name($node))));
}
}
else {
if (node_access('create', $node)) {
node_save($node);
watchdog('content', t('%type: added %title.', array('%type' => theme('placeholder', t($node->type)), '%title' => theme('placeholder', $node->title))), WATCHDOG_NOTICE, l(t('view'), "node/$node->nid"));
drupal_set_message(t('Your %post was created.', array('%post' => node_get_name($node))));
}
}
if ($node->nid) {
if (node_access('view', $node)) {
return 'node/' . $node->nid;
}
else {
return '';
}
}
return FALSE;
}
Login or
register to post comments