You are here

masonry.install in Masonry API 7

Same filename and directory in other branches
  1. 8 masonry.install
  2. 7.3 masonry.install
  3. 7.2 masonry.install

Install, update and uninstall functions for the Masonry module.

File

masonry.install
View source
<?php

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

/**
 * Implements hook_requirements().
 */
function masonry_requirements($phase) {
  $requirements = array();
  $t = get_t();
  if ($phase == 'runtime') {
    $library = libraries_detect('masonry');
    $requirements['masonry'] = array(
      'title' => $t('jQuery Masonry'),
    );
    if ($library['installed']) {
      $requirements['masonry']['value'] = $library['version'];
      $requirements['masonry']['severity'] = REQUIREMENT_OK;
    }
    else {
      $requirements['masonry']['value'] = $library['error'];
      $requirements['masonry']['description'] = $library['error message'];
      $requirements['masonry']['severity'] = REQUIREMENT_ERROR;
    }
  }
  return $requirements;
}

Functions

Namesort descending Description
masonry_requirements Implements hook_requirements().