diff options
author | Fabian Becker <halfdan@xnorfz.de> | 2013-04-16 01:55:48 +0400 |
---|---|---|
committer | Fabian Becker <halfdan@xnorfz.de> | 2013-04-16 01:55:48 +0400 |
commit | e9bcdc11ec78e8048dbd22f8b8542d50c30b2238 (patch) | |
tree | 1cd573228829934a38bb8c2f83766f541b918475 /plugins/SitesManager/templates | |
parent | 7ecf2a67c9759da5c5bf9c78de1b53b9cc0cd02b (diff) |
Converted SitesManager to Twig
Diffstat (limited to 'plugins/SitesManager/templates')
-rw-r--r-- | plugins/SitesManager/templates/DisplayAlternativeTags.twig (renamed from plugins/SitesManager/templates/DisplayAlternativeTags.tpl) | 29 | ||||
-rw-r--r-- | plugins/SitesManager/templates/DisplayJavascriptCode.tpl | 69 | ||||
-rw-r--r-- | plugins/SitesManager/templates/DisplayJavascriptCode.twig | 64 | ||||
-rw-r--r-- | plugins/SitesManager/templates/SitesManager.tpl | 426 | ||||
-rw-r--r-- | plugins/SitesManager/templates/Tracking.tpl | 4 | ||||
-rw-r--r-- | plugins/SitesManager/templates/Tracking.twig | 7 | ||||
-rw-r--r-- | plugins/SitesManager/templates/index.twig | 454 |
7 files changed, 541 insertions, 512 deletions
diff --git a/plugins/SitesManager/templates/DisplayAlternativeTags.tpl b/plugins/SitesManager/templates/DisplayAlternativeTags.twig index 3dee0c15c4..115b9863e2 100644 --- a/plugins/SitesManager/templates/DisplayAlternativeTags.tpl +++ b/plugins/SitesManager/templates/DisplayAlternativeTags.twig @@ -2,7 +2,9 @@ The Image Tracker code can be used when Javascript is not allowed. <br/> -<div class='toggleHelp' id='imageTracker' style='display:none'><a name='image'>› Display Image Tracker code </a></div> +<div class='toggleHelp' id='imageTracker' style='display:none'> + <a name='image'>› Display Image Tracker code </a> +</div> <div class='imageTracker'> <p>Some websites like MySpace or eBay will not allow users to add Javascript to their profile but accept HTML. In this case, you can still track visits with @@ -13,7 +15,7 @@ The Image Tracker code can be used when Javascript is not allowed. </p> <code> <!-- Piwik Image Tracker --><br/> - <img src="{if isset($piwikUrlRequest)}{$piwikUrlRequest}{else}{$piwikUrl}{/if}piwik.php?idsite={$idSite}&amp;rec=1" style="border:0" alt="" /><br/> + <img src="{% if piwikUrlRequest is defined %}{{ piwikUrlRequest }}{% else %}{{ piwikUrl }}{% endif %}piwik.php?idsite={{ idSite }}&amp;rec=1" style="border:0" alt="" /><br/> <!-- End Piwik --><br/> </code> <br/> @@ -50,10 +52,12 @@ It is also possible to call the Piwik Tracking API using your favorite programmi a ticket</a> in our developer area (please attach the client code to the ticket). </p> - <p>Follow these instructions to get started with the Tracking API: + <p>Follow these instructions to get started with the Tracking API:</p> <ul style='list-style-type:decimal;'> - <li><a href='{if isset($piwikUrlRequest)}{$piwikUrlRequest}{else}{$piwikUrl}{/if}{url action=downloadPiwikTracker}' target='_blank'>Click here to - download the file PiwikTracker.php</a> + <li> + <a href='{% if piwikUrlRequest is defined %}{{ piwikUrlRequest }}{% else %}{{ piwikUrl }}{% endif %}{{ linkTo({'action':'downloadPiwikTracker'}) }}' target='_blank'> + Click here to download the file PiwikTracker.php + </a> </li> <li>Upload the PiwikTracker.php file in the same path as your project files </li> @@ -62,7 +66,7 @@ It is also possible to call the Piwik Tracking API using your favorite programmi <?php <br/> // -- Piwik Tracking API init -- <br/> require_once "/path/to/PiwikTracker.php";<br/> - PiwikTracker::$URL = '{if isset($piwikUrlRequest)}{$piwikUrlRequest}{else}{$piwikUrl}{/if}';<br/> + PiwikTracker::$URL = '{% if piwikUrlRequest is defined %}{{ piwikUrlRequest }}{% else %}{{ piwikUrl }}{% endif %}';<br/> ?> </code> </li> @@ -76,12 +80,12 @@ It is also possible to call the Piwik Tracking API using your favorite programmi <br/>Paste this code before the </body> code in your pages. <code> <?php <br/> - // Example 1: Tracks a pageview for Website id = {$idSite}<br/> + // Example 1: Tracks a pageview for Website id = {{ idSite }}<br/> echo '<img src="'. str_replace("&","&amp;", Piwik_getUrlTrackPageView( $idSite = {$idSite}, $customTitle = 'This title will appear in the report Actions > Page titles')) . '" alt="" />';<br/> - // Example 2: Triggers a Goal conversion for Website id = {$idSite} and Goal id = 2<br/> + // Example 2: Triggers a Goal conversion for Website id = {{ idSite }} and Goal id = 2<br/> // $customRevenue is optional and is set to the amount generated by the current transaction (in online shops for example)<br/> - echo '<img src="'. str_replace("&","&amp;", Piwik_getUrlTrackGoal( $idSite = {$idSite}, $idGoal = 2, $customRevenue = + echo '<img src="'. str_replace("&","&amp;", Piwik_getUrlTrackGoal( $idSite = {{ idSite }}, $idGoal = 2, $customRevenue = 39)) . '" alt="" />';<br/> ?> </code> @@ -100,7 +104,7 @@ It is also possible to call the Piwik Tracking API using your favorite programmi <code> <?php <br/> - $piwikTracker = new PiwikTracker( $idSite = {$idSite} );<br/> + $piwikTracker = new PiwikTracker( $idSite = {{ idSite }} );<br/> // You can manually set the visitor details (resolution, time, plugins, etc.) <br/> // See all other ->set* functions available in the PiwikTracker.php file<br/> $piwikTracker->setResolution(1600, 1400);<br/><br/> @@ -115,10 +119,9 @@ It is also possible to call the Piwik Tracking API using your favorite programmi </ul> </li> </ul> - </p> - {if !isset($calledExternally) || !$calledExternally} + {% if calledExternally is not defined or not calledExternally %} <p> Read more about the Piwik Tracking API <a href='http://piwik.org/docs/tracking-api/' target='_blank'>in the documentation</a> </p> - {/if} + {% endif %} </div> diff --git a/plugins/SitesManager/templates/DisplayJavascriptCode.tpl b/plugins/SitesManager/templates/DisplayJavascriptCode.tpl deleted file mode 100644 index b34e38fec0..0000000000 --- a/plugins/SitesManager/templates/DisplayJavascriptCode.tpl +++ /dev/null @@ -1,69 +0,0 @@ -{literal} - <style type="text/css"> - .trackingHelp ul { - padding-left: 40px; - list-style-type: square; - } - - .trackingHelp ul li { - margin-bottom: 10px; - } - - .trackingHelp h2 { - margin-top: 20px; - } - - p { - text-align: justify; - } - </style> -{/literal} - -<h2>{'SitesManager_TrackingTags'|translate:$displaySiteName}</h2> - -<div class='trackingHelp'> - {'Installation_JSTracking_Intro'|translate} - <br/><br/> - {'CoreAdminHome_JSTrackingIntro3'|translate:'<a href="http://piwik.org/integrate/" target="_blank">':'</a>'} - - <h3>{'SitesManager_JsTrackingTag'|translate}</h3> - - <p>{'CoreAdminHome_JSTracking_CodeNote'|translate:"</body>"}</p> - - <pre class="code-pre"><code>{$jsTag}</code></pre> - - <br/> - {'CoreAdminHome_JSTrackingIntro5'|translate:'<a target="_blank" href="http://piwik.org/docs/javascript-tracking/">':'</a>'} - <br/><br/> - {'Installation_JSTracking_EndNote'|translate:'<em>':'</em>'} - -</div> -{literal} - <script type="text/javascript"> - $(document).ready(function () { - // when code element is clicked, select the text - $('code').click(function () { - // credit where credit is due: - // http://stackoverflow.com/questions/1173194/select-all-div-text-with-single-mouse-click - var range; - if (document.body.createTextRange) // MSIE - { - range = document.body.createTextRange(); - range.moveToElementText(this); - range.select(); - } - else if (window.getSelection) // others - { - range = document.createRange(); - range.selectNodeContents(this); - - var selection = window.getSelection(); - selection.removeAllRanges(); - selection.addRange(range); - } - }); - - $('code').click(); - }); - </script> -{/literal} diff --git a/plugins/SitesManager/templates/DisplayJavascriptCode.twig b/plugins/SitesManager/templates/DisplayJavascriptCode.twig new file mode 100644 index 0000000000..950ce47705 --- /dev/null +++ b/plugins/SitesManager/templates/DisplayJavascriptCode.twig @@ -0,0 +1,64 @@ +<style type="text/css"> + .trackingHelp ul { + padding-left: 40px; + list-style-type: square; + } + + .trackingHelp ul li { + margin-bottom: 10px; + } + + .trackingHelp h2 { + margin-top: 20px; + } + + p { + text-align: justify; + } +</style> + +<h2>{{ 'SitesManager_TrackingTags'|translate(displaySiteName) }}</h2> + +<div class='trackingHelp'> + {{ 'Installation_JSTracking_Intro'|translate }} + <br/><br/> + {{ 'CoreAdminHome_JSTrackingIntro3'|translate('<a href="http://piwik.org/integrate/" target="_blank">','</a>')|raw }} + + <h3>{{ 'SitesManager_JsTrackingTag'|translate }}</h3> + + <p>{{ 'CoreAdminHome_JSTracking_CodeNote'|translate("</body>")|raw }}</p> + + <pre class="code-pre"><code>{{ jsTag|raw }}</code></pre> + + <br/> + {{ 'CoreAdminHome_JSTrackingIntro5'|translate('<a target="_blank" href="http://piwik.org/docs/javascript-tracking/">','</a>')|raw }} + <br/><br/> + {{ 'Installation_JSTracking_EndNote'|translate('<em>','</em>')|raw }} +</div> +<script type="text/javascript"> + $(document).ready(function () { + // when code element is clicked, select the text + $('code').click(function () { + // credit where credit is due: + // http://stackoverflow.com/questions/1173194/select-all-div-text-with-single-mouse-click + var range; + if (document.body.createTextRange) // MSIE + { + range = document.body.createTextRange(); + range.moveToElementText(this); + range.select(); + } + else if (window.getSelection) // others + { + range = document.createRange(); + range.selectNodeContents(this); + + var selection = window.getSelection(); + selection.removeAllRanges(); + selection.addRange(range); + } + }); + + $('code').click(); + }); +</script>
\ No newline at end of file diff --git a/plugins/SitesManager/templates/SitesManager.tpl b/plugins/SitesManager/templates/SitesManager.tpl deleted file mode 100644 index 63a1df7cdf..0000000000 --- a/plugins/SitesManager/templates/SitesManager.tpl +++ /dev/null @@ -1,426 +0,0 @@ -{include file="CoreAdminHome/templates/header.tpl"} -{loadJavascriptTranslations plugins='SitesManager'} - -{capture assign=excludedIpHelpPlain} - {'SitesManager_HelpExcludedIps'|translate:"1.2.3.*":"1.2.*.*"} -<br/><br/> - {'SitesManager_YourCurrentIpAddressIs'|translate:"<i>$currentIpAddress</i>"} -{/capture} -{assign var=excludedIpHelp value=$excludedIpHelpPlain|inlineHelp} - -{capture assign=defaultTimezoneHelpPlain} - {if $timezoneSupported} - {'SitesManager_ChooseCityInSameTimezoneAsYou'|translate} - {else} - {'SitesManager_AdvancedTimezoneSupportNotFound'|translate} - {/if} -<br/><br/> - {'SitesManager_UTCTimeIs'|translate:$utcTime} -{/capture} - -{capture assign=timezoneHelpPlain} - {$defaultTimezoneHelpPlain} -<br/><br/>{'SitesManager_ChangingYourTimezoneWillOnlyAffectDataForward'|translate} -{/capture} - -{capture assign=currencyHelpPlain} - {'SitesManager_CurrencySymbolWillBeUsedForGoals'|translate|inlineHelp} -{/capture} - -{capture assign=ecommerceHelpPlain} - {'SitesManager_EcommerceHelp'|translate} -<br/> - {'SitesManager_PiwikOffersEcommerceAnalytics'|translate:"<a href='http://piwik.org/docs/ecommerce-analytics/' target='_blank'>":"</a>"} -{/capture} - -{capture assign=excludedQueryParametersHelp} - {'SitesManager_ListOfQueryParametersToExclude'|translate} -<br/><br/> - {'SitesManager_PiwikWillAutomaticallyExcludeCommonSessionParameters'|translate:"phpsessid, sessionid, ..."} -{/capture} -{assign var=excludedQueryParametersHelp value=$excludedQueryParametersHelp|inlineHelp} - -{capture assign=excludedUserAgentsHelp} - {'SitesManager_GlobalExcludedUserAgentHelp1'|translate} -<br/><br/> - {'SitesManager_GlobalListExcludedUserAgents_Desc'|translate} {'SitesManager_GlobalExcludedUserAgentHelp2'|translate} -{/capture} -{assign var=excludedUserAgentsHelp value=$excludedUserAgentsHelp|inlineHelp} - -{capture assign=keepURLFragmentSelectHTML} -<h4 style="display:inline-block;">{'SitesManager_KeepURLFragmentsLong'|translate}</h4> - -<select id="keepURLFragmentSelect"> - <option value="0"> {if $globalKeepURLFragments}{'General_Yes'|translate}{else}{'General_No'|translate}{/if} - ({'General_Default'|translate}) - </option> - <option value="1">{'General_Yes'|translate}</option> - <option value="2">{'General_No'|translate}</option> -</select> -{/capture} - -<script type="text/javascript"> -var excludedIpHelp = '{$excludedIpHelp|escape:javascript}'; -var aliasUrlsHelp = '{'SitesManager_AliasUrlHelp'|translate|inlineHelp|escape:javascript}'; -var excludedQueryParametersHelp = '{$excludedQueryParametersHelp|escape:javascript}'; -var excludedUserAgentsHelp = '{$excludedUserAgentsHelp|escape:javascript}'; -var timezoneHelp = '{$timezoneHelpPlain|inlineHelp|escape:javascript}'; -var currencyHelp = '{$currencyHelpPlain|escape:javascript}'; -var ecommerceHelp = '{$ecommerceHelpPlain|inlineHelp|escape:javascript}'; -var ecommerceEnabled = '{'SitesManager_EnableEcommerce'|translate|escape:javascript}'; -var ecommerceDisabled = '{'SitesManager_NotAnEcommerceSite'|translate|escape:javascript}'; -{assign var=defaultTimezoneHelp value=$defaultTimezoneHelpPlain|inlineHelp} -{assign var=searchKeywordHelp value='SitesManager_SearchKeywordParametersDesc'|translate|inlineHelp} -{capture assign=searchCategoryHelpText}{'Goals_Optional'|translate} {'SitesManager_SearchCategoryParametersDesc'|translate}{/capture} -{assign var=searchCategoryHelp value=$searchCategoryHelpText|inlineHelp} -var sitesearchEnabled = '{'SitesManager_EnableSiteSearch'|translate|escape:javascript}'; -var sitesearchDisabled = '{'SitesManager_DisableSiteSearch'|translate|escape:javascript}'; -var searchKeywordHelp = '{$searchKeywordHelp|escape:javascript}'; -var searchCategoryHelp = '{$searchCategoryHelp|escape:javascript}'; -var sitesearchDesc = '{'SitesManager_TrackingSiteSearch'|translate|escape:javascript}'; -var keepURLFragmentSelectHTML = '{$keepURLFragmentSelectHTML|escape:javascript}'; - -var sitesManager = new SitesManager({$timezones}, {$currencies}, '{$defaultTimezone}', '{$defaultCurrency}'); -{assign var=searchKeywordLabel value='SitesManager_SearchKeywordLabel'|translate} -{assign var=searchCategoryLabel value='SitesManager_SearchCategoryLabel'|translate} -var searchKeywordLabel = '{$searchKeywordLabel|escape:javascript}'; -var searchCategoryLabel = '{$searchCategoryLabel|escape:javascript}'; -{assign var=sitesearchIntro value='SitesManager_SiteSearchUse'|translate} -var sitesearchIntro = '{$sitesearchIntro|inlineHelp|escape:javascript}'; -var sitesearchUseDefault = '{if $isSuperUser}{'SitesManager_SearchUseDefault'|translate:'<a href="#globalSiteSearch">':'</a>'|escape:'javascript'}{else}{'SitesManager_SearchUseDefault'|translate:'':''|escape:'javascript'}{/if}'; -var strDefault = '{'General_Default'|translate:escape:'javascript'}'; -{literal} -$(document).ready(function () { - sitesManager.init(); -}); -</script> - -<style type="text/css"> - .entityTable tr td { - vertical-align: top; - padding-top: 7px; - } - - .addRowSite:hover, .editableSite:hover, .addsite:hover, .cancel:hover, .deleteSite:hover, .editSite:hover, .updateSite:hover { - cursor: pointer; - } - - .addRowSite a { - text-decoration: none; - } - - .addRowSite { - padding: 1em; - font-weight: bold; - } - - #editSites { - vertical-align: top; - } - - option, select { - font-size: 11px; - } - - textarea { - font-size: 9pt; - } - - .admin thead th { - vertical-align: middle; - } - - .ecommerceInactive, .sitesearchInactive { - color: #666666; - } - - #searchSiteParameters { - display: none; - } - - #editSites h4 { - font-size: .8em; - margin: 1em 0 1em 0; - font-weight: bold; - } -</style> -{/literal} - -<h2>{'SitesManager_WebsitesManagement'|translate}</h2> -<p>{'SitesManager_MainDescription'|translate} -{'SitesManager_YouCurrentlyHaveAccessToNWebsites'|translate:"<b>$adminSitesCount</b>"} -{if $isSuperUser} - <br/> - {'SitesManager_SuperUserCan'|translate:"<a href='#globalSettings'>":"</a>"} -{/if} -</p> -{ajaxErrorDiv} -{ajaxLoadingDiv} - -{capture assign=createNewWebsite} -<div class="addRowSite"><img src='plugins/UsersManager/images/add.png' alt=""/> {'SitesManager_AddSite'|translate}</div> -{/capture} - -{if $adminSites|@count == 0} - {'SitesManager_NoWebsites'|translate} - {else} -<div class="ui-confirm" id="confirm"> - <h2></h2> - <input role="yes" type="button" value="{'General_Yes'|translate}"/> - <input role="no" type="button" value="{'General_No'|translate}"/> -</div> -<div class="entityContainer"> - {if $isSuperUser} - {$createNewWebsite} - {/if} - <table class="entityTable dataTable" id="editSites"> - <thead> - <tr> - <th>{'General_Id'|translate}</th> - <th>{'General_Name'|translate}</th> - <th>{'SitesManager_Urls'|translate}</th> - <th>{'SitesManager_ExcludedIps'|translate}</th> - <th>{'SitesManager_ExcludedParameters'|translate|replace:" ":"<br />"}</th> - <th id='exclude-user-agent-header' - {if !$allowSiteSpecificUserAgentExclude}style="display:none"{/if}>{'SitesManager_ExcludedUserAgents'|translate}</th> - <th>{'Actions_SubmenuSitesearch'|translate}</th> - <th>{'SitesManager_Timezone'|translate}</th> - <th>{'SitesManager_Currency'|translate}</th> - <th>{'Goals_Ecommerce'|translate}</th> - <th></th> - <th></th> - <th> {'SitesManager_JsTrackingTag'|translate} </th> - </tr> - </thead> - <tbody> - {foreach from=$adminSites key=i item=site} - <tr id="row{$site.idsite}" data-keep-url-fragments="{$site.keep_url_fragment}"> - <td id="idSite">{$site.idsite}</td> - <td id="siteName" class="editableSite">{$site.name}</td> - <td id="urls" class="editableSite">{foreach from=$site.alias_urls item=url}{$url|replace:"http://":""} - <br/>{/foreach}</td> - <td id="excludedIps" class="editableSite">{foreach from=$site.excluded_ips item=ip}{$ip}<br/>{/foreach} - </td> - <td id="excludedQueryParameters" - class="editableSite">{foreach from=$site.excluded_parameters item=parameter}{$parameter} - <br/>{/foreach} - </td> - <td id="excludedUserAgents" class="editableSite" - {if !$allowSiteSpecificUserAgentExclude}style="display:none"{/if}>{foreach from=$site.excluded_user_agents item=ua}{$ua} - <br/>{/foreach} - </td> - <td id="sitesearch" class="editableSite">{if $site.sitesearch}<span - class='sitesearchActive'>{'General_Yes'|translate}</span>{else}<span - class='sitesearchInactive'>-</span>{/if}<span class='sskp' - sitesearch_keyword_parameters="{$site.sitesearch_keyword_parameters|escape:'html'}" - sitesearch_category_parameters="{$site.sitesearch_category_parameters|escape:'html'}" - id="sitesearch_parameters"></span></td> - <td id="timezone" class="editableSite">{$site.timezone}</td> - <td id="currency" class="editableSite">{$site.currency}</td> - <td id="ecommerce" class="editableSite">{if $site.ecommerce}<span - class='ecommerceActive'>{'General_Yes'|translate}</span>{else} - <span class='ecommerceInactive'>-</span> - {/if}</td> - <td><span id="row{$site.idsite}" class='editSite link_but'><img src='themes/default/images/ico_edit.png' - title="{'General_Edit'|translate}" - border="0"/> {'General_Edit'|translate}</span> - </td> - <td><span id="row{$site.idsite}" class="deleteSite link_but"><img - src='themes/default/images/ico_delete.png' - title="{'General_Delete'|translate}" - border="0"/> {'General_Delete'|translate}</span></td> - <td> - <a href='{url module=CoreAdminHome action=trackingCodeGenerator idSite=$site.idsite updated=false}'>{'SitesManager_ShowTrackingTag'|translate}</a> - </td> - </tr> - {/foreach} - </tbody> - </table> - {if $isSuperUser} - {$createNewWebsite} - {/if} -</div> -{/if} - - -{* Admin users use these values for Site Search column, when editing websites *} -{if !$isSuperUser} -<input type="hidden" size="15" id="globalSearchKeywordParameters" - value="{$globalSearchKeywordParameters|escape:'html'}"/> -<input type="hidden" size="15" id="globalSearchCategoryParameters" - value="{$globalSearchCategoryParameters|escape:'html'}"/> -{/if} - -{if $isSuperUser} -<br/> -<a name='globalSettings'></a> -<h2>{'SitesManager_GlobalWebsitesSettings'|translate}</h2> -<br/> -<table style='width:600px' class="adminTable"> - - <tr> - <td colspan="2"> - <b>{'SitesManager_GlobalListExcludedIps'|translate}</b> - - <p>{'SitesManager_ListOfIpsToBeExcludedOnAllWebsites'|translate} </p> - </td> - </tr> - <tr> - <td> - <textarea cols="30" rows="3" id="globalExcludedIps">{$globalExcludedIps} - </textarea> - </td> - <td> - <label for="globalExcludedIps">{$excludedIpHelp}</label> - </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><label for="globalExcludedQueryParameters">{$excludedQueryParametersHelp}</label> - </td> - </tr> - -{* global excluded user agents *} - <tr> - <td colspan="2"> - <b>{'SitesManager_GlobalListExcludedUserAgents'|translate}</b> - - <p>{'SitesManager_GlobalListExcludedUserAgents_Desc'|translate}</p> - </td> - </tr> - - <tr> - <td> - <textarea cols="30" rows="3" id="globalExcludedUserAgents">{$globalExcludedUserAgents}</textarea> - </td> - <td><label for="globalExcludedUserAgents">{$excludedUserAgentsHelp}</label> - </td> - </tr> - - <tr> - <td> - <input type="checkbox" id="enableSiteUserAgentExclude" name="enableSiteUserAgentExclude" - {if $allowSiteSpecificUserAgentExclude}checked="checked"{/if}/><label - for="enableSiteUserAgentExclude">{'SitesManager_EnableSiteSpecificUserAgentExclude'|translate}</label> - <span id='enableSiteUserAgentExclude-loading' class='loadingPiwik' style='display:none'><img - src='./themes/default/images/loading-blue.gif'/></span> - </td> - <td>{'SitesManager_EnableSiteSpecificUserAgentExclude_Help'|translate:'<a href="#editSites">':'</a>'|inlineHelp} - </td> - </tr> - -{* global keep URL fragments *} - <tr> - <td colspan="2"> - <strong>{'SitesManager_KeepURLFragments'|translate}</strong> - - <p>{'SitesManager_KeepURLFragmentsHelp'|translate:"<em>#</em>":"<em>example.org/index.html#first_section</em>":"<em>example.org/index.html</em>"} - </p> - <input type="checkbox" id="globalKeepURLFragments" name="globalKeepURLFragments" - {if $globalKeepURLFragments}checked="checked"{/if}/> - <label for="globalKeepURLFragments">{'SitesManager_KeepURLFragmentsLong'|translate}</label> - - <p>{'SitesManager_KeepURLFragmentsHelp2'|translate}</p> - </td> - </tr> - -{* global site search *} - <tr> - <td colspan="2"> - <a name='globalSiteSearch'></a><b>{'SitesManager_TrackingSiteSearch'|translate}</b> - - <p>{$sitesearchIntro}</p> - <span class="form-description" - style='font-size:8pt'>{'SitesManager_SearchParametersNote'|translate} {'SitesManager_SearchParametersNote2'|translate}</span> - </td> - </tr> - <tr> - <td colspan="2"> - <label>{$searchKeywordLabel} <input type="text" size="15" id="globalSearchKeywordParameters" - value="{$globalSearchKeywordParameters|escape:'html'}"/> - - <div style='width: 200px;float:right;'>{$searchKeywordHelp}</div> - </label> - </td> - </tr> - -<tr> -<td colspan="2"> - {if !$isSearchCategoryTrackingEnabled} - <input value='globalSearchCategoryParametersIsDisabled' id="globalSearchCategoryParameters" type='hidden'/> - <span class='form-description'>Note: you could also track your Internal Search Engine Categories, but the plugin Custom Variables is required. Please enable the plugin CustomVariables (or ask your Piwik admin).</span> - {else} - {'Goals_Optional'|translate} {'SitesManager_SearchCategoryDesc'|translate} <br/> - </td> - </tr> - <tr> - <td colspan="2"> - <label>{$searchCategoryLabel} <input type="text" size="15" id="globalSearchCategoryParameters" - value="{$globalSearchCategoryParameters|escape:'html'}"/> - - <div style='width: 200px;float:right;'>{$searchCategoryHelp}</div> - </label> - {/if} -</td> -</tr> - - <tr> - <td colspan="2"> - <b>{'SitesManager_DefaultTimezoneForNewWebsites'|translate}</b> - - <p>{'SitesManager_SelectDefaultTimezone'|translate} </p> - </td> - </tr> - <tr> - <td> - <div id='defaultTimezone'></div> - </td> - <td> - {$defaultTimezoneHelp} - </td> - </tr> - - <tr> - <td colspan="2"> - <b>{'SitesManager_DefaultCurrencyForNewWebsites'|translate}</b> - - <p>{'SitesManager_SelectDefaultCurrency'|translate} </p> - </td> - </tr> - <tr> - <td> - <div id='defaultCurrency'></div> - </td> - <td> - {$currencyHelpPlain} - </td> - </tr> -</table> -<span style="margin-left:20px"> - <input type="submit" class="submit" id='globalSettingsSubmit' value="{'General_Save'|translate}"/> -</span> - {ajaxErrorDiv id=ajaxErrorGlobalSettings} - {ajaxLoadingDiv id=ajaxLoadingGlobalSettings} -{/if} -{if $showAddSite} -<script type="text/javascript">{literal} -$(document).ready(function () { - $('.addRowSite:first').trigger('click'); -}); -{/literal}</script> -{/if} - -<br/><br/><br/><br/> -{include file="CoreAdminHome/templates/footer.tpl"} diff --git a/plugins/SitesManager/templates/Tracking.tpl b/plugins/SitesManager/templates/Tracking.tpl deleted file mode 100644 index 76190b8c07..0000000000 --- a/plugins/SitesManager/templates/Tracking.tpl +++ /dev/null @@ -1,4 +0,0 @@ -{include file="CoreAdminHome/templates/header.tpl"} -{loadJavascriptTranslations plugins='SitesManager'} - -{include file="SitesManager/templates/DisplayJavascriptCode.tpl"}
\ No newline at end of file diff --git a/plugins/SitesManager/templates/Tracking.twig b/plugins/SitesManager/templates/Tracking.twig new file mode 100644 index 0000000000..6733214fbe --- /dev/null +++ b/plugins/SitesManager/templates/Tracking.twig @@ -0,0 +1,7 @@ +{% extends 'admin.twig' %} + +{% block content %} +{{ loadJavascriptTranslations(['SitesManager']) }} + +{% include "@SitesManager/DisplayJavascriptCode.twig" %} +{% endblock %}
\ No newline at end of file diff --git a/plugins/SitesManager/templates/index.twig b/plugins/SitesManager/templates/index.twig new file mode 100644 index 0000000000..f4809813d0 --- /dev/null +++ b/plugins/SitesManager/templates/index.twig @@ -0,0 +1,454 @@ +{% extends 'admin.twig' %} + +{% block content %} +{% import 'macros.twig' as piwik %} +{% import 'ajaxMacros.twig' as ajax %} +{{ loadJavascriptTranslations(['SitesManager']) }} + +{% set excludedIpHelpPlain %} + {{ 'SitesManager_HelpExcludedIps'|translate("1.2.3.*","1.2.*.*") }} + <br/><br/> + {{ 'SitesManager_YourCurrentIpAddressIs'|translate("<i>" ~ currentIpAddress ~ "</i>")|raw }} +{% endset %} +{% set excludedIpHelp=piwik.inlineHelp(excludedIpHelpPlain) %} + +{% set defaultTimezoneHelpPlain %} + {% if timezoneSupported %} + {{ 'SitesManager_ChooseCityInSameTimezoneAsYou'|translate }} + {% else %} + {{ 'SitesManager_AdvancedTimezoneSupportNotFound'|translate }} + {% endif %} + <br/><br/> + {{ 'SitesManager_UTCTimeIs'|translate(utcTime) }} +{% endset %} + +{% set timezoneHelpPlain %} + {{ defaultTimezoneHelpPlain }} + <br/><br/> + {{ 'SitesManager_ChangingYourTimezoneWillOnlyAffectDataForward'|translate }} +{% endset %} + +{% set currencyHelpPlain %} + {{ piwik.inlineHelp('SitesManager_CurrencySymbolWillBeUsedForGoals'|translate) }} +{% endset %} + +{% set ecommerceHelpPlain %} + {{ 'SitesManager_EcommerceHelp'|translate }} + <br/> + {{ 'SitesManager_PiwikOffersEcommerceAnalytics'|translate("<a href='http://piwik.org/docs/ecommerce-analytics/' target='_blank'>","</a>")|raw }} +{% endset %} + +{% set excludedQueryParametersHelp %} + {{ 'SitesManager_ListOfQueryParametersToExclude'|translate }} + <br/><br/> + {{ 'SitesManager_PiwikWillAutomaticallyExcludeCommonSessionParameters'|translate("phpsessid, sessionid, ...") }} +{% endset %} +{% set excludedQueryParametersHelp=piwik.inlineHelp(excludedQueryParametersHelp) %} + +{% set excludedUserAgentsHelp %} + {{ 'SitesManager_GlobalExcludedUserAgentHelp1'|translate }} + <br/><br/> + {{ 'SitesManager_GlobalListExcludedUserAgents_Desc'|translate}} {{ 'SitesManager_GlobalExcludedUserAgentHelp2'|translate }} +{% endset %} +{% set excludedUserAgentsHelp=piwik.inlineHelp(excludedUserAgentsHelp) %} + +{% set keepURLFragmentSelectHTML %} +<h4 style="display:inline-block;">{{ 'SitesManager_KeepURLFragmentsLong'|translate }}</h4> + +<select id="keepURLFragmentSelect"> + <option value="0"> {% if globalKeepURLFragments %}{{ 'General_Yes'|translate }}{% else %}{{ 'General_No'|translate }}{% endif %} + ({{ 'General_Default'|translate }}) + </option> + <option value="1">{{ 'General_Yes'|translate }}</option> + <option value="2">{{ 'General_No'|translate }}</option> +</select> +{% endset %} + +<script type="text/javascript"> +var excludedIpHelp = '{{ excludedIpHelp|e('js') }}'; +var aliasUrlsHelp = '{{ piwik.inlineHelp('SitesManager_AliasUrlHelp'|translate)|e('js') }}'; +var excludedQueryParametersHelp = '{{ excludedQueryParametersHelp|e('js') }}'; +var excludedUserAgentsHelp = '{{ excludedUserAgentsHelp|e('js') }}'; +var timezoneHelp = '{{ piwik.inlineHelp(timezoneHelpPlain)|e('js') }}'; +var currencyHelp = '{{ currencyHelpPlain|e('js') }}'; +var ecommerceHelp = '{{ piwik.inlineHelp(ecommerceHelpPlain)|e('js') }}'; +var ecommerceEnabled = '{{ 'SitesManager_EnableEcommerce'|translate|e('js') }}'; +var ecommerceDisabled = '{{ 'SitesManager_NotAnEcommerceSite'|translate|e('js') }}'; +{% set defaultTimezoneHelp=piwik.inlineHelp(defaultTimezoneHelpPlain) %} +{% set searchKeywordHelp=piwik.inlineHelp('SitesManager_SearchKeywordParametersDesc'|translate) %} +{% set searchCategoryHelpText %} + {{ 'Goals_Optional'|translate }} {{ 'SitesManager_SearchCategoryParametersDesc'|translate }} +{% endset %} +{% set searchCategoryHelp=piwik.inlineHelp(searchCategoryHelpText) %} +var sitesearchEnabled = '{{ 'SitesManager_EnableSiteSearch'|translate|e('js') }}'; +var sitesearchDisabled = '{{ 'SitesManager_DisableSiteSearch'|translate|e('js') }}'; +var searchKeywordHelp = '{{ searchKeywordHelp|e('js') }}'; +var searchCategoryHelp = '{{ searchCategoryHelp|e('js') }}'; +var sitesearchDesc = '{{ 'SitesManager_TrackingSiteSearch'|translate|e('js') }}'; +var keepURLFragmentSelectHTML = '{{ keepURLFragmentSelectHTML|e('js') }}'; + +var sitesManager = new SitesManager({{ timezones|raw }}, {{ currencies|raw }}, '{{ defaultTimezone|raw }}', '{{ defaultCurrency|raw }}'); +{% set searchKeywordLabel='SitesManager_SearchKeywordLabel'|translate %} +{% set searchCategoryLabel='SitesManager_SearchCategoryLabel'|translate %} +var searchKeywordLabel = '{{ searchKeywordLabel|e('js') }}'; +var searchCategoryLabel = '{{ searchCategoryLabel|e('js') }}'; +{% set sitesearchIntro='SitesManager_SiteSearchUse'|translate %} +var sitesearchIntro = '{{ piwik.inlineHelp(sitesearchIntro)|e('js') }}'; +var sitesearchUseDefault = '{% if isSuperUser %}{{ 'SitesManager_SearchUseDefault'|translate('<a href="#globalSiteSearch">','</a>')|e('js') }}{% else %}{{ 'SitesManager_SearchUseDefault'|translate('','')|e('js') }}{% endif %}'; +var strDefault = '{{ 'General_Default'|translate|e('js') }}'; + +$(document).ready(function () { + sitesManager.init(); +}); +</script> + +<style type="text/css"> + .entityTable tr td { + vertical-align: top; + padding-top: 7px; + } + + .addRowSite:hover, .editableSite:hover, .addsite:hover, .cancel:hover, .deleteSite:hover, .editSite:hover, .updateSite:hover { + cursor: pointer; + } + + .addRowSite a { + text-decoration: none; + } + + .addRowSite { + padding: 1em; + font-weight: bold; + } + + #editSites { + vertical-align: top; + } + + option, select { + font-size: 11px; + } + + textarea { + font-size: 9pt; + } + + .admin thead th { + vertical-align: middle; + } + + .ecommerceInactive, .sitesearchInactive { + color: #666666; + } + + #searchSiteParameters { + display: none; + } + + #editSites h4 { + font-size: .8em; + margin: 1em 0 1em 0; + font-weight: bold; + } +</style> + +<h2>{{ 'SitesManager_WebsitesManagement'|translate }}</h2> +<p>{{ 'SitesManager_MainDescription'|translate }} +{{ 'SitesManager_YouCurrentlyHaveAccessToNWebsites'|translate("<strong>" ~ adminSitesCount ~ "</strong>")|raw }} +{% if isSuperUser %} + <br/> + {{ 'SitesManager_SuperUserCan'|translate("<a href='#globalSettings'>","</a>")|raw }} +{% endif %} +</p> +{{ ajax.errorDiv() }} +{{ ajax.loadingDiv() }} + +{% set createNewWebsite %} +<div class="addRowSite"> + <img src='plugins/UsersManager/images/add.png' alt="Add Website" /> {{ 'SitesManager_AddSite'|translate }} +</div> +{% endset %} + +{% if adminSites|length == 0 %} + {{ 'SitesManager_NoWebsites'|translate }} +{% else %} +<div class="ui-confirm" id="confirm"> + <h2></h2> + <input role="yes" type="button" value="{{ 'General_Yes'|translate }}"/> + <input role="no" type="button" value="{{ 'General_No'|translate }}"/> +</div> +<div class="entityContainer"> + {% if isSuperUser %} + {{ createNewWebsite }} + {% endif %} + <table class="entityTable dataTable" id="editSites"> + <thead> + <tr> + <th>{{ 'General_Id'|translate }}</th> + <th>{{ 'General_Name'|translate }}</th> + <th>{{ 'SitesManager_Urls'|translate }}</th> + <th>{{ 'SitesManager_ExcludedIps'|translate }}</th> + <th>{{ 'SitesManager_ExcludedParameters'|translate|replace({" ":"<br />"}) }}</th> + <th id='exclude-user-agent-header' + {% if not allowSiteSpecificUserAgentExclude %}style="display:none"{% endif %}>{{ 'SitesManager_ExcludedUserAgents'|translate }}</th> + <th>{{ 'Actions_SubmenuSitesearch'|translate }}</th> + <th>{{ 'SitesManager_Timezone'|translate }}</th> + <th>{{ 'SitesManager_Currency'|translate }}</th> + <th>{{ 'Goals_Ecommerce'|translate }}</th> + <th></th> + <th></th> + <th>{{ 'SitesManager_JsTrackingTag'|translate}}</th> + </tr> + </thead> + <tbody> + {% for i,site in adminSites %} + <tr id="row{$site.idsite}" data-keep-url-fragments="{{ site.keep_url_fragment }}"> + <td id="idSite">{{ site.idsite }}</td> + <td id="siteName" class="editableSite">{{ site.name }}</td> + <td id="urls" class="editableSite"> + {% for url in site.alias_urls %}{{ url|replace({'http://': ''}) }}<br />{% endfor %} + </td> + <td id="excludedIps" class="editableSite"> + {% for ip in site.excluded_ips %}{{ ip }}<br/>{% endfor %} + </td> + <td id="excludedQueryParameters" class="editableSite"> + {% for parameter in site.excluded_parameters %}{{ parameter }}<br />{% endfor %} + </td> + <td id="excludedUserAgents" class="editableSite" {% if not allowSiteSpecificUserAgentExclude %}style="display:none"{% endif %}> + {% for ua in site.excluded_user_agent %}{{ ua }}<br />{% endfor %} + </td> + <td id="sitesearch" class="editableSite"> + {% if site.sitesearch %} + <span class='sitesearchActive'>{{ 'General_Yes'|translate }}</span> + {% else %} + <span class='sitesearchInactive'>-</span> + {% endif %} + <span class='sskp' sitesearch_keyword_parameters="{{ site.sitesearch_keyword_parameters }}"" + sitesearch_category_parameters="{{ site.sitesearch_category_parameters }}" + id="sitesearch_parameters"> + </span> + </td> + <td id="timezone" class="editableSite">{{ site.timezone }}</td> + <td id="currency" class="editableSite">{{ site.currency }}</td> + <td id="ecommerce" class="editableSite"> + {% if site.ecommerce %} + <span class='ecommerceActive'>{{ 'General_Yes'|translate }}</span> + {% else %} + <span class='ecommerceInactive'>-</span> + {% endif %} + </td> + <td> + <span id="row{{ site.idsite }}" class='editSite link_but'> + <img src='plugins/Zeitgeist/theme/images/ico_edit.png' title="{{ 'General_Edit'|translate }}" border="0"/> + {{ 'General_Edit'|translate }} + </span> + </td> + <td> + <span id="row{{ site.idsite }}" class="deleteSite link_but"> + <img src='plugins/Zeitgeist/theme/images/ico_delete.png' title="{{ 'General_Delete'|translate }}" border="0"/> + {{ 'General_Delete'|translate }} + </span> + </td> + <td> + <a href='{{ linkTo({'module':'CoreAdminHome','action':'trackingCodeGenerator','idSite':site.idsite,'updated':false }) }}'> + {{ 'SitesManager_ShowTrackingTag'|translate }} + </a> + </td> + </tr> + {% endfor %} + </tbody> + </table> + {% if isSuperUser %} + {{ createNewWebsite }} + {% endif %} +</div> +{% endif %} + + +{# Admin users use these values for Site Search column, when editing websites #} +{% if not isSuperUser %} +<input type="hidden" size="15" id="globalSearchKeywordParameters" + value="{{ globalSearchKeywordParameters }}"/> +<input type="hidden" size="15" id="globalSearchCategoryParameters" + value="{{ globalSearchCategoryParameters }}"/> +{% endif %} + +{% if isSuperUser %} +<br/> +<a name='globalSettings'></a> +<h2>{{ 'SitesManager_GlobalWebsitesSettings'|translate }}</h2> +<br/> +<table style='width:600px' class="adminTable"> + + <tr> + <td colspan="2"> + <strong>{{ 'SitesManager_GlobalListExcludedIps'|translate }}</strong> + + <p>{{ 'SitesManager_ListOfIpsToBeExcludedOnAllWebsites'|translate }} </p> + </td> + </tr> + <tr> + <td> + <textarea cols="30" rows="3" id="globalExcludedIps">{{ globalExcludedIps }} + </textarea> + </td> + <td> + <label for="globalExcludedIps">{{ excludedIpHelp }}</label> + </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> + <label for="globalExcludedQueryParameters">{{ excludedQueryParametersHelp }}</label> + </td> + </tr> + +{# global excluded user agents #} + <tr> + <td colspan="2"> + <strong>{{ 'SitesManager_GlobalListExcludedUserAgents'|translate }}</strong> + + <p>{{ 'SitesManager_GlobalListExcludedUserAgents_Desc'|translate }}</p> + </td> + </tr> + + <tr> + <td> + <textarea cols="30" rows="3" id="globalExcludedUserAgents">{{ globalExcludedUserAgents }}</textarea> + </td> + <td><label for="globalExcludedUserAgents">{{ excludedUserAgentsHelp }}</label> + </td> + </tr> + + <tr> + <td> + <input type="checkbox" id="enableSiteUserAgentExclude" name="enableSiteUserAgentExclude" + {% if allowSiteSpecificUserAgentExclude %}checked="checked"{% endif %}/> + <label for="enableSiteUserAgentExclude"> + {{ 'SitesManager_EnableSiteSpecificUserAgentExclude'|translate }} + </label> + <span id='enableSiteUserAgentExclude-loading' class='loadingPiwik' style='display:none'> + <img src='plugins/Zeitgeist/theme/images/loading-blue.gif'/> + </span> + </td> + <td> + {{ piwik.inlineHelp('SitesManager_EnableSiteSpecificUserAgentExclude_Help'|translate('<a href="#editSites">','</a>')) }} + </td> + </tr> + +{# global keep URL fragments #} + <tr> + <td colspan="2"> + <strong>{{ 'SitesManager_KeepURLFragments'|translate }}</strong> + + <p>{{ 'SitesManager_KeepURLFragmentsHelp'|translate("<em>#</em>","<em>example.org/index.html#first_section</em>","<em>example.org/index.html</em>")|raw }} + </p> + <input type="checkbox" id="globalKeepURLFragments" name="globalKeepURLFragments" + {% if globalKeepURLFragments %}checked="checked"{% endif %}/> + <label for="globalKeepURLFragments">{{ 'SitesManager_KeepURLFragmentsLong'|translate }}</label> + + <p>{{ 'SitesManager_KeepURLFragmentsHelp2'|translate }}</p> + </td> + </tr> + +{# global site search #} + <tr> + <td colspan="2"> + <a name='globalSiteSearch'></a><b>{{ 'SitesManager_TrackingSiteSearch'|translate }}</b> + + <p>{{ sitesearchIntro }}</p> + <span class="form-description" style='font-size:8pt'> + {{ 'SitesManager_SearchParametersNote'|translate }} {{ 'SitesManager_SearchParametersNote2'|translate }} + </span> + </td> + </tr> + <tr> + <td colspan="2"> + <label>{{ searchKeywordLabel }} + <input type="text" size="15" id="globalSearchKeywordParameters" value="{{ globalSearchKeywordParameters }}"/> + + <div style='width: 200px;float:right;'>{{ searchKeywordHelp }}</div> + </label> + </td> + </tr> + + <tr> + <td colspan="2"> + {% if not isSearchCategoryTrackingEnabled %} + <input value='globalSearchCategoryParametersIsDisabled' id="globalSearchCategoryParameters" type='hidden'/> + <span class='form-description'>Note: you could also track your Internal Search Engine Categories, but the plugin Custom Variables is required. Please enable the plugin CustomVariables (or ask your Piwik admin).</span> + {% else %} + {{ 'Goals_Optional'|translate }} {{ 'SitesManager_SearchCategoryDesc'|translate }} <br/> + </td> + </tr> + <tr> + <td colspan="2"> + <label>{{ searchCategoryLabel }} + <input type="text" size="15" id="globalSearchCategoryParameters" value="{{ globalSearchCategoryParameters }}"/> + + <div style='width: 200px;float:right;'>{{ searchCategoryHelp }}</div> + </label> + {% endif %} + </td> + </tr> + + <tr> + <td colspan="2"> + <strong>{{ 'SitesManager_DefaultTimezoneForNewWebsites'|translate }}</strong> + + <p>{{ 'SitesManager_SelectDefaultTimezone'|translate }} </p> + </td> + </tr> + <tr> + <td> + <div id='defaultTimezone'></div> + </td> + <td> + {{ defaultTimezoneHelp }} + </td> + </tr> + + <tr> + <td colspan="2"> + <strong>{{ 'SitesManager_DefaultCurrencyForNewWebsites'|translate }}</strong> + + <p>{{ 'SitesManager_SelectDefaultCurrency'|translate }}</p> + </td> + </tr> + <tr> + <td> + <div id='defaultCurrency'></div> + </td> + <td> + {{ currencyHelpPlain }} + </td> + </tr> +</table> +<span style="margin-left:20px"> + <input type="submit" class="submit" id='globalSettingsSubmit' value="{{ 'General_Save'|translate }}"/> +</span> + {{ ajax.errorDiv('ajaxErrorGlobalSettings') }} + {{ ajax.loadingDiv('ajaxLoadingGlobalSettings') }} +{% endif %} +{% if showAddSite %} +<script type="text/javascript"> +$(document).ready(function () { + $('.addRowSite:first').trigger('click'); +}); +</script> +{% endif %} + +<br/><br/><br/><br/> +{% endblock %} |