function googleanalytics_requirements in Google Analytics 5
Same name and namespace in other branches
- 6.4 googleanalytics.install \googleanalytics_requirements()
- 6 googleanalytics.module \googleanalytics_requirements()
- 6.2 googleanalytics.install \googleanalytics_requirements()
- 6.3 googleanalytics.install \googleanalytics_requirements()
- 7.2 googleanalytics.install \googleanalytics_requirements()
- 7 googleanalytics.install \googleanalytics_requirements()
Implementation of hook_requirements().
File
- ./
googleanalytics.module, line 528
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_ERROR,
'value' => t('Not configured'),
);
}
}
return $requirements;
}