Same name in other branches
  1. 2.0.x fitvids.install \fitvids_requirements()
  2. 7.x-1.x fitvids.install \fitvids_requirements()
  3. 8.x-1.x fitvids.install \fitvids_requirements()

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

File

./fitvids.install, line 14

Code

function fitvids_requirements($phase) {
    $requirements = array();
    switch ($phase) {
        case 'runtime':
            $path = libraries_get_path('fitvids') . '/jquery.fitvids.js';
            $installed = file_exists($path);
            $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 !fitvids-library directory, and rename it to !fitvids-filename.', array(
                    '!fitvids-site' => l(t('here'), PLUGIN_URL),
                    '!fitvids-library' => libraries_get_path('fitvids'),
                    '!fitvids-filename' => PLUGIN_FILENAME,
                )),
                'severity' => $installed ? REQUIREMENT_OK : REQUIREMENT_ERROR,
            );
            break;
    }
    return $requirements;
}