You are here

function views_quicksand_requirements in Views Quicksand 7

Implements hook_requirements().

File

./views_quicksand.install, line 13

Code

function views_quicksand_requirements($phase) {
  $requirements = array();
  $t = get_t();
  $library_path = views_quicksand_get_path();

  // make sure that libraries is enabled
  if (!module_exists('libraries')) {
    module_enable(array(
      'libraries',
    ));
  }
  $libraries = libraries_get_libraries();
  if ($phase == 'runtime') {
    if (isset($libraries['jquery.quicksand'])) {
      $requirements['jquery.quicksand'] = array(
        'title' => $t('Quicksand plugin'),
        'value' => $t('Installed'),
        'severity' => REQUIREMENT_OK,
      );
    }
    else {
      $requirements['jquery.quicksand'] = array(
        'title' => $t('Quicksand plugin'),
        'value' => $t('Not Installed'),
        'severity' => REQUIREMENT_ERROR,
        'description' => $t('You need to download the !quicksand and extract the entire contents of the archive into the %path folder of your server.', array(
          '!quicksand' => l(t('Quicksand plugin'), 'http://razorjack.net/quicksand/'),
          '%path' => $library_path,
        )),
      );
    }
  }
  return $requirements;
}