add('Upgraded Google Analytics to version 2.0.0', 'success'); } else { $messageStack->add('Easy Google Analytics upgrade failed! Please make sure you have uploaded all the files in the package.'); } } else { if (file_exists(DIR_WS_INCLUDES . 'installers/google_analytics/new_install.php')) { include_once(DIR_WS_INCLUDES . 'installers/google_analytics/new_install.php'); $messageStack->add('Added Easy Google Analytics', 'success'); } else { $messageStack->add('An Easy Google Analytics installation file is missing, please make sure you have uploaded all files in the package.'); } } } else { $current_version = '2.1.2'; while ($ga_version != $current_version) { switch ($ga_version) { case 'new': case '2.0.0': case '2.0.1': case '2.0.2': // perform upgrade if (file_exists(DIR_WS_INCLUDES . 'installers/google_analytics/2_1_0.php')) { include_once(DIR_WS_INCLUDES . 'installers/google_analytics/2_1_0.php'); $ga_version = '2.1.0'; break; } else { break 2; } case '2.1.0': // perform upgrade if (file_exists(DIR_WS_INCLUDES . 'installers/google_analytics/2_1_1.php')) { include_once(DIR_WS_INCLUDES . 'installers/google_analytics/2_1_1.php'); $ga_version = '2.1.1'; break; } else { break 2; } case '2.1.1': // perform upgrade if (file_exists(DIR_WS_INCLUDES . 'installers/google_analytics/2_1_2.php')) { include_once(DIR_WS_INCLUDES . 'installers/google_analytics/2_1_2.php'); $ga_version = '2.1.2'; break; } else { break 2; } case '2.1.2': // perform upgrade if (file_exists(DIR_WS_INCLUDES . 'installers/google_analytics/2_1_3.php')) { include_once(DIR_WS_INCLUDES . 'installers/google_analytics/2_1_3.php'); $ga_version = '2.1.3'; break; } else { break 2; } default: $ga_version = $current_version; // break all the loops break 2; } } } $zc150 = (PROJECT_VERSION_MAJOR > 1 || (PROJECT_VERSION_MAJOR == 1 && substr(PROJECT_VERSION_MINOR, 0, 3) >= 5)); if ($zc150 && function_exists('zen_page_key_exists')) { if (!zen_page_key_exists('configGoogleAnalytics')) { $configuration = $db->Execute("SELECT configuration_group_id FROM " . TABLE_CONFIGURATION . " WHERE configuration_key = 'GOOGLE_ANALYTICS_VERSION' LIMIT 1;"); $configuration_group_id = $configuration->fields['configuration_group_id']; if ((int) $configuration_group_id > 0) { zen_register_admin_page('configGoogleAnalytics', 'BOX_CONFIGURATION_GOOGLE_ANALYTICS', 'FILENAME_CONFIGURATION', 'gID=' . $configuration_group_id, 'configuration', 'Y', $configuration_group_id); $messageStack->add('Easy Google Analytics added to Configuration menu.', 'success'); } } }