fullcalendar.install 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. /**
  3. * @file
  4. * Install, update and uninstall functions for the FullCalendar module.
  5. */
  6. /**
  7. * Implements hook_requirements().
  8. */
  9. function fullcalendar_requirements($phase) {
  10. $requirements = array();
  11. if ($phase == 'runtime') {
  12. $t = get_t();
  13. $status = _fullcalendar_status();
  14. if (!$status['fullcalendar_plugin']) {
  15. $requirements['fullcalendar_plugin'] = array(
  16. 'title' => $t('FullCalendar plugin'),
  17. 'value' => $t('At least @a', array('@a' => FULLCALENDAR_MIN_PLUGIN_VERSION)),
  18. 'severity' => REQUIREMENT_ERROR,
  19. 'description' => $t('You need to download the !fullcalendar and extract the entire contents of the archive into the %path folder of your server.', array('!fullcalendar' => l(t('FullCalendar plugin'), 'http://arshaw.com/fullcalendar/download'), '%path' => 'sites/all/libraries')),
  20. );
  21. }
  22. else {
  23. $plugin_version = fullcalendar_get_version();
  24. if (version_compare(FULLCALENDAR_RECOMMENDED_PLUGIN_VERSION, $plugin_version) > 0) {
  25. $plugin_version .= ' (Recommended version: ' . FULLCALENDAR_RECOMMENDED_PLUGIN_VERSION . ')';
  26. }
  27. $requirements['fullcalendar_plugin'] = array(
  28. 'title' => $t('FullCalendar plugin'),
  29. 'severity' => REQUIREMENT_OK,
  30. 'value' => $plugin_version,
  31. );
  32. }
  33. }
  34. return $requirements;
  35. }
  36. /**
  37. * Implements hook_uninstall().
  38. */
  39. function fullcalendar_uninstall() {
  40. variable_del('fullcalendar_path');
  41. variable_del('fullcalendar_compression_type');
  42. }
  43. /**
  44. * Force full cache clear to forget about old handlers and plugins.
  45. */
  46. function fullcalendar_update_7200(&$sandbox) {
  47. drupal_flush_all_caches();
  48. }