You are here

function flickr_block_uninstall in Flickr 7

Same name and namespace in other branches
  1. 5 block/flickr_block.install \flickr_block_uninstall()
  2. 6 block/flickr_block.install \flickr_block_uninstall()

Implements hook_uninstall().

File

block/flickr_block.install, line 629
The Flickr Block install hook

Code

function flickr_block_uninstall() {
  variable_del("flickr_block_refresh_random");
  variable_del("flickr_block_refresh_others");
  variable_del('flickr_block_heading');
  variable_del('flickr_block_hide_empty');
  variable_del('flickr_block_photos_per_set');
  db_delete('block')
    ->condition('module', 'flickr')
    ->execute();
  db_delete('block_node_type')
    ->condition('module', 'flickr')
    ->execute();
  db_delete('block_role')
    ->condition('module', 'flickr')
    ->execute();
  foreach (range(0, 16) as $delta) {
    variable_del("flickr_block_{$delta}");
  }
  if (function_exists('taxonomy_vocabulary_machine_name_load')) {
    $vocabulary = taxonomy_vocabulary_machine_name_load('flickr_tags');
    if ($vocabulary) {
      field_delete_field('field_' . $vocabulary->machine_name);
      taxonomy_vocabulary_delete($vocabulary->vid);
    }
  }
  $field = field_info_field('field_flickr_date');
  if ($field) {
    field_delete_field('field_flickr_date');
  }
  $field = field_info_field('field_flickr_geo');
  if ($field) {
    field_delete_field('field_flickr_geo');
  }
  field_purge_batch(500);
}