function googleanalytics_requirements in Google Analytics 6.4
Same name and namespace in other branches
- 5 googleanalytics.module \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.install, line 55 - 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'),
);
}
// Raise warning if debugging is enabled.
if (variable_get('googleanalytics_debug', 0)) {
$requirements['google_analytics_debugging'] = array(
'title' => t('Google Analytics module'),
'description' => t('Google Analytics module has debugging enabled. Please disable debugging setting in production sites from the <a href="@url">Google Analytics settings page</a>.', array(
'@url' => url('admin/settings/googleanalytics'),
)),
'severity' => REQUIREMENT_WARNING,
'value' => t('Debugging enabled'),
);
}
}
return $requirements;
}