You are here

function _jquery_calendar_requirements_check in jQuery World Calendars API 7

Helper function that checks module requirements.

Return value

An array as per required by hook_requirements().

2 calls to _jquery_calendar_requirements_check()
jquery_calendar_requirements in ./jquery_calendar.install
Implements hook_requirements().
_jquery_calendar_form_requirements in ./jquery_calendar.admin.inc
Internal helper: Adds an warning form element of requirements check fails.

File

./jquery_calendar.module, line 397
Implements necessary hooks, API and helpers for jQuery World Calendars.

Code

function _jquery_calendar_requirements_check() {
  if (!defined('REQUIREMENT_OK')) {
    define('REQUIREMENT_OK', 0);
  }
  if (!defined('REQUIREMENT_ERROR')) {
    define('REQUIREMENT_ERROR', 2);
  }
  $t = get_t();
  $requirements = array(
    'jquery_calendar' => array(
      'title' => $t('jQuery Calendar API'),
      'value' => $t('Not installed correctly.'),
    ),
  );

  // Check jQuery Calendars.
  if (!_jquery_calendar_path('jquery.calendars')) {
    $requirements['jquery_calendar']['severity'] = REQUIREMENT_ERROR;
    $requirements['jquery_calendar']['description'] = $t('The <a href="!library">jQuery World Calendars</a> plugin is missing. <a href="!download">Download</a> the library and extract it to <code>sites/all/libraries/</code> directory. Also you need to rename the extracted directory to <strong>jquery.calendars</strong>.', array(
      '!library' => 'http://keith-wood.name/calendars.html',
      '!download' => 'http://keith-wood.name/zip/jquery.calendars.package-1.1.2.zip',
    ));
  }
  else {
    $requirements['jquery_calendar']['severity'] = REQUIREMENT_OK;
    $requirements['jquery_calendar']['value'] = $t('Installed correctly.');
  }
  return $requirements;
}