You are here

outdatedbrowser.install in Outdated Browser 7

Install, update and uninstall functions for the Outdated Browser module.

File

outdatedbrowser.install
View source
<?php

/**
 * @file
 * Install, update and uninstall functions for the Outdated Browser module.
 */

/**
 * Implements hook_requirements().
 */
function outdatedbrowser_requirements($phase) {
  $requirements = array();
  if ($phase == 'runtime') {
    $t = get_t();
    $library = libraries_detect('outdatedbrowser');
    if (empty($library['installed'])) {
      $requirements['outdatedbrowser'] = array(
        'title' => $t('Outdated Browser library'),
        'value' => isset($library['error message']) ? $library['error message'] : $t('Library not found'),
        'severity' => REQUIREMENT_ERROR,
        'description' => $t('You need to download the !outdatedbrowser, extract the archive and place the outdatedbrowser directory in the %path directory on your server. Make sure the path to the plugin file becomes: %fullpath', array(
          '!outdatedbrowser' => l($t('Outdated Browser library'), $library['download url']),
          '%path' => 'sites/all/libraries',
          '%fullpath' => 'sites/all/libraries/outdatedbrowser/outdatedbrowser/outdatedbrowser.min.js',
        )),
      );
    }
    else {
      $requirements['outdatedbrowser'] = array(
        'title' => $t('Outdated Browser library'),
        'severity' => REQUIREMENT_OK,
        'value' => $library['version'],
      );
    }
  }
  return $requirements;
}

/**
 * Delete the no longer used variable 'outdatedbrowser_page_region'.
 */
function outdatedbrowser_update_7100() {
  variable_del('outdatedbrowser_page_region');
}

Functions

Namesort descending Description
outdatedbrowser_requirements Implements hook_requirements().
outdatedbrowser_update_7100 Delete the no longer used variable 'outdatedbrowser_page_region'.