You are here

function subscriptions_uninstall in Subscriptions 6

Same name and namespace in other branches
  1. 5.2 subscriptions.install \subscriptions_uninstall()
  2. 7 subscriptions.install \subscriptions_uninstall()

Implementation of hook_uninstall().

File

./subscriptions.install, line 103
Subscriptions module installation.

Code

function subscriptions_uninstall() {
  $ret = drupal_uninstall_schema('subscriptions');
  if (db_table_exists('subscriptions_mail_edit')) {
    db_drop_table($ret, 'subscriptions_mail_edit');

    // old table from 5.x-2.x
  }
  if (db_table_exists('subscriptions_old')) {
    db_drop_table($ret, 'subscriptions_old');

    // old backup from 5.x-1.x
  }
  if (db_table_exists('subscriptions_holding')) {
    db_drop_table($ret, 'subscriptions_holding');

    // old left-over from 5.x-1.x
  }
  if (db_table_exists('subscriptions_holding_old')) {
    db_drop_table($ret, 'subscriptions_holding_old');

    // old backup from 5.x-1.x
  }
  if (db_table_exists('subscriptions_sent')) {

    // old left-over from first
    db_drop_table($ret, 'subscriptions_sent');

    // incarnation of 5.x-2.0
  }
  if (db_table_exists('mail_edit')) {
    db_query("DELETE FROM {mail_edit} WHERE id LIKE 'subscriptions_%'");
  }
  if (db_table_exists('mail_edit_registry')) {
    db_query("DELETE FROM {mail_edit_registry} WHERE id LIKE 'subscriptions_%'");
  }
  variable_del('subscriptions_allow_html_node_output');
  variable_del('subscriptions_avoid_empty_subscribe_links');
  variable_del('subscriptions_blocked_content_types');
  variable_del('subscriptions_blocked_nodes');
  variable_del('subscriptions_cron_percent');
  variable_del('subscriptions_form_expanded');
  variable_del('subscriptions_form_in_block');
  variable_del('subscriptions_form_link_only');
  variable_del('subscriptions_generate_full_node');
  variable_del('subscriptions_hide_overview_page');
  variable_del('subscriptions_link_teaser');
  variable_del('subscriptions_omitted_taxa');
  variable_del('subscriptions_restricted_taxa');
  variable_del('subscriptions_send_intervals');
  variable_del('subscriptions_show_by_author_options');
  variable_del('subscriptions_static_content_types');
  variable_del('subscriptions_unlisted_content_types');

  // also remove legacy 5.x-1.9(-dev) variables:
  variable_del('subscriptions_allow_vid');
  variable_del('subscriptions_autoset');
  variable_del('subscriptions_email_body');
  variable_del('subscriptions_email_subject');
  variable_del('subscriptions_sendself');
  variable_del('subscriptions_teaser');
  variable_del('subscriptions_testpost');
  variable_del('subscriptions_usecron');
  variable_del('subscriptions_usersmenu');
}