<?php

/**
 * @file
 * Installation and upgrade code for Pingdom RUM module
 */

/**
 * Hook_install implementation.
 *
 * Clear cache after installing to ensure the new JS is inlcuded.
 */
function pingdom_rum_install() {
  cache_clear_all();
  $t = get_t();
  $message = $t('The Pingdom RUM module has been installed, however it will not do anything until you enter your Pingdom project ID. You can do this on the <a href="@settings-page">settings page</a>.',
    array('@settings-page' => url('admin/config/services/pingdom')));
  drupal_set_message($message, 'warning');
}

/**
 * Hook_uninstall implementation.
 *
 * Remove any variables added by this module
 */
function pingdom_rum_uninstall() {
  variable_del('pingdom_rum_project_id');
  variable_del('pingdom_rum_visibility_pages');
  variable_del('pingdom_rum_pages');
  variable_del('pingdom_rum_roles');
  variable_del('pingdom_rum_roles_type');
}
