You are here

date_repeat.install in Date 6.2

Install file for Date Repeat.

File

date_repeat/date_repeat.install
View source
<?php

/**
 * @file
 * Install file for Date Repeat.
 */

/**
 * Implementation of hook_install().
 */
function date_repeat_install() {

  // Make sure this module loads after date_api.
  db_query("UPDATE {system} SET weight = 1 WHERE name = 'date_repeat'");
  if (module_exists('content')) {
    drupal_load('module', 'content');
    if (!db_table_exists(content_instance_tablename())) {
      return;
    }
    db_query("UPDATE {" . content_instance_tablename() . "} SET widget_active=1 WHERE widget_type='%s' OR widget_type='%s' OR widget_type='%s'", 'date_select_repeat', 'date_text_repeat', 'date_popup_repeat');
    content_clear_type_cache(TRUE);
  }
}

/**
 * Implementation of hook_uninstall().
 */
function date_repeat_uninstall() {
  if (module_exists('content')) {
    drupal_load('module', 'content');
    if (!db_table_exists(content_instance_tablename())) {
      return;
    }
    db_query("UPDATE {" . content_instance_tablename() . "} SET widget_active=0 WHERE widget_type='%s' OR widget_type='%s' OR widget_type='%s'", 'date_select_repeat', 'date_text_repeat', 'date_popup_repeat');
    content_clear_type_cache(TRUE);
  }
}

/**
 * Implementation of hook_enable().
 */
function date_repeat_enable() {
  if (module_exists('content')) {
    drupal_load('module', 'content');
    if (!db_table_exists(content_instance_tablename())) {
      return;
    }
    db_query("UPDATE {" . content_instance_tablename() . "} SET widget_active=1 WHERE widget_type='%s' OR widget_type='%s' OR widget_type='%s'", 'date_select_repeat', 'date_text_repeat', 'date_popup_repeat');
    content_clear_type_cache(TRUE);
  }
}

/**
 * Implementation of hook_disable().
 */
function date_repeat_disable() {
  if (module_exists('content')) {
    drupal_load('module', 'content');
    if (!db_table_exists(content_instance_tablename())) {
      return;
    }
    db_query("UPDATE {" . content_instance_tablename() . "} SET widget_active=0 WHERE widget_type='%s' OR widget_type='%s' OR widget_type='%s'", 'date_select_repeat', 'date_text_repeat', 'date_popup_repeat');
    content_clear_type_cache(TRUE);
  }
}

Functions

Namesort descending Description
date_repeat_disable Implementation of hook_disable().
date_repeat_enable Implementation of hook_enable().
date_repeat_install Implementation of hook_install().
date_repeat_uninstall Implementation of hook_uninstall().