summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhass2009-08-22 10:51:25 (GMT)
committer hass2009-08-22 10:51:25 (GMT)
commit71c0250084ca919bba67c08b211a211adfd4f333 (patch)
treeddf2446b432489540541434a4eef4ccdcabcba08
parentff5362c41f5f3c21edb27b2ce8f914a49753a860 (diff)
#545886 by hass: update extension list to piwik defaults
-rw-r--r--googleanalytics.admin.inc2
-rw-r--r--googleanalytics.install21
-rw-r--r--googleanalytics.module2
3 files changed, 21 insertions, 4 deletions
diff --git a/googleanalytics.admin.inc b/googleanalytics.admin.inc
index ae27cb8..518cef8 100644
--- a/googleanalytics.admin.inc
+++ b/googleanalytics.admin.inc
@@ -160,7 +160,7 @@ function googleanalytics_admin_settings_form(&$form_state) {
'#title' => t('File extensions to track'),
'#default_value' => variable_get('googleanalytics_trackfiles_extensions', GA_TRACKFILES_EXTENSIONS),
'#description' => t('A pipe separated list of file extensions that should be tracked when clicked with regular expression support. Example: !extensions', array('!extensions' => GA_TRACKFILES_EXTENSIONS)),
- '#maxlength' => 256,
+ '#maxlength' => 255,
);
// Advanced feature configurations.
diff --git a/googleanalytics.install b/googleanalytics.install
index 58a14d8..1a6bc26 100644
--- a/googleanalytics.install
+++ b/googleanalytics.install
@@ -68,11 +68,14 @@ function googleanalytics_update_1() {
return $ret;
}
+/**
+ * Upgrade old extension variable to new and use old name as enabled/disabled flag.
+ */
function googleanalytics_update_6000() {
$ret = array();
- variable_set('googleanalytics_trackfiles_extensions', variable_get('googleanalytics_trackfiles', GA_TRACKFILES_EXTENSIONS));
- $trackfiles = variable_get('googleanalytics_trackfiles', GA_TRACKFILES_EXTENSIONS) ? TRUE : FALSE;
+ variable_set('googleanalytics_trackfiles_extensions', variable_get('googleanalytics_trackfiles', '7z|aac|avi|csv|doc|exe|flv|gif|gz|jpe?g|js|mp(3|4|e?g)|mov|pdf|phps|png|ppt|rar|sit|tar|torrent|txt|wma|wmv|xls|xml|zip'));
+ $trackfiles = variable_get('googleanalytics_trackfiles', '7z|aac|avi|csv|doc|exe|flv|gif|gz|jpe?g|js|mp(3|4|e?g)|mov|pdf|phps|png|ppt|rar|sit|tar|torrent|txt|wma|wmv|xls|xml|zip') ? TRUE : FALSE;
variable_set('googleanalytics_trackfiles', $trackfiles);
$ret[] = array('success' => TRUE, 'query' => 'Updated download tracking settings.');
@@ -257,3 +260,17 @@ function googleanalytics_update_6200() {
return $ret;
}
+
+/**
+ * Update list of default file extensions.
+ */
+function googleanalytics_update_6201() {
+ $ret = array();
+
+ if (variable_get('googleanalytics_trackfiles_extensions', '') == '7z|aac|avi|csv|doc|exe|flv|gif|gz|jpe?g|js|mp(3|4|e?g)|mov|pdf|phps|png|ppt|rar|sit|tar|torrent|txt|wma|wmv|xls|xml|zip') {
+ variable_set('googleanalytics_trackfiles_extensions', '7z|aac|arc|arj|asf|asx|avi|bin|csv|doc|exe|flv|gif|gz|gzip|hqx|jar|jpe?g|js|mp(2|3|4|e?g)|mov(ie)?|msi|msp|pdf|phps|png|ppt|qtm?|ra(m|r)?|sea|sit|tar|tgz|torrent|txt|wav|wma|wmv|wpd|xls|xml|z|zip');
+ }
+ $ret[] = array('success' => TRUE, 'query' => 'The default extensions for download tracking have been updated.');
+
+ return $ret;
+}
diff --git a/googleanalytics.module b/googleanalytics.module
index c690ff2..6624606 100644
--- a/googleanalytics.module
+++ b/googleanalytics.module
@@ -10,7 +10,7 @@
* @author: Mike Carter <www.ixis.co.uk/contact>
*/
-define('GA_TRACKFILES_EXTENSIONS', '7z|aac|avi|csv|doc|exe|flv|gif|gz|jpe?g|js|mp(3|4|e?g)|mov|pdf|phps|png|ppt|rar|sit|tar|torrent|txt|wma|wmv|xls|xml|zip');
+define('GA_TRACKFILES_EXTENSIONS', '7z|aac|arc|arj|asf|asx|avi|bin|csv|doc|exe|flv|gif|gz|gzip|hqx|jar|jpe?g|js|mp(2|3|4|e?g)|mov(ie)?|msi|msp|pdf|phps|png|ppt|qtm?|ra(m|r)?|sea|sit|tar|tgz|torrent|txt|wav|wma|wmv|wpd|xls|xml|z|zip');
function googleanalytics_help($path, $arg) {
switch ($path) {