You are here

function googleanalytics_update_6004 in Google Analytics 7

Same name and namespace in other branches
  1. 5 googleanalytics.install \googleanalytics_update_6004()
  2. 6.4 googleanalytics.install \googleanalytics_update_6004()
  3. 6 googleanalytics.install \googleanalytics_update_6004()
  4. 6.2 googleanalytics.install \googleanalytics_update_6004()
  5. 6.3 googleanalytics.install \googleanalytics_update_6004()
  6. 7.2 googleanalytics.install \googleanalytics_update_6004()

Change visibility setting for path "user/*".

File

./googleanalytics.install, line 165
Installation file for Google Analytics module.

Code

function googleanalytics_update_6004() {

  // Original 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*',
      'user/*/*',
      'node/add*',
      'node/*/*',
    );
    variable_set('googleanalytics_pages', implode("\n", $pages));
    return t('Path visibility filter setting changed from "user*" to "user/*/*".');
  }
  else {
    return t('Custom path visibility filter setting found. Update skipped!');
  }
}