You are here

function smartmenus_requirements in Smartmenus.js 7

Same name and namespace in other branches
  1. 8 smartmenus.install \smartmenus_requirements()

Implements hook_requirements().

File

./smartmenus.install, line 23
Requirements, install, uninstall, and update hooks for the Smartmenus module.

Code

function smartmenus_requirements($phase) {
  $requirements = array();
  if ($phase == 'runtime') {
    $t = get_t();
    $library = libraries_detect('smartmenus');
    if (empty($library['installed'])) {
      $requirements['smartmenus_plugin'] = array(
        'title' => $t('Smartmenus plugin'),
        'severity' => REQUIREMENT_ERROR,
        'value' => t('Missing library'),
        'description' => $t('You need to download the !plugin, extract the archive, place the decompressed files in the %path directory on your server, and rename the directory to simply smartmenus.', array(
          '!plugin' => l($t('Smartmenus jQuery plugin'), $library['download url']),
          '%path' => 'sites/all/libraries',
        )),
      );
    }
    else {
      $requirements['smartmenus_plugin'] = array(
        'title' => $t('Smartmenus plugin'),
        'severity' => REQUIREMENT_OK,
        'value' => $library['version'],
      );
    }
  }
  return $requirements;
}