You are here

function mp3player_requirements in MP3 Player 6.2

Same name and namespace in other branches
  1. 6 mp3player.install \mp3player_requirements()

Implementation of hook_requirements().

File

./mp3player.install, line 12
The install file for MP3 Player.

Code

function mp3player_requirements($phase) {
  $t = get_t();
  $path = libraries_get_path('audio-player') . '/mp3player';
  $has_mp3player = file_exists($path . '/audio-player.js') && file_exists($path . '/player.swf');
  $requirements['mp3player'] = array(
    'title' => $t('MP3 Player'),
    'value' => $has_mp3player ? $t('Installed') : $t('Not found'),
  );
  if (!$has_mp3player) {
    $requirements['mp3player']['severity'] = REQUIREMENT_ERROR;
    $requirements['mp3player']['description'] = $t("MP3 Player requires the <a href='!mp3_url'>standalone WordPress Audio Player</a>.", array(
      '!mp3_url' => 'http://wpaudioplayer.com/download',
    ));
  }
  return $requirements;
}