You are here

function mailgun_uninstall in Mailgun 7

Same name and namespace in other branches
  1. 8 mailgun.install \mailgun_uninstall()

Implements hook_uninstall().

File

./mailgun.install, line 11
Install, update and uninstall functions for the Mailgun module.

Code

function mailgun_uninstall() {
  global $language;

  // We need to load our module to make possible use constants.
  // See hook_uninstall() for details.
  drupal_load('module', 'mailgun');

  // Get title and description from mailgun_variable_info().
  module_load_include('inc', 'mailgun', 'mailgun.variable');
  $variables = module_invoke('mailgun', 'variable_info', array(
    'language' => $language,
  ));

  // Delete variables.
  foreach ($variables as $variable => $data) {
    variable_del($variable);
  }
}