You are here

optionwidgets.install in Content Construction Kit (CCK) 6

File

modules/optionwidgets/optionwidgets.install
View source
<?php

// Updates happen in random order, whether or not the module is enabled,
// so include critical code here just to be sure.
include_once './' . drupal_get_path('module', 'content') . '/content.module';

/**
 * Implementation of hook_install().
 */
function optionwidgets_install() {
  content_notify('install', 'optionwidgets');
}

/**
 * Implementation of hook_uninstall().
 */
function optionwidgets_uninstall() {
  content_notify('uninstall', 'optionwidgets');
}

/**
 * Implementation of hook_enable().
 *
 * Notify content module when this module is enabled.
 */
function optionwidgets_enable() {
  content_notify('enable', 'optionwidgets');
}

/**
 * Implementation of hook_disable().
 *
 * Notify content module when this module is disabled.
 */
function optionwidgets_disable() {
  content_notify('disable', 'optionwidgets');
}
function optionwidgets_update_last_removed() {
  return 1;
}

/**
 * Rename widgets from 'options_xxx' to 'optionwidgets_xxx' so hook_elements
 * and hook_themes items are prefixed with module name as they should be.
 *
 * The change in widget types will keep content_update_6000() from correctly updating
 * the module names in the field and instance tables, so do it here.
 */
function optionwidgets_update_6000() {
  $ret = array();
  $ret[] = update_sql("UPDATE {" . content_instance_tablename() . "} SET widget_type = 'optionwidgets_select' WHERE widget_type = 'options_select'");
  $ret[] = update_sql("UPDATE {" . content_instance_tablename() . "} SET widget_type = 'optionwidgets_onoff' WHERE widget_type = 'options_onoff'");
  $ret[] = update_sql("UPDATE {" . content_instance_tablename() . "} SET widget_type = 'optionwidgets_buttons' WHERE widget_type = 'options_buttons'");
  content_associate_fields('optionwidgets');
  return $ret;
}

Functions

Namesort descending Description
optionwidgets_disable Implementation of hook_disable().
optionwidgets_enable Implementation of hook_enable().
optionwidgets_install Implementation of hook_install().
optionwidgets_uninstall Implementation of hook_uninstall().
optionwidgets_update_6000 Rename widgets from 'options_xxx' to 'optionwidgets_xxx' so hook_elements and hook_themes items are prefixed with module name as they should be.
optionwidgets_update_last_removed