diff options
author | matt <matt@59fd770c-687e-43c8-a1e3-f5a4ff64c105> | 2010-03-31 12:47:57 +0400 |
---|---|---|
committer | matt <matt@59fd770c-687e-43c8-a1e3-f5a4ff64c105> | 2010-03-31 12:47:57 +0400 |
commit | cca50dd8f5cbff530456932711f079eccaff94f6 (patch) | |
tree | 55541de9be394c5d5c8d4dc992a5582705ff56ff /plugins/SitesManager/templates | |
parent | 715dbbabea9681130fc0299dc1db8b68fc4736cf (diff) |
Fixes #41 Adding URL Query parameters exclude setting, per website, and global. We also by default exclude sessionid, phpsessid, etc.
The query parameters are excluded case insensitive.
Diffstat (limited to 'plugins/SitesManager/templates')
-rw-r--r-- | plugins/SitesManager/templates/SitesManager.js | 39 | ||||
-rw-r--r-- | plugins/SitesManager/templates/SitesManager.tpl | 36 |
2 files changed, 59 insertions, 16 deletions
diff --git a/plugins/SitesManager/templates/SitesManager.js b/plugins/SitesManager/templates/SitesManager.js index 5d764fd4fb..e8f545eaaf 100644 --- a/plugins/SitesManager/templates/SitesManager.js +++ b/plugins/SitesManager/templates/SitesManager.js @@ -19,13 +19,15 @@ function getAddSiteAJAX( row ) var ajaxRequest = piwikHelper.getStandardAjaxConf(); var parameters = {}; - var siteName = $(row).find('input#siteadd_name').val(); - var urls = $(row).find('textarea#siteadd_urls').val(); + var siteName = $(row).find('input#name').val(); + var urls = $(row).find('textarea#urls').val(); var urls = getApiFormatUrls(urls); - var excludedIps = $(row).find('textarea#siteadd_excludedIps').val(); - excludedIps = getApiFormatExcludedIps(excludedIps); + var excludedIps = $(row).find('textarea#excludedIps').val(); + excludedIps = getApiFormatTextarea(excludedIps); var timezone = encodeURIComponent($(row).find('#timezones option:selected').val()); var currency = encodeURIComponent($(row).find('#currencies option:selected').val()); + var excludedQueryParameters = $(row).find('textarea#excludedQueryParameters').val(); + excludedQueryParameters = getApiFormatTextarea(excludedQueryParameters); var request = ''; request += '&module=API'; @@ -36,6 +38,7 @@ function getAddSiteAJAX( row ) request += '&timezone='+timezone; request += '¤cy='+currency; request += '&excludedIps='+excludedIps; + request += '&excludedQueryParameters='+excludedQueryParameters; $.each(urls, function (key,value){ request+= '&urls[]='+escape(value);} ); request += '&token_auth=' + piwik.token_auth; @@ -48,9 +51,9 @@ function getApiFormatUrls(urls) { return urls.trim().split("\n"); } -function getApiFormatExcludedIps(excludedIps) +function getApiFormatTextarea(textareaContent) { - return excludedIps.trim().split("\n").join(','); + return textareaContent.trim().split("\n").join(','); } function getUpdateSiteAJAX( row ) @@ -62,7 +65,9 @@ function getUpdateSiteAJAX( row ) var urls = $(row).find('textarea#urls').val(); urls = getApiFormatUrls(urls); var excludedIps = $(row).find('textarea#excludedIps').val(); - excludedIps = getApiFormatExcludedIps(excludedIps); + excludedIps = getApiFormatTextarea(excludedIps); + var excludedQueryParameters = $(row).find('textarea#excludedQueryParameters').val(); + excludedQueryParameters = getApiFormatTextarea(excludedQueryParameters); var timezone = encodeURIComponent($(row).find('#timezones option:selected').val()); var currency = encodeURIComponent($(row).find('#currencies option:selected').val()); var request = ''; @@ -75,6 +80,7 @@ function getUpdateSiteAJAX( row ) request += '&timezone='+timezone; request += '¤cy='+currency; request += '&excludedIps='+excludedIps; + request += '&excludedQueryParameters='+excludedQueryParameters; $.each(urls, function (key,value){ if(value.length>1) request+= '&urls[]='+value;} ); request += '&token_auth=' + piwik.token_auth; @@ -89,7 +95,9 @@ function getGlobalSettingsAJAX() var timezone = encodeURIComponent($('#defaultTimezone option:selected').val()); var currency = encodeURIComponent($('#defaultCurrency option:selected').val()); var excludedIps = $('textarea#globalExcludedIps').val(); - excludedIps = getApiFormatExcludedIps(excludedIps); + excludedIps = getApiFormatTextarea(excludedIps); + var excludedQueryParameters = $('textarea#globalExcludedQueryParameters').val(); + excludedQueryParameters = getApiFormatTextarea(excludedQueryParameters); var request = ''; request += 'module=SitesManager'; request += '&action=setGlobalSettings'; @@ -97,6 +105,7 @@ function getGlobalSettingsAJAX() request += '&timezone='+timezone; request += '¤cy='+currency; request += '&excludedIps='+excludedIps; + request += '&excludedQueryParameters='+excludedQueryParameters; request += '&token_auth=' + piwik.token_auth; ajaxRequest.data = request; return ajaxRequest; @@ -112,9 +121,10 @@ $(document).ready( function() { $(' <tr id="'+newRowId+'">\ <td> </td>\ - <td><input id="siteadd_name" value="Name" size="15" /></td>\ - <td><textarea cols="25" rows="3" id="siteadd_urls">http://siteUrl.com/\nhttp://siteUrl2.com/</textarea><br />'+aliasUrlsHelp+'</td>\ - <td><textarea cols="20" rows="4" id="siteadd_excludedIps"></textarea><br />'+excludedIpHelp+'</td>\ + <td><input id="name" value="Name" size="15" /></td>\ + <td><textarea cols="25" rows="3" id="urls">http://siteUrl.com/\nhttp://siteUrl2.com/</textarea><br />'+aliasUrlsHelp+'</td>\ + <td><textarea cols="20" rows="4" id="excludedIps"></textarea><br />'+excludedIpHelp+'</td>\ + <td><textarea cols="20" rows="4" id="excludedQueryParameters"></textarea><br />'+excludedQueryParametersHelp+'</td>\ <td>'+getTimezoneSelector(defaultTimezone)+'<br />' + timezoneHelp + '</td>\ <td>'+getCurrencySelector(defaultCurrency)+'<br />' + currencyHelp + '</td>\ <td><img src="plugins/UsersManager/images/ok.png" class="addsite" href="#" /></td>\ @@ -122,7 +132,6 @@ $(document).ready( function() { </tr>') .appendTo('#editSites') ; - $('#'+newRowId).keypress( submitSiteOnEnter ); $('.addsite').click( function(){ $.ajax( getAddSiteAJAX($('tr#'+newRowId)) ); } ); $('.cancel').click(function() { piwikHelper.hideAjaxError(); $(this).parents('tr').remove(); $('.addRowSite').toggle(); }); return false; @@ -172,6 +181,12 @@ $(document).ready( function() { contentAfter += '<br />'+excludedIpHelp; $(n).html(contentAfter); } + if(idName == 'excludedQueryParameters') + { + var contentAfter = '<textarea cols="20" rows="4" id="excludedQueryParameters">'+contentBefore.replace(/<br *\/? *>/gi,"\n")+'</textarea>'; + contentAfter += '<br />'+excludedQueryParametersHelp; + $(n).html(contentAfter); + } if(idName == 'timezone') { var contentAfter = getTimezoneSelector(contentBefore); diff --git a/plugins/SitesManager/templates/SitesManager.tpl b/plugins/SitesManager/templates/SitesManager.tpl index 7dcd768f3c..81e942a0b8 100644 --- a/plugins/SitesManager/templates/SitesManager.tpl +++ b/plugins/SitesManager/templates/SitesManager.tpl @@ -26,6 +26,13 @@ var aliasUrlsHelp = '{'SitesManager_AliasUrlHelp'|translate|inlineHelp|escape:ja {'SitesManager_CurrencySymbolWillBeUsedForGoals'|translate|inlineHelp} {/capture} +{capture assign=excludedQueryParametersHelp} + {'SitesManager_ListOfQueryParametersToExclude'|translate} + <br/><br/> + {'SitesManager_PiwikWillAutomaticallyExcludeCommonSessionParameters'|translate:"phpsessid, sessionid, etc."} +{/capture} +{assign var=excludedQueryParametersHelp value=$excludedQueryParametersHelp|inlineHelp} +var excludedQueryParametersHelp = '{$excludedQueryParametersHelp|escape:javascript}'; var timezoneHelp = '{$timezoneHelpPlain|inlineHelp|escape:javascript}'; var currencyHelp = '{$currencyHelpPlain|escape:javascript}'; {assign var=defaultTimezoneHelp value=$defaultTimezoneHelpPlain|inlineHelp}; @@ -57,12 +64,20 @@ var defaultCurrency = '{$defaultCurrency}'; option, select { font-size:11px; } - +textarea { +font-size:9pt; +} .globalSettings td { vertical-align:top; } .globalSettings .ui-inline-help { -margin-top:0; + margin-top:0; + margin-bottom:30px; + width:100%; + margin-left:40px; +} +.admin thead th { +vertical-align:middle; } </style> {/literal} @@ -87,6 +102,7 @@ margin-top:0; <th>{'SitesManager_Name'|translate}</th> <th>{'SitesManager_Urls'|translate}</th> <th>{'SitesManager_ExcludedIps'|translate}</th> + <th>{'SitesManager_ExcludedParameters'|replace:" ":"<br/>"}</th> <th>{'SitesManager_Timezone'|translate}</th> <th>{'SitesManager_Currency'|translate}</th> <th> </th> @@ -101,8 +117,9 @@ margin-top:0; <td id="siteName" class="editableSite">{$site.name}</td> <td id="urls" class="editableSite">{foreach from=$site.alias_urls item=url}{$url}<br />{/foreach}</td> <td id="excludedIps" class="editableSite">{foreach from=$site.excluded_ips item=ip}{$ip}<br />{/foreach}</td> - <td id="timezone" class="editableSite">{$site.timezone}</td> - <td id="currency" class="editableSite">{$site.currency}</td> + <td id="excludedQueryParameters" class="editableSite">{foreach from=$site.excluded_parameters item=parameter}{$parameter}<br />{/foreach}</td> + <td id="timezone" class="editableSite">{$site.timezone}</td> + <td id="currency" class="editableSite">{$site.currency}</td> <td><img src='plugins/UsersManager/images/edit.png' class="editSite" id="row{$i}" href='#' title="{'General_Edit'|translate}" /></td> <td><img src='plugins/UsersManager/images/remove.png' class="deleteSite" id="row{$i}" title="{'General_Delete'|translate}" value="{'General_Delete'|translate}" /></td> <td><a href='{url action=displayJavascriptCode idsite=$site.idsite}'>{'SitesManager_ShowTrackingTag'|translate}</a></td> @@ -136,6 +153,17 @@ margin-top:0; </td></tr> <tr><td colspan="2"> + <b>{'SitesManager_GlobalListExcludedQueryParameters'|translate}</b> + <p>{'SitesManager_ListOfQueryParametersToBeExcludedOnAllWebsites'|translate} </p> + </td></tr> + <tr><td> + <textarea cols="30" rows="3" id="globalExcludedQueryParameters">{$globalExcludedQueryParameters} +</textarea> + </td><td> + {$excludedQueryParametersHelp} + </td></tr> + + <tr><td colspan="2"> <b>{'SitesManager_DefaultTimezone'|translate}</b> <p>{'SitesManager_SelectDefaultTimezone'|translate} </p> </td></tr> |