You are here

function isotope_requirements in Isotope (with Masonry and Packery) 7

Same name and namespace in other branches
  1. 7.2 isotope.install \isotope_requirements()

Implements hook_requirements().

File

./isotope.install, line 11
Defines the functionality for isotope's requirements and uninstall process(es).

Code

function isotope_requirements($phase) {
  $requirements = array();
  $t = get_t();

  // If the libray folder was not found the library is not installed properly.
  module_load_include('module', 'libraries');
  $libpath = libraries_get_path('isotope');
  if (is_dir($libpath) != TRUE) {
    $readme_url = url(drupal_get_path('module', 'isotope') . '/README.txt');
    $requirements['isotope'] = array(
      'title' => $t('Isotope.js'),
      'description' => $t('The Isotope.js library folder was not found. Please see <a href="@url">README.txt</a> in the isotope module directory for proper library installation details.', array(
        '@url' => $readme_url,
      )),
      'severity' => REQUIREMENT_ERROR,
      'value' => NULL,
    );
  }
  return $requirements;
}