You are here

function leaflet_markercluster_requirements in Leaflet Markercluster 7

Same name and namespace in other branches
  1. 8 leaflet_markercluster.module \leaflet_markercluster_requirements()

Implements hook_requirements().

File

./leaflet_markercluster.module, line 80

Code

function leaflet_markercluster_requirements($phase) {
  if ($phase != 'runtime') {
    return array();
  }
  $requirements['leaflet_markercluster']['title'] = t('Leaflet MarkerCluster library');
  if ($path = leaflet_markercluster_get_library_path()) {
    $file = "{$path}/leaflet.markercluster.js";
  }
  if ($path && file_exists($file)) {
    $requirements['leaflet_markercluster']['value'] = t('Installed');
    $requirements['leaflet_markercluster']['severity'] = REQUIREMENT_OK;
  }
  else {
    $requirements['leaflet_markercluster']['value'] = $path ? t('File not found: %file', array(
      '%file' => $file,
    )) : t('/leaflet_markercluster library directory missing');
    $requirements['leaflet_markercluster']['severity'] = REQUIREMENT_ERROR;
  }
  return $requirements;
}