function googleanalytics_requirements in Google Analytics 6.3
Same name and namespace in other branches
- 5 googleanalytics.module \googleanalytics_requirements()
- 6.4 googleanalytics.install \googleanalytics_requirements()
- 6 googleanalytics.module \googleanalytics_requirements()
- 6.2 googleanalytics.install \googleanalytics_requirements()
- 7.2 googleanalytics.install \googleanalytics_requirements()
- 7 googleanalytics.install \googleanalytics_requirements()
Implementation of hook_requirements().
File
- ./
googleanalytics.install, line 50 - Installation file for Google Analytics module.
Code
function googleanalytics_requirements($phase) {
$requirements = array();
if ($phase == 'runtime') {
// Raise warning if Google user account has not been set yet.
if (!preg_match('/^UA-\\d{4,}-\\d+$/', variable_get('googleanalytics_account', 'UA-'))) {
$requirements['googleanalytics'] = array(
'title' => t('Google Analytics module'),
'description' => t('Google Analytics module has not been configured yet. Please configure its settings from the <a href="@url">Google Analytics settings page</a>.', array(
'@url' => url('admin/settings/googleanalytics'),
)),
'severity' => REQUIREMENT_WARNING,
'value' => t('Not configured'),
);
}
}
return $requirements;
}