<?php
/**
 * @file
 * Install, update and uninstall functions for the calendar module.
 *
 */

function calendar_update_last_removed() {
  return 6002;
}

/**
 * Remove D6-style calendar legend block from block table.
 */
function calendar_update_7000() {
  // Remove the former Calendar legend block, if any.
  db_query("DELETE FROM {block} WHERE module = 'calendar' AND delta = '0'");
}

/**
 * Uninstall Calendar iCal module so it can be removed.
 */
function calendar_update_7001() {
  if (module_exists('calendar_ical')) {
    module_disable(array('calendar_ical'));
  }
}

/**
 * Delete calendar_default_view_options(), which was used by the old default view and is no longer used.
 */
function calendar_update_7002() {
  variable_del('calendar_default_view_options');
}