You are here

function views_slideshow_cycle_requirements in Views Slideshow 6.3

Same name and namespace in other branches
  1. 7.3 contrib/views_slideshow_cycle/views_slideshow_cycle.install \views_slideshow_cycle_requirements()

File

contrib/views_slideshow_cycle/views_slideshow_cycle.install, line 7

Code

function views_slideshow_cycle_requirements($phase) {
  $requirements = array();
  if ($phase == 'install' || $phase == 'runtime') {
    if ($phase == 'install') {
      $views_slideshow = drupal_get_path('module', 'views_slideshow_cycle');
      require_once $views_slideshow . '/views_slideshow_cycle.module';
    }
    if (!($cycle_path = _views_slideshow_cycle_library_path())) {
      $requirements['jquery.cycle'] = array(
        'title' => t('jQuery Cycle Library'),
        'severity' => REQUIREMENT_ERROR,
        'value' => t('Library required for Views Slideshow Cycle'),
        'description' => t('You need to install the jQuery cycle plugin. Create a directory in sites/all/libraries called jquery.cycle, and then copy jquery.cycle.all.min.js or jquery.cycle.all.js into it. You can find the plugin at !url.', array(
          '!url' => l('http://malsup.com/jquery/cycle', 'http://malsup.com/jquery/cycle', array(
            'attributes' => array(
              'target' => '_blank',
            ),
          )),
        )),
      );
    }
    else {
      $requirements['jquery.cycle'] = array(
        'value' => t('Installed'),
        'severity' => REQUIREMENT_OK,
      );
    }
    $requirements['jquery.cycle']['title'] = t('jQuery Cycle Library');
  }
  return $requirements;
}