You are here

function node_object_prepare in Drupal 4

Same name and namespace in other branches
  1. 5 modules/node/node.module \node_object_prepare()
  2. 6 modules/node/node.pages.inc \node_object_prepare()
  3. 7 modules/node/node.module \node_object_prepare()
1 call to node_object_prepare()
node_form_array in modules/node.module
Generate the node editing form array.

File

modules/node.module, line 1619
The core that allows content to be submitted to the site.

Code

function node_object_prepare(&$node) {
  if (user_access('administer nodes')) {

    // Set up default values, if required.
    if (!isset($node->created)) {
      $node->created = time();
    }
    if (!isset($node->date)) {
      $node->date = format_date($node->created, 'custom', 'Y-m-d H:i:s O');
    }
  }
  node_invoke($node, 'prepare');
  node_invoke_nodeapi($node, 'prepare');
}