You are here

function tac_fields_install in Taxonomy Access Control 6

Implements hook_install(). Adds module tables to the database and sets module weight.

File

tac_fields/tac_fields.install, line 110
Install, update, and uninstall functions for the TAC Fields module.

Code

function tac_fields_install() {
  drupal_set_message(t("Warning: The TAC Fields module is experimental.  Do not use on a production site."), 'warning', FALSE);

  // Use Schema API to install tables.
  $status = drupal_install_schema('tac_fields');

  // drupal_install_schema() returns an array of the results of each query;
  // each entry includes 'status' which is 0 for failure or 1 for success.
  $success = 1;
  foreach ($status as $s) {
    $success = $success * $s['success'];
  }

  // Notify of changes
  if ($success) {
    drupal_set_message(t('TAC Fields module installed tables successfully.'));
  }
  else {
    drupal_set_message(t('The installation of TAC Fields was unsuccessful.'), 'error');
  }
}