You are here

function merci_enable in MERCI (Manage Equipment Reservations, Checkout and Inventory) 7.2

Same name and namespace in other branches
  1. 6.2 merci.install \merci_enable()
  2. 6 merci.install \merci_enable()

Implements hook_enable().

File

./merci.install, line 86
merci Installer / Uninstaller

Code

function merci_enable() {
  merci_add_group_taxonomy();
  merci_create_cck_fields();

  // Add any node types to the MERCI tables that aren't already there.
  $new_types = db_query("SELECT type FROM {node_type} nt WHERE nt.type NOT IN (SELECT type FROM {merci_node_type})");
  foreach ($new_types as $new_type) {

    // TODO Please review the conversion of this statement to the D7 database API syntax.

    /* db_query("INSERT INTO {merci_node_type} (type) VALUES ('%s')", $new_type->type) */
    $id = db_insert('merci_node_type')
      ->fields(array(
      'type' => $new_type->type,
    ))
      ->execute();
  }

  //merci_check_default_timezone();
}