You are here

function biblio_reset_types in Bibliography Module 6.2

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

Helper function to reset all field defintions to their defaults.

See also

biblio_admin_types_reset_form_submit()

1 call to biblio_reset_types()
biblio_admin_types_reset_form_submit in includes/biblio.admin.inc

File

./biblio.install, line 1360
Install, update, and uninstall functions for the biblio module.

Code

function biblio_reset_types() {
  $result = array();
  db_drop_table($result, 'biblio_field_type_data');
  db_drop_table($result, 'biblio_field_type');
  db_drop_table($result, 'biblio_fields');
  db_drop_table($result, 'biblio_contributor_type');
  db_drop_table($result, 'biblio_contributor_type_data');
  $schema = biblio_schema();
  db_create_table($result, 'biblio_field_type_data', $schema['biblio_field_type_data']);
  db_create_table($result, 'biblio_field_type', $schema['biblio_field_type']);
  db_create_table($result, 'biblio_fields', $schema['biblio_fields']);
  db_create_table($result, 'biblio_contributor_type', $schema['biblio_contributor_type']);
  db_create_table($result, 'biblio_contributor_type_data', $schema['biblio_contributor_type_data']);

  // Also reset the custom field type ID
  variable_set('biblio_last_ftdid', 100);
  _biblio_add_field_definitions();
  _biblio_types_customize_fields();
}