You are here

function likebtn_uninstall in Like Button 8.2

Same name and namespace in other branches
  1. 7 likebtn.install \likebtn_uninstall()

Implements hook_uninstall().

File

./likebtn.install, line 21
Install, update and uninstall functions for the LikeBtn module.

Code

function likebtn_uninstall() {
  variable_del('likebtn_nodetypes');
  variable_del('likebtn_comments_nodetypes');
  variable_del('likebtn_view_modes');
  variable_del('likebtn_weight');
  variable_del('likebtn_plan');
  variable_del('likebtn_account_data_email');
  variable_del('likebtn_account_data_api_key');
  variable_del('likebtn_sync_inerval');
  variable_del('likebtn_html_before');
  variable_del('likebtn_html_after');
  variable_del('likebtn_alignment');
  variable_del('likebtn_user_logged_in');
  variable_del('likebtn_settings_local_domain');
  variable_del('likebtn_settings_subdirectory');
  require_once dirname(__FILE__) . '/likebtn.module';
  $settings = unserialize(LIKEBTN_SETTINGS);
  foreach ($settings as $option_name => $option_info) {
    variable_del('likebtn_settings_' . $option_name);
  }
  variable_del('likebtn_last_sync_time');
  variable_del('likebtn_last_successfull_sync_time');
  variable_del('likebtn_last_locale_sync_time');
  variable_del('likebtn_last_style_sync_time');
  variable_del('likebtn_locales');
  variable_del('likebtn_styles');

  // Delete dynamically named variables.
  db_delete('variable')
    ->condition('name', 'likebtn_comments_sort_enabled_%', 'LIKE')
    ->execute();
  db_delete('variable')
    ->condition('name', 'likebtn_comments_sort_by_%', 'LIKE')
    ->execute();
  db_delete('variable')
    ->condition('name', 'likebtn_comments_sort_order_%', 'LIKE')
    ->execute();
  cache_clear_all('variables', 'cache_bootstrap');
}