You are here

function jplayer_requirements in jPlayer 7.2

Same name and namespace in other branches
  1. 8.2 jplayer.install \jplayer_requirements()
  2. 6 jplayer.install \jplayer_requirements()

Implements hook_requirements().

File

./jplayer.install, line 16
Installation file for jPlayer module.

Code

function jplayer_requirements($phase) {
  $requirements = array();
  if ($phase == 'runtime') {
    $requirements['jplayer']['title'] = t('jPlayer');
    if ($jplayer_version = jplayer_get_version()) {
      $requirements['jplayer']['value'] = $jplayer_version;
      $requirements['jplayer']['severity'] = REQUIREMENT_OK;
    }
    else {
      $requirements['jplayer']['value'] = t('Not found');
      $requirements['jplayer']['description'] = t('Missing the jPlayer library. Please !download and extract it into the %directory directory.', array(
        '!download' => l('download jPlayer library', 'http://www.jplayer.org/download/'),
        '%directory' => variable_get('jplayer_directory', '/sites/all/libraries/jplayer'),
      ));
      $requirements['jplayer']['severity'] = REQUIREMENT_ERROR;
    }
  }
  return $requirements;
}