You are here

itoggle.install in iToggle 7

Same filename and directory in other branches
  1. 7.2 itoggle.install

iToggle installation hooks.

File

itoggle.install
View source
<?php

/**
 * @file
 * iToggle installation hooks.
 */

/**
 * Implements hook_requirements().
 * This was borrowed from the Colorbox module
 * 
 * @link http://drupal.org/project/colorbox
 */
function itoggle_requirements($phase) {
  $requirements = array();
  if ($phase == 'runtime') {
    $t = get_t();
    $library_path = itoggle_get_path();
    $itoggle_version = itoggle_get_version();
    if (version_compare($itoggle_version, ITOGGLE_MIN_PLUGIN_VERSION, '>=')) {
      $requirements['itoggle_plugin'] = array(
        'title' => $t('iToggle plugin'),
        'severity' => REQUIREMENT_OK,
        'value' => $itoggle_version,
      );
    }
    else {
      $requirements['itoggle_plugin'] = array(
        'title' => $t('iToggle plugin'),
        'value' => $t('At least @a', array(
          '@a' => ITOGGLE_MIN_PLUGIN_VERSION,
        )),
        'severity' => REQUIREMENT_ERROR,
        'description' => $t('You need to download the !itoggle and extract the entire contents of the archive into the %path folder of your server.', array(
          '!itoggle' => l(t('iToggle plugin'), 'http://colorpowered.com/itoggle/'),
          '%path' => $library_path,
        )),
      );
    }
  }
  return $requirements;
}

/**
 * Implements hook_uninstall().
 */
function itoggle_uninstall() {
  variable_del('itoggle_compression_type');
  variable_del('itoggle_path');
  variable_del('itoggle_css');
  variable_del('itoggle_easing');
  variable_del('itoggle_speed');
  variable_del('itoggle_onclick');
  variable_del('itoggle_onclickon');
  variable_del('itoggle_onclickoff');
  variable_del('itoggle_onslide');
  variable_del('itoggle_onslideon');
  variable_del('itoggle_onslideoff');
}

Functions

Namesort descending Description
itoggle_requirements Implements hook_requirements(). This was borrowed from the Colorbox module
itoggle_uninstall Implements hook_uninstall().