Same name and namespace in other branches
  1. 5.x modules/node/node.module \_node_type_set_defaults()

Set default values for a node type defined through hook_node_info().

5 calls to _node_type_set_defaults()
default_profile_tasks in profiles/default/default.profile
Perform any final installation tasks for this profile.
example_profile_tasks in developer/example.profile
Perform any final installation tasks for this profile.
node_type_reset in modules/node/content_types.inc
Resets all of the relevant fields of a module-defined node type to their default values.
_book_install_type_create in modules/book/book.install
_node_types_build in modules/node/node.module
Builds and returns the list of available node types.

File

modules/node/node.module, line 591
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_type_set_defaults($info) {
  if (!isset($info['has_title'])) {
    $info['has_title'] = TRUE;
  }
  if ($info['has_title'] && !isset($info['title_label'])) {
    $info['title_label'] = t('Title');
  }
  if (!isset($info['has_body'])) {
    $info['has_body'] = TRUE;
  }
  if ($info['has_body'] && !isset($info['body_label'])) {
    $info['body_label'] = t('Body');
  }
  if (!isset($info['help'])) {
    $info['help'] = '';
  }
  if (!isset($info['min_word_count'])) {
    $info['min_word_count'] = 0;
  }
  if (!isset($info['custom'])) {
    $info['custom'] = FALSE;
  }
  if (!isset($info['modified'])) {
    $info['modified'] = FALSE;
  }
  if (!isset($info['locked'])) {
    $info['locked'] = TRUE;
  }
  $info['orig_type'] = $info['type'];
  $info['is_new'] = TRUE;
  return $info;
}