function styled_google_map_requirements in Styled Google Map 8
Same name and namespace in other branches
- 8.2 styled_google_map.install \styled_google_map_requirements()
- 7.2 styled_google_map.install \styled_google_map_requirements()
Implementation of hook_requirements().
File
- ./
styled_google_map.install, line 6
Code
function styled_google_map_requirements($phase) {
$requirements = array();
// Whether or not an API key or client id is provided.
$key_provided = FALSE;
$config = \Drupal::config('styled_google_map.settings');
switch ($config
->get('styled_google_map_google_auth_method')) {
case STYLED_GOOGLE_MAP_GOOGLE_AUTH_KEY:
$key = $config
->get('styled_google_map_google_apikey', FALSE);
if ($key) {
$key_provided = TRUE;
}
break;
case STYLED_GOOGLE_MAP_GOOGLE_AUTH_WORK:
$client_id = $config
->get('styled_google_map_google_client_id', FALSE);
if ($client_id) {
$key_provided = TRUE;
}
break;
}
if (!$key_provided) {
$requirements['styled_google_map'] = array(
'title' => t('Styled Google Map'),
'severity' => REQUIREMENT_WARNING,
'value' => t('Google Maps API key or Client ID was not found. As of 2016/06/22, keyless access is no longer supported and it may impact rendering of maps. For more information visit: <a href="@link">@link</a>', array(
'@link' => 'http://googlegeodevelopers.blogspot.ca/2016/06/building-for-scale-updates-to-google.html',
)),
);
}
return $requirements;
}