webform_addressfield_extra.install in Webform Addressfield Extra 7
Requirements function for the webform addressfield extra module.
File
webform_addressfield_extra.installView source
<?php
/**
* @file
* Requirements function for the webform addressfield extra module.
*/
/**
* Implements hook_requirements().
*/
function webform_addressfield_extra_requirements($phase) {
$requirements = array();
$t = get_t();
// Check on the installation status of the geocomplete library. Note that
// we do not do this check during the 'install' phase as the libraries API
// functions will not always be available then (if installing Drupal via an
// install profile, etc.).
if ($phase == 'runtime') {
$library = libraries_detect('geocomplete');
$requirements['geocomplete'] = array(
'title' => $t('Geocomplete Library'),
);
if ($library['installed']) {
$requirements['geocomplete']['value'] = $library['version'];
$requirements['geocomplete']['severity'] = REQUIREMENT_OK;
}
else {
$requirements['geocomplete']['value'] = $library['error'];
$requirements['geocomplete']['description'] = $t('Geocomplete Library is required by Webform Addressfield Extra. <a href="@geocomplete">Download the geocomplete library</a>', array(
'@geocomplete' => url($library['download url']),
));
$requirements['geocomplete']['severity'] = REQUIREMENT_ERROR;
}
}
return $requirements;
}Functions
|
Name |
Description |
|---|---|
| webform_addressfield_extra_requirements | Implements hook_requirements(). |