| 12345678910111213141516171819202122232425262728293031323334353637383940 |
- <?php
- /**
- * @file
- * Install, update, and uninstall functions for the leaflet module.
- */
- /**
- * Implements hook_requirements().
- */
- function leaflet_requirements($phase) {
- $requirements = array();
- $t = get_t();
- // Verify the Leaflet library is installed correctly.
- if (in_array($phase, array('runtime', 'update'))) {
- $library = libraries_detect('leaflet');
- $requirements['leaflet'] = array(
- 'title' => $t('Leaflet'),
- );
- if ($library['installed']) {
- $requirements['leaflet'] += array(
- 'value' => $library['version'],
- 'description' => t('The Leaflet Javascript library is installed correctly. @maps available.', array(
- '@maps' => format_plural(count(leaflet_map_get_info()),'One map', '@count maps'))),
- 'severity' => REQUIREMENT_OK,
- );
- }
- else {
- $requirements['leaflet'] += array(
- 'value' => $library['error'],
- 'description' => $library['error message'],
- 'severity' => REQUIREMENT_ERROR,
- );
- }
- }
- return $requirements;
- }
|