You are here

function forward_install in Forward 7.2

Same name and namespace in other branches
  1. 8.3 forward.install \forward_install()
  2. 8 forward.install \forward_install()
  3. 8.2 forward.install \forward_install()
  4. 5 forward.install \forward_install()
  5. 6 forward.install \forward_install()
  6. 7.3 forward.install \forward_install()
  7. 7 forward.install \forward_install()
  8. 4.x forward.install \forward_install()
  9. 4.0.x forward.install \forward_install()

Implements hook_install().

File

./forward.install, line 12
Install, update and uninstall functions for the forward module.

Code

function forward_install() {
  variable_set('forward_theme_template', 1);

  // Setup mail system for HTML emails
  $mail_systems = variable_get('mail_system', array(
    'default-system' => 'DefaultMailSystem',
  ));
  $mail_systems['forward'] = 'ForwardMailSystem';
  variable_set('mail_system', $mail_systems);

  // Warn administrator
  if (module_exists('mailsystem')) {
    $link = l(t('Review or change your mail setup.'), 'admin/config/system/mailsystem', array());
    drupal_set_message(t('The mail system for Forward has been set to enable HTML emails. ') . $link, 'warning');
  }

  // Initialize statistics table
  $query = db_select('node', 'n');
  $query
    ->addField('n', 'nid');
  db_insert('forward_statistics')
    ->from($query)
    ->execute();
}