function piwik_update_6000 in Piwik Web Analytics 5
Same name and namespace in other branches
- 6.2 piwik.install \piwik_update_6000()
- 6 piwik.install \piwik_update_6000()
- 7.2 piwik.install \piwik_update_6000()
- 7 piwik.install \piwik_update_6000()
Change visibility setting for paths.
File
- ./
piwik.install, line 74 - Installation file for Piwik - Web analytics module.
Code
function piwik_update_6000() {
$ret = array();
// Orginal pages setting.
$pages = array(
'admin*',
'user*',
'node/add*',
'node/*/*',
);
$diff = array_diff($pages, preg_split('/(\\r\\n?|\\n)/', variable_get('piwik_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('piwik_pages', implode("\n", $pages));
$ret[] = array(
'success' => TRUE,
'query' => 'Path visibility filter setting changed from "admin*" to "admin, admin/*" and "user*" changed to "user/*/*".',
);
}
else {
$ret[] = array(
'success' => TRUE,
'query' => 'Custom path visibility filter setting found. Update skipped!',
);
}
return $ret;
}