You are here

function modernizr_requirements in Modernizr 7

Same name and namespace in other branches
  1. 8 modernizr.install \modernizr_requirements()
  2. 6.2 modernizr.install \modernizr_requirements()
  3. 6 modernizr.install \modernizr_requirements()
  4. 7.3 modernizr.install \modernizr_requirements()
  5. 7.2 modernizr.install \modernizr_requirements()

Implements hook_requirements.

File

./modernizr.install, line 6

Code

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