You are here

function date_api_install in Date 7.3

Same name and namespace in other branches
  1. 8 date_api/date_api.install \date_api_install()
  2. 5.2 date_api.install \date_api_install()
  3. 6.2 date_api.install \date_api_install()
  4. 6 date_api.install \date_api_install()
  5. 7 date_api/date_api.install \date_api_install()
  6. 7.2 date_api/date_api.install \date_api_install()

Implements hook_install().

File

date_api/date_api.install, line 63
Install, update and uninstall functions for the date_api module.

Code

function date_api_install() {

  // Only set the message if Drupal itself is already installed.
  if (variable_get('install_task') == 'done') {

    // Ensure translations don't break at install time.
    $t = get_t();

    // date_api_set_variables can install date_timezone. The
    // date_timezone_install() function does a module_enable('date_api'). This
    // means that date_api_enable() can be called before date_api_install()
    // finishes! So the date_api schema needs to be installed before this line!
    date_api_set_variables();
    $message = $t('The Date API requires that you set up the <a href="@regional_settings">site timezone and first day of week settings</a> and the <a href="@regional_date_time">date format settings</a> to function correctly.', array(
      '@regional_settings' => url('admin/config/regional/settings'),
      '@regional_date_time' => url('admin/config/regional/date-time'),
    ));
    drupal_set_message(filter_xss_admin($message), 'warning');
  }
}