You are here

juicebox.install in Juicebox HTML5 Responsive Image Galleries 7

Same filename and directory in other branches
  1. 8.3 juicebox.install
  2. 8.2 juicebox.install
  3. 7.2 juicebox.install

Install, update and uninstall functions for the Juicebox module.

File

juicebox.install
View source
<?php

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

/**
 * Implements hook_requirements().
 */
function juicebox_requirements($phase) {
  $requirements = array();
  $t = get_t();

  // Check on the installation status of the Juicebox library. Note that
  // we do not do this check during the 'install' phase as the libraries API
  // functions will not always be available then (if installing Drupal via an
  // install profile, etc.).
  if ($phase == 'runtime') {
    $library = _juicebox_library_detect();
    $requirements['juicebox'] = array(
      'title' => $t('Juicebox Javascript Library'),
    );
    if ($library['installed']) {
      $requirements['juicebox']['value'] = $library['version'];
      $requirements['juicebox']['severity'] = REQUIREMENT_OK;
    }
    else {
      $requirements['juicebox']['value'] = $library['error'];
      $requirements['juicebox']['description'] = $library['error message'];
      $requirements['juicebox']['severity'] = REQUIREMENT_ERROR;
    }
    if (module_exists('devel_themer')) {
      $requirements['juicebox_devel_themer'] = array(
        'title' => 'Juicebox Compatibility',
        'value' => 'Theme Developer module is enabled',
        'description' => t('The Juicebox module is not compatible with the Theme Developer module. Your Juicebox galleries may not display correctly until the Theme Developer module has been disabled.'),
        'severity' => REQUIREMENT_ERROR,
      );
    }
  }
  return $requirements;
}

/**
 * Update registry and cache details to ensure that Juicebox galleries made with
 * beta versions of the module are compatible with post-beta versions.
 */
function juicebox_update_7100() {

  // Empty update to force a rebuild of the cache/registry. We have added a new
  // theme variable for 'juicebox_embed_markup' ('gallery_id') and have
  // re-structured the "schema" for configuration variables. For the schema
  // change, clearing the cache will enforce correct default values but we also
  // have added some "real-time" handling for manually configured values in
  // _juicebox_init_display_settings().
}

/**
 * Update registry and cache details to accomodate new theme variables.
 */
function juicebox_update_7101() {

  // Empty update to force a rebuild of the cache/registry. We have changed
  // some theme variable names ("jlib_options" and "settings").
}

Functions

Namesort descending Description
juicebox_requirements Implements hook_requirements().
juicebox_update_7100 Update registry and cache details to ensure that Juicebox galleries made with beta versions of the module are compatible with post-beta versions.
juicebox_update_7101 Update registry and cache details to accomodate new theme variables.