You are here

notifications_content.install in Notifications 6

File

notifications_content/notifications_content.install
View source
<?php

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

  // Module weight. It must run after most modules, to make sure they've done
  // their work before we add the notifications queries.
  db_query("UPDATE {system} SET weight = 100 WHERE name = 'notifications_content' AND type = 'module'");
}

/**
 * Implementation of hook_uninstall().
 */
function notifications_content_uninstall() {

  // Delete variables
  variable_del('notifications_content_types');
  variable_del('notifications_content_per_type');
  foreach (array_keys(node_get_types()) as $type) {
    variable_del('notifications_content_type_' . $type);
  }
  drupal_set_message(t('Content notifications uninstallation script complete.'));
}

/**
 * Update module weight
 */
function notifications_content_update_6000() {
  notifications_content_install();
  return array();
}

/**
 * Update enabled options
 */
function notifications_content_update_6001() {

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

Functions

Namesort descending Description
notifications_content_install Implementation of hook_install().
notifications_content_uninstall Implementation of hook_uninstall().
notifications_content_update_6000 Update module weight
notifications_content_update_6001 Update enabled options