You are here

function jqp_requirements in jQuery Plugin Handler (JQP) 6.2

Implementation of hook_requirements().

Checks if a js_libraries directory is present at install

File

./jqp.module, line 318
Used to register and load javascript libraries and plugins from a cetral point

Code

function jqp_requirements($phase) {

  // Ensure translations don't break at install time
  $t = get_t();

  // Report Drupal version
  if ($phase == 'runtime') {
    $library_exists = _check_js_library_directory('js_libraries');
    $requirements['jqp'] = array(
      'title' => $t('Javascript libraries directory'),
      'value' => $library_exists ? $t('Exists') : $t('Not present'),
      'severity' => $library_exists ? REQUIREMENT_OK : REQUIREMENT_WARNING,
    );
    if (!$library_exists) {
      $requirements['jqp']['description'] = $t('There\'s no javascript libraries folder present yet! Please create a directory called "js_libraries" at sites/all/js_libraries or sites/[example.com]/js_libraries or similar.');
    }
  }
  return $requirements;
}