You are here

function biblio_install in Bibliography Module 7.2

Same name and namespace in other branches
  1. 5 biblio.install \biblio_install()
  2. 6.2 biblio.install \biblio_install()
  3. 6 biblio.install \biblio_install()
  4. 7.3 biblio.install \biblio_install()
  5. 7 biblio.install \biblio_install()

Implements hook_install().

File

./biblio.install, line 5

Code

function biblio_install() {

  // @todo remove after development
  $timer_name = 'biblio_install()';
  timer_start($timer_name);
  module_load_include('inc', 'biblio', 'includes/biblio.fields');
  $t = get_t();
  set_time_limit(300);

  // we don't need custom fields
  //  $result[] = _add_db_field_data();
  $result[] = _add_bundles();

  // @todo: add contributor field data contained in this function
  //  $result[] = _add_custom_field_data();
  _enable_biblio_keyword_vocabulary();
  $result[] = _set_system_weight();
  biblio_add_fields();
  biblio_add_field_instances('biblio_contributor', 'person');
  biblio_add_field_instances('biblio_contributor', 'organization');

  // @todo remove after development
  timer_stop($timer_name);
  drupal_set_message($timer_name . ' run time: ' . timer_read($timer_name) . 'ms.');

  //  if (count($result) == count(array_filter($result))) {
  //    drupal_set_message(t('The biblio module has successfully added its tables to the database.'));
  //  }
  //  else {
  //    drupal_set_message(t('Drupal encountered some errors while attempting to install the database tables for the biblio module.'), 'error');
  //  }
}