You are here

node_recur.install in Node recur 7.2

Same filename and directory in other branches
  1. 7 node_recur.install

File

node_recur.install
View source
<?php

/**
 * Implements hook_uninstall().
 */
function node_recur_uninstall() {
  foreach (node_type_get_types() as $type => $info) {
    variable_del("node_recur_enabled_node_type_{$type}");
    variable_del("node_recur_allow_past_dates_node_type_{$type}");
    variable_del("node_recur_max_span_node_type_{$type}");
    variable_del("node_recur_date_field_node_type_{$type}");
    variable_del("node_recur_node_form_node_type_{$type}");
  }
}

/**
 * Clean up options on type delete
 */
function node_recur_node_type_delete($info) {
  variable_del("node_recur_enabled_node_type_{$info->type}");
  variable_del("node_recur_allow_past_dates_node_type_{$info->type}");
  variable_del("node_recur_max_span_node_type_{$info->type}");
  variable_del("node_recur_date_field_node_type_{$info->type}");
  variable_del("node_recur_node_form_node_type_{$info->type}");
}

/**
 *  Enable the new required modules
 */
function node_recur_update_7000() {
  module_enable(array(
    "date",
    "date_api",
    "date_repeat",
    "date_repeat_field",
  ), TRUE);
  drupal_set_message('The following modules are now required and have been enabled: "date", "date_api", "date_repeat", "date_repeat_field"');
}

/**
 * Remove unused variables
 */
function node_recur_update_7001() {
  foreach (node_type_get_types() as $type => $info) {
    variable_del("node_recur_allow_past_dates_node_type_{$type}");
    variable_del("node_recur_max_span_node_type_{$type}");
    variable_del("node_recur_node_form_node_type_{$type}");
  }
}

Functions

Namesort descending Description
node_recur_node_type_delete Clean up options on type delete
node_recur_uninstall Implements hook_uninstall().
node_recur_update_7000 Enable the new required modules
node_recur_update_7001 Remove unused variables