You are here

function piwik_update_6000 in Piwik Web Analytics 7

Same name and namespace in other branches
  1. 5 piwik.install \piwik_update_6000()
  2. 6.2 piwik.install \piwik_update_6000()
  3. 6 piwik.install \piwik_update_6000()
  4. 7.2 piwik.install \piwik_update_6000()

Change visibility setting for paths.

File

./piwik.install, line 84
Installation file for Piwik - Web analytics module.

Code

function piwik_update_6000() {

  // 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));
    return t('Path visibility filter setting changed from "admin*" to "admin, admin/*" and "user*" changed to "user/*/*".');
  }
  else {
    return t('Custom path visibility filter setting found. Update skipped!');
  }
}