You are here

function lexicon_uninstall in Lexicon 6

Same name and namespace in other branches
  1. 7 lexicon.install \lexicon_uninstall()

Implementation of hook_uninstall(). There are no tables, so we delete all variables and clear the filter cache. It is left to the user to dispose of any vocabularies that are no longer needed.

File

./lexicon.install, line 45
Lexicon module installation functions.

Code

function lexicon_uninstall() {
  $vids = variable_get('lexicon_vids', array());

  //Delete the settings for each Lexicon vocabulary
  foreach ($vids as $vid) {
    variable_del('lexicon_path_' . $vid);
    variable_del('lexicon_title_' . $vid);
    variable_del('lexicon_vids');
  }

  //Delete the rest of the variables
  variable_del('lexicon_vids');
  variable_del('lexicon_disable_indicator');
  variable_del('lexicon_click_option');
  variable_del('lexicon_show_edit');
  variable_del('lexicon_show_search');
  variable_del('lexicon_go_to_top_link');
  variable_del('lexicon_go_to_top_link_fragment');
  variable_del('lexicon_local_links_scroll');
  variable_del('lexicon_page_per_letter');
  variable_del('lexicon_seperate_letters');
  variable_del('lexicon_allow_no_description');
  variable_del('lexicon_show_description');
  variable_del('lexicon_show_detailed');
  variable_del('lexicon_link_related');
  variable_del('lexicon_link_related_how');
  variable_del('lexicon_term_class');
  variable_del('lexicon_mark_terms');
  variable_del('lexicon_match');
  variable_del('lexicon_case');
  variable_del('lexicon_replace_all');
  variable_del('lexicon_blocking_tags');
  variable_del('lexicon_link');
  variable_del('lexicon_replace');
  variable_del('lexicon_superscript');
  variable_del('lexicon_icon');
  variable_del('lexicon_alphabet');
  variable_del('lexicon_digits');
  variable_del('lexicon_suppress_unused');
  variable_del('lexicon_alphabar_separator');
  variable_del('lexicon_alphabar_instruction');

  // Let's make sure the filter cache is cleared of our stuff.
  cache_clear_all(NULL, 'cache_filter');
  drupal_set_message(t('The Lexicon module has been uninstalled. You will still need to decide what to do with vocabularies that were used.'), 'warning');
}