You are here

function jqmulti_requirements in jQuery Multi 7

Same name and namespace in other branches
  1. 6 jqmulti.install \jqmulti_requirements()

Implements hook_requirements().

File

./jqmulti.install, line 29
Install file for the jQuery Multi module.

Code

function jqmulti_requirements($phase) {
  require_once dirname(__FILE__) . '/jqmulti.module';
  $requirements = array();
  $requirements['jqmulti_jquery'] = array(
    'title' => 'jQuery Multi jQuery library',
  );
  switch ($phase) {
    case 'install':
    case 'runtime':
      if (function_exists('libraries_get_path')) {
        $version = jqmulti_get_version(TRUE);
        if (!$version) {
          $requirements['jqmulti_jquery']['description'] = 'jQuery Multi: Could not locate a jQuery library. Please look at the README for instructions and ensure you have placed the library correctly.';
          $requirements['jqmulti_jquery']['severity'] = REQUIREMENT_ERROR;
        }
        else {
          $requirements['jqmulti_jquery']['value'] = $version;
          $requirements['jqmulti_jquery']['severity'] = REQUIREMENT_OK;
        }
      }
  }
  return $requirements;
}