<?php
// $Id$

/**
 * @file
 * Provides install, upgrade and un-install functions for simplemap.
 */

/**
 * Implements hook_uninstall().
 */
function simplemap_uninstall() {
  // Delete menu block variables.
  foreach (variable_get('simplemap_block_ids', array()) AS $delta) {
    variable_del("simplemap_block_{$delta}");
  }
  variable_del('simplemap_ids');
  // Remove block configurations.
  db_query("DELETE FROM {blocks} WHERE module = 'simplemap'");
  db_query("DELETE FROM {blocks_roles} WHERE module = 'simplemap'");
  cache_clear_all();
}

/**
 * Implements hook_enable().
 */
function simplemap_enable() {
  drupal_set_message(t('To use simplemap blocks, find the "Add map block" tab (or button) on the <a href="@url">administer blocks page</a>.', array('@url' => url('admin/build/block'))));
}

/**
 * Implements hook_install().
 */
function simplemap_install() {
  // No-op.
}
