You are here

function date_api_enable in Date 6.2

Same name and namespace in other branches
  1. 5.2 date_api.install \date_api_enable()
  2. 7.3 date_api/date_api.install \date_api_enable()
  3. 7 date_api/date_api.install \date_api_enable()
  4. 7.2 date_api/date_api.install \date_api_enable()

Implementation of hook_enable().

File

./date_api.install, line 183

Code

function date_api_enable() {

  // When module is enabled, build the list of date formats and types.  This
  // includes those provided by this module and other contrib modules.  As the
  // date_format tables are created but the schema hasn't been updated, force
  // a refresh so we can use the schema API.
  drupal_get_schema('', TRUE);

  // Ensure schema has been installed - order of things gets out of sync because
  // date_api_set_variables() in date_api_install() enables the 'date_timezone'
  // module, which in return enables the 'date_api' module!
  if (db_table_exists('date_format_types')) {
    date_formats_rebuild();
  }
  date_api_set_variables();
}