diff --git a/translations/da.po b/translations/da.po index fbe5ab0..7c892e0 100644 --- a/translations/da.po +++ b/translations/da.po @@ -1,50 +1,65 @@ -# Danish translation of locale.d6.dev -# Generated by admin +# $Id$ +# +# LANGUAGE translation of Drupal (general) +# Copyright YEAR NAME +# Generated from files: +# webtrends.admin.inc: n/a +# webtrends.module: n/a +# webtrends.info: n/a # msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" -"POT-Creation-Date: 2011-01-19 14:29+0100\n" -"PO-Revision-Date: 2011-01-19 12:57+0100\n" +"POT-Creation-Date: 2014-07-23 14:43+0200\n" +"PO-Revision-Date: 2014-07-23 14:48+0100\n" "Last-Translator: NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" +"Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=2; plural=(n!=1);\n" +"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" +"X-Generator: Poedit 1.5.4\n" #: webtrends.admin.inc:12 msgid "Hostname" msgstr "Værtsnavn" #: webtrends.admin.inc:13 -msgid "The hostname of the WebTrends server (gDomain)." +msgid "The hostname of the tracked site." msgstr "" -#: webtrends.admin.inc:20 -msgid "The site identification key (gDcsId)." +#: webtrends.admin.inc:19 +msgid "Site ID" msgstr "" -#: webtrends.module:30 -msgid "Webtrends module not configured." +#: webtrends.admin.inc:20 +msgid "The site identification key." msgstr "" -#: webtrends.module:12 -msgid "Settings for the WebTrends analytics tool." -msgstr "" +#: webtrends.admin.inc:26 +msgid "Enable \"Error pages\" parameters" +msgstr "Aktiver \"Error pages\" parametre" -#: webtrends.admin.inc:19 -msgid "Site ID" -msgstr "" +#: webtrends.admin.inc:27 +msgid "Add webtrends error page parameters to url, for 404 pages" +msgstr "Tilføjer webtrends error page parametre til url'en på 404 sider" #: webtrends.module:30 msgid "webtrends" msgstr "" -#: webtrends.module:11 webtrends.info:0 +#: webtrends.module:30 +msgid "Webtrends module not configured." +msgstr "" + +#: webtrends.module:10 webtrends.info:0 msgid "WebTrends" msgstr "" +#: webtrends.module:11 +msgid "Settings for the WebTrends analytics tool." +msgstr "" + #: webtrends.info:0 msgid "Adds WebTrends JavaScript tracking code to all your site's pages." msgstr "" diff --git a/translations/webtrends.pot b/translations/webtrends.pot index f82a760..3d81da0 100644 --- a/translations/webtrends.pot +++ b/translations/webtrends.pot @@ -11,7 +11,7 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" -"POT-Creation-Date: 2011-01-19 14:29+0100\n" +"POT-Creation-Date: 2014-07-23 14:43+0200\n" "PO-Revision-Date: YYYY-mm-DD HH:MM+ZZZZ\n" "Last-Translator: NAME \n" "Language-Team: LANGUAGE \n" @@ -25,7 +25,7 @@ msgid "Hostname" msgstr "" #: webtrends.admin.inc:13 -msgid "The hostname of the WebTrends server (gDomain)." +msgid "The hostname of the tracked site." msgstr "" #: webtrends.admin.inc:19 @@ -33,7 +33,15 @@ msgid "Site ID" msgstr "" #: webtrends.admin.inc:20 -msgid "The site identification key (gDcsId)." +msgid "The site identification key." +msgstr "" + +#: webtrends.admin.inc:26 +msgid "Enable \"Error pages\" parameters" +msgstr "" + +#: webtrends.admin.inc:27 +msgid "Add webtrends error page parameters to url, for 404 pages" msgstr "" #: webtrends.module:30 @@ -44,11 +52,11 @@ msgstr "" msgid "Webtrends module not configured." msgstr "" -#: webtrends.module:11 webtrends.info:0 +#: webtrends.module:10 webtrends.info:0 msgid "WebTrends" msgstr "" -#: webtrends.module:12 +#: webtrends.module:11 msgid "Settings for the WebTrends analytics tool." msgstr "" diff --git a/webtrends.admin.inc b/webtrends.admin.inc index a2c25bc..c9817a4 100644 --- a/webtrends.admin.inc +++ b/webtrends.admin.inc @@ -21,6 +21,20 @@ function webtrends_admin_settings_form($form_state) { '#default_value' => variable_get('webtrends_dcs_id', FALSE), ); + $form['webtrends_old_dcs_id'] = array( + '#type' => 'textfield', + '#title' => t('Site ID'), + '#description' => t('The site identification key for the v9.3.0 js. Leave empty to disable v9.3.0.'), + '#default_value' => variable_get('webtrends_old_dcs_id', FALSE), + ); + + $form['webtrends_error_pages'] = array( + '#type' => 'checkbox', + '#title' => t('Enable "Error pages" parameters'), + '#description' => t('Add webtrends error page parameters to url, for 404 pages'), + '#default_value' => variable_get('webtrends_error_pages', FALSE), + ); + // Delete the generated file js/webtrends_include1.js. $form['#submit'][] = 'drupal_clear_js_cache'; diff --git a/webtrends.info b/webtrends.info index 39bc76e..2811de6 100644 --- a/webtrends.info +++ b/webtrends.info @@ -2,4 +2,3 @@ name = WebTrends description = Adds WebTrends JavaScript tracking code to all your site's pages. core = 6.x - diff --git a/webtrends.min.js b/webtrends.min.js new file mode 100644 index 0000000..1867482 --- /dev/null +++ b/webtrends.min.js @@ -0,0 +1,49 @@ +var n=void 0; +(function(i,j,k,l){function m(a){if(a){if(!a.forEach)a.forEach=function(a,c){for(var e=c||window,d=0,g=this.length;d8){var b=j.body;return function(a){return b.querySelectorAll(a)}}if(i.jQuery)return i.jQuery.find;if(i.Sizzle)return i.Sizzle;if(i.YAHOO&& +YAHOO.za&&YAHOO.za.Aa)return YAHOO.za.Aa.Nb;if("qwery"in i)return qwery;i.YUI&&YUI().Pb("node",function(a){return a.all});return j.querySelectorAll?(b=j.body)?function(a){return b.querySelectorAll(a)}:function(){return[]}:function(){return[]}},pa:function(a){var a=a.split(/[&?]/g),b={};try{for(var c=0,e=a.length;c=8?"mousedown":"mouseup",function(b){if(!b)b=window.event;d.Pa(a,{event:b})}); +d.ta=!0}d.h[a]||(d.h[a]={});if(c)e(c,b);else for(var g in d.e)e(d.e[g],b)}},Pa:function(a,b){for(var c in d.e)d.fireEvent(a,d.e[c],b)},Ca:function(a,b,c,e){if(typeof b==="function")return b.onetime?(c.push(b),!0):(b(a,e),!1)},fireEvent:function(a,b,c){var e=m([]);if(d.h[a]&&d.h[a][b.n]){a=d.h[a][b.n];if(!a.length)return;for(var f=a.length-1;f>=0;f--)d.Ca(b,a[f],e,c)&&a.pop()}e.forEach(function(a){a(b,c)})},ca:function(a,b){var c=!1,e;for(e in d.e){var f=d.e[e];a in f.plugins&&(c=!0,f.ca(a,b))}c|| +b({Mb:!0})},T:function(a,b){for(var c=j.cookie.split("; "),e=[],d=0,g=0,h=a.length,p=c.length,g=0;g0){d=0;if(c>1&&a==b){p=new Date(0);for(g=0;gp&&(p.setTime(i.getTime()),d=g)}return unescape(e[d].substring(h+1))}else return null},Wa:function(a,b,c){a=a.split(c||":");for(c=0;ch.getTime()+18E5||c.getTime()>f.getTime()+288E5)a.vt_f_tlv=Math.floor((f.getTime()-e)/1E3),f.setTime(c.getTime()),a.vt_f_s="1";if(c.getDate()!=h.getDate()||c.getMonth()!=h.getMonth()||c.getFullYear()!=h.getFullYear())a.vt_f_d="1"}else{if(this.X.length)a.co_f=d.f[this.domain].length?d.f[this.domain]:this.X,a.vt_f="1";else if(d.f[this.domain].length)a.co_f=d.f[this.domain];else{a.co_f="2";i=c.getTime().toString();for(h=2;h<=32-i.length;h++)a.co_f+=Math.floor(Math.random()* +16).toString(16);a.co_f+=i;a.vt_f="1"}this.oa.length==0&&(a.vt_f_a="1");a.vt_f_s=a.vt_f_d="1";a.vt_f_tlh=a.vt_f_tlv="0"}a.co_f=escape(a.co_f);a.vtid=typeof this.M=="undefined"?a.co_f:this.M||"";a.vtvs=(f.getTime()-e).toString();e=(this.a.wb?"":"; expires="+this.a.kb.toGMTString())+"; path=/"+(this.a.domain!=""?"; domain="+this.a.domain:"");c=c.getTime().toString();f=f.getTime().toString();g.id=a.co_f;g.lv=c;g.ss=f;this.cb(b,g,e);b=this.$a(b,a.co_f,c,f);if(b!=0)a.co_f=a.vtvs=a.vt_f_s=a.vt_f_d=a.vt_f_tlh= +a.vt_f_tlv="",typeof this.M=="undefined"&&(a.vtid=""),a.vt_f=a.vt_f_a=b}else this.d.vtid=this.M?this.M:"",this.Ta(this.a.name,"/",this.a.domain)},Cb:function(){try{var a;arguments&&arguments.length>1?a={argsa:Array.prototype.slice.call(arguments)}:arguments.length===1&&(a=arguments[0]);typeof a==="undefined"&&(a={element:n,event:n,Fb:[]});typeof a.argsa==="undefined"&&(a.argsa=[]);this.la("collect",a);return this}catch(b){this.ma.push(b),this.I(b)}},ha:function(a){a&&a.length>1&&(a={argsa:Array.prototype.slice.call(arguments)}); +this.ea(a)},ea:function(a){try{typeof a==="undefined"&&(a={});this.la("multitrack",a);if(a.delayTime){var b=Number(a.delayTime);this.ya(isNaN(b)?d.t:b)}else this.ib&&this.ya(d.t);return!1}catch(c){this.ma.push(c),this.I(c)}},Ra:function(){this.j={};this.d={};this.q={};arguments.length%2==0&&this.U(arguments)},U:function(a){if(a)for(var b=0,c=a.length;b=5||a?o="1.5":c&&i||m?o="1.4":i||j&&b==4||l?o="1.3": +k&&(o="1.2");return o}();c.ct="unknown";if(j.body&&j.body.addBehavior)try{j.body.addBehavior("#default#clientCaps"),c.ct=j.body.Hb||"unknown",j.body.addBehavior("#default#homePage"),c.hp=j.body.Lb(location.href)?"1":"0"}catch(f){b.I(f)}var g=0,h=0;if(typeof i.innerWidth=="number")g=i.innerWidth,h=i.innerHeight;else if(j.documentElement&&(j.documentElement.clientWidth||j.documentElement.clientHeight))g=j.documentElement.clientWidth,h=j.documentElement.clientHeight;else if(j.body&&(j.body.clientWidth|| +j.body.clientHeight))g=j.body.clientWidth,h=j.body.clientHeight;c.bs=g+"x"+h;c.fv=function(){var a;if(i.ActiveXObject)for(a=15;a>0;a--)try{return new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+a),a+".0"}catch(c){b.I(c)}else if(k.plugins&&k.plugins.length)for(a=0;a0;d--){e=d;if(Silverlight.qa(e+".0"))break;if(a==e)break}for(d=9;d>=0;d--){f=e+"."+d;if(Silverlight.qa(f)){a=f;break}if(a==f)break}}}return a}();this.Z&&(c.le=typeof j.defaultCharset=="string"?j.defaultCharset:typeof j.characterSet=="string"?j.characterSet:"unknown");c.tv=d.version;c.sp=this.yb;c.dl="0";if(d.i&&d.i.lb)c.fb_ref= +d.i.lb;if(d.i&&d.i.mb)c.fb_source=d.i.mb;c.ssl=l.protocol.indexOf("https:")==0?"1":"0";e.dcsdat=a.getTime();e.dcssip=l.hostname;e.dcsuri=l.pathname;c.es=e.dcssip+e.dcsuri;if(l.search)e.dcsqry=l.search;if(e.dcsqry){a=e.dcsqry.toLowerCase();g=this.ua.length?this.ua.toLowerCase().split(","):[];for(h=0;h0&&(d=d.toLowerCase(),d.toUpperCase().indexOf("WT.")==0?this.d[d.substring(3)]= +f:d.toUpperCase().indexOf("DCSEXT.")==0?this.q[d.substring(7)]=f:d.toUpperCase().indexOf("DCS.")==0?this.j[d.substring(4)]=f:this.ra&&this.ra.indexOf(d)!=-1&&(this.q["meta_"+d]=f))}},ia:function(a){if(j.cookie.indexOf("WTLOPTOUT=")==-1){var b=this.d,c=this.j,e=this.q,f=this.i18n,g="http"+(l.protocol.indexOf("https:")==0?"s":"")+"://"+this.domain+(this.dcsid==""?"":"/"+this.dcsid)+"/dcs.gif?";f&&(b.dep="");for(var h in c)c[h]!=""&&c[h]!=n&&typeof c[h]!="function"&&(g+=this.S(h,c[h]));for(h in b)b[h]!= +""&&b[h]!=n&&typeof b[h]!="function"&&(g+=this.S("WT."+h,b[h]));for(h in e)if(e[h]!=""&&e[h]!=n&&typeof e[h]!="function")f&&(b.dep=b.dep.length==0?h:b.dep+";"+h),g+=this.S(h,e[h]);f&&b.dep.length>0&&(g+=this.S("WT.dep",b.dep));d.da&&d.da<9&&g.length>2048&&(g=g.substring(0,2040)+"&WT.tu=1");this.Sa(g,a);this.d.ad=""}},rb:function(){this.fb();this.ab();this.P&&this.P.length>0&&this.Qa();this.sb=!0},getTime:function(){return(new Date).getTime()},jb:0,ya:function(a){for(var b=this.getTime();this.getTime()- +b0){a=a.toLowerCase();if(a==window.location.hostname.toLowerCase())return!0;if(d.g(b.test))return b.test(a);else if(b.length>0)for(var c=b.length,e=0;e0&&(f=f.replace(g,"$1")),d=f.search(a),d!=-1))d+=b,end=f.indexOf("&",d), +value=f.substring(d,end!=-1?end:f.length),this.d.ad=this.d.ad?this.d.ad+";"+value:value}}};d.b.prototype.action_multitrack=d.b.prototype.Ia;d.b.prototype.action_collect=d.b.prototype.Ha;i.dcsMultiTrack=function(){for(var a=[],b=0;b -
DCSIMG
+
DCSIMG
EOT; - // We're relying on Drupal inserting inline js after references to - // external files. - drupal_add_js($script, 'inline', 'footer'); - drupal_add_js(drupal_get_path('module', 'webtrends') . '/webtrends.js', 'module', 'footer'); + // We're relying on Drupal inserting inline js after references to + // external files. + drupal_add_js($script, 'inline', 'footer'); + drupal_add_js(drupal_get_path('module', 'webtrends') . '/webtrends.v9.3.0.js', 'module', 'footer'); - return $html; + return $html; + } +} + +/** + * Implements hook_init(). + */ +function webtrends_init() { + // Webtrends require 2 parameters to be set on 404 pages, error_code and errorlink, + // if the page doesn't already have these, we redirect with the parameters added. + if(variable_get('webtrends_error_pages', FALSE) && !menu_get_item($_GET['q']) && !isset($_GET['error_code'])) { + $options = array( + 'error_code' => '404', + 'errorlink' => $_GET['q'], + ); + + drupal_goto($_GET['q'], $options); + } } diff --git a/webtrends.js b/webtrends.v9.3.0.js similarity index 100% rename from webtrends.js rename to webtrends.v9.3.0.js