You are here

function merci_install in MERCI (Manage Equipment Reservations, Checkout and Inventory) 6

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

Implementation of hook_install().

File

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

Code

function merci_install() {

  // Core doesn't load the .module file on install for some reason,
  // so load it here manually.
  drupal_load('module', 'merci');

  // Create tables.
  drupal_install_schema('merci');

  // Set the weight of the merci module to be higher than that of the date
  // module.
  $date_weight = db_result(db_query("SELECT weight FROM {system} WHERE name = 'date'"));
  $weight = $date_weight ? $date_weight + 1 : 0;
  db_query("UPDATE {system} SET weight = %d WHERE name = 'merci'", $weight);

  // Create the date, commercial_total, and member_total fields for the reservation.
  $short_date_format = variable_get('date_format_short', 'm/d/Y - H:i');
  $date_only_format = substr($short_date_format, 0, 5);
}