function googleanalytics_update_6005 in Google Analytics 5
Same name and namespace in other branches
- 6.4 googleanalytics.install \googleanalytics_update_6005()
- 6 googleanalytics.install \googleanalytics_update_6005()
- 6.2 googleanalytics.install \googleanalytics_update_6005()
- 6.3 googleanalytics.install \googleanalytics_update_6005()
- 7.2 googleanalytics.install \googleanalytics_update_6005()
- 7 googleanalytics.install \googleanalytics_update_6005()
Change visibility setting for path "admin*".
File
- ./
googleanalytics.install, line 185 - Installation file for Google Analytics module.
Code
function googleanalytics_update_6005() {
$ret = array();
// Orginal pages setting.
$pages = array(
'admin*',
'user/*/*',
'node/add*',
'node/*/*',
);
$diff = array_diff($pages, preg_split('/(\\r\\n?|\\n)/', variable_get('googleanalytics_pages', implode("\n", $pages))));
if (empty($diff)) {
// No diff to original settings found. Update with new settings.
$pages = array(
'admin',
'admin/*',
'user/*/*',
'node/add*',
'node/*/*',
);
variable_set('googleanalytics_pages', implode("\n", $pages));
$ret[] = array(
'success' => TRUE,
'query' => 'Path visibility filter setting changed from "admin*" to "admin" and "admin/*".',
);
}
else {
$ret[] = array(
'success' => TRUE,
'query' => 'Custom path visibility filter setting found. Update skipped!',
);
}
return $ret;
}