You are here

function fitvids_requirements in FitVids 6

Same name and namespace in other branches
  1. 8 fitvids.install \fitvids_requirements()
  2. 7 fitvids.install \fitvids_requirements()

If the plugin doesn't exist, show a warning on the status page

File

./fitvids.install, line 14
Install, update and uninstall functions for the Fitvids module.

Code

function fitvids_requirements($phase) {
  $requirements = array();
  switch ($phase) {
    case 'runtime':
      $installed = file_exists(drupal_get_path('module', 'fitvids') . '/' . PLUGIN_FILENAME);
      $requirements[] = array(
        'title' => t('Fitvids library'),
        'value' => $installed ? t('Installed') : t('Missing'),
        'description' => t('Fitvids Javascript Library. Download it from !fitvids-site, copy it to the module directory, and rename it to !fitvids-filename.', array(
          '!fitvids-site' => l(t('here'), PLUGIN_URL),
          '!fitvids-filename' => PLUGIN_FILENAME,
        )),
        'severity' => $installed ? REQUIREMENT_OK : REQUIREMENT_ERROR,
      );
      break;
  }
  return $requirements;
}