You are here

function _simplenews_install_nodetype in Simplenews 6.2

Same name and namespace in other branches
  1. 6 simplenews.install \_simplenews_install_nodetype()
  2. 7.2 simplenews.install \_simplenews_install_nodetype()
  3. 7 simplenews.install \_simplenews_install_nodetype()

Create simplenews node type.

2 calls to _simplenews_install_nodetype()
simplenews_install in ./simplenews.install
Implementation of hook_install().
simplenews_update_6006 in ./simplenews.install
Make the simplenews content type a custom type.

File

./simplenews.install, line 286
Simplenews installation.

Code

function _simplenews_install_nodetype() {

  // Create a newsletter type. If exists, modify it.
  if ($type = node_get_types('type', 'simplenews')) {
    $type->module = 'node';
    $type->locked = FALSE;
    $type->custom = TRUE;
    node_type_save($type);
  }
  else {
    $info = array(
      'type' => 'simplenews',
      'name' => t('Newsletter issue'),
      'module' => 'node',
      'description' => t('A newsletter issue to be sent to subscribed email addresses.'),
      'locked' => FALSE,
      'custom' => TRUE,
    );
    $info = _node_type_set_defaults($info);
    node_type_save((object) $info);
  }
}