function analytics_get_service_info in Analytics 7
4 calls to analytics_get_service_info()
File
- ./
analytics.module, line 109
Code
function analytics_get_service_info($service = NULL, $reset = FALSE) {
$info =& drupal_static(__FUNCTION__, array());
if ($reset) {
$info = NULL;
cache_clear_all('analytics-info:', 'cache', TRUE);
}
$cid = 'analytics-info:' . $GLOBALS['language']->language;
if (!isset($info[$cid])) {
$info[$cid] = array();
if ($cache = cache_get($cid)) {
$info[$cid] = $cache->data;
}
else {
foreach (module_implements('analytics_service_info') as $module) {
if ($module_info = module_invoke($module, 'analytics_service_info')) {
foreach ($module_info as $key => $value) {
$module_info[$key]['module'] = $module;
}
$info[$cid] = array_merge_recursive($info[$cid], $module_info);
}
}
drupal_alter('analytics_service_info', $info[$cid]);
cache_set($cid, $info[$cid]);
}
}
if (isset($service)) {
return !empty($info[$cid][$service]) ? $info[$cid][$service] : FALSE;
}
else {
return $info[$cid];
}
}