You are here

function simpleads_requirements in SimpleAds 7.2

Implements hook_requirements().

File

./simpleads.module, line 130

Code

function simpleads_requirements($phase) {

  // Create an array to hold jQuery Cycle plugin requirements
  $requirements = array();

  // Check requirements during the runtime phase
  if ($phase == 'runtime') {

    // Check if the jQuery Cycle plugin library is installed
    if (($library = libraries_detect('jquery.cycle')) && !empty($library['installed'])) {
      $requirements['jquery.cycle'] = array(
        'title' => t('jQuery Cycle plugin'),
        'value' => t('Installed'),
        'severity' => REQUIREMENT_OK,
      );
    }
    else {
      $requirements['jquery.cycle'] = array(
        'title' => t('jQuery Cycle plugin'),
        'value' => t('Not installed'),
        'description' => $library['error message'],
        'severity' => REQUIREMENT_ERROR,
      );
    }
  }
  return $requirements;
}