You are here

function proj4js_requirements in Proj4JS 7

Implements of hook_requirements().

File

./proj4js.module, line 10
Main module file for the proj4js.module.

Code

function proj4js_requirements($phase) {
  $requirements = array();
  $name = 'proj4js';
  if (($library = libraries_detect($name)) && !empty($library['installed'])) {
    $requirements['proj4js'] = array(
      'title' => 'Proj4JS Library Installed',
      'severity' => REQUIREMENT_OK,
      'value' => t('Proj4JS Library version @version installed at %path.', array(
        '@version' => $library['version'],
        '%path' => $library['library path'],
      )),
    );
  }
  else {
    $requirements['proj4js'] = array(
      'title' => t('Proj4JS'),
      'severity' => REQUIREMENT_ERROR,
      'value' => t('Proj4JS library was not found. Please <a href="@link">download a copy</a> and place in the libraries directory.', array(
        '@link' => 'http://trac.osgeo.org/proj4js/',
      )),
    );

    // Something went wrong. :(
    // This contains a short status code of what went wrong, such as 'not found'.
    // $error = $library['error'];
    // This contains a detailed (localized) error message.
    // $error_message = $library['error message'];
  }
  return $requirements;
}