You are here

notifications_ui.install in Notifications 6.4

File

notifications_ui/notifications_ui.install
View source
<?php

/**
 * Implementation of hook_uninstall()
 */
function notifications_ui_uninstall() {

  // Some global variables
  variable_del('notifications_ui_per_type');
  variable_del('notifications_ui_user_options');
  variable_del('notifications_ui_node_options');
  variable_del('notifications_ui_account_options');

  // Just delete variables for subscription types and node types
  variable_del('notifications_ui_types');
  foreach (array_keys(node_get_types()) as $type) {
    variable_del('notifications_node_ui_' . $type);
  }
}

/**
 * Update UI variables
 */
function notifications_ui_update_6000() {

  // All options will be messed up so we better do manual review
  variable_del('notifications_link_teaser');
  drupal_set_message(t('Please, check all your Notifications UI settings and note the new options.'));
  return array();
}

/**
 * Disable cache in subscription block
 */
function notifications_ui_update_6001() {
  $ret = array();
  $ret[] = update_sql("UPDATE {blocks} SET cache = " . BLOCK_NO_CACHE . " WHERE module = 'notifications_ui'");
  $ret[] = update_sql("DELETE FROM {cache_block} WHERE cid LIKE 'notifications_ui:%'");
  return $ret;
}

/**
 * Change some variables for uniform notifications_ui_[object]_options
 */
function notifications_ui_update_6002() {
  if ($value = variable_get('notifications_ui_user', 0)) {
    variable_set('notifications_ui_user_options', $value);
  }
  if ($value = variable_get('notifications_ui_node', 0)) {
    variable_set('notifications_ui_node_options', $value);
  }
  variable_del('notifications_ui_user');
  variable_del('notifications_ui_node');
  return array();
}

Functions

Namesort descending Description
notifications_ui_uninstall Implementation of hook_uninstall()
notifications_ui_update_6000 Update UI variables
notifications_ui_update_6001 Disable cache in subscription block
notifications_ui_update_6002 Change some variables for uniform notifications_ui_[object]_options