You are here

fullcalendar.install in FullCalendar 8.2

Install, update and uninstall functions for the FullCalendar module.

File

fullcalendar.install
View source
<?php

/**
 * @file
 * Install, update and uninstall functions for the FullCalendar module.
 */

/**
 * Implements hook_requirements().
 */
function fullcalendar_requirements($phase) {
  $requirements = [];
  if ($phase == 'runtime') {
    $path = fullcalendar_get_js_path();
    if (!file_exists($path) || version_compare(fullcalendar_get_version($path), FULLCALENDAR_MIN_PLUGIN_VERSION, '<')) {
      $requirements['fullcalendar_plugin'] = [
        'title' => t('FullCalendar plugin'),
        'value' => t('At least @a', [
          '@a' => FULLCALENDAR_MIN_PLUGIN_VERSION,
        ]),
        'severity' => REQUIREMENT_ERROR,
        'description' => t('You need to download the <a href=":fullcalendar" target="_blank">FullCalendar plugin</a> and extract the entire contents of the archive into the %path folder of your server.', [
          ':fullcalendar' => 'http://arshaw.com/fullcalendar/download',
          '%path' => '/libraries',
        ]),
      ];
    }
    else {
      $requirements['fullcalendar_plugin'] = [
        'title' => t('FullCalendar plugin'),
        'severity' => REQUIREMENT_OK,
        'value' => fullcalendar_get_version(),
      ];
    }
  }
  return $requirements;
}

Functions