Skip to content

Commit

Permalink
fix: update matomo script
Browse files Browse the repository at this point in the history
  • Loading branch information
kalamun committed Dec 14, 2021
1 parent d412c97 commit 8bb5a4f
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 17 deletions.
6 changes: 5 additions & 1 deletion Piwik/classes/class.ilPiwikConfigGUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,11 @@ public function save()

if ($form->checkInput())
{
$plugin->setPiwikSiteId($_POST["piwik_site_id"]);
$_POST["piwik_host"] = str_replace("https://", "", $_POST["piwik_host"]);
$_POST["piwik_host"] = str_replace("http://", "", $_POST["piwik_host"]);
$_POST["piwik_host"] = trim($_POST["piwik_host"], "/");

$plugin->setPiwikSiteId(intval($_POST["piwik_site_id"]));
$plugin->setPiwikHost($_POST["piwik_host"]);

ilUtil::sendSuccess($lng->txt("saved_successfully"), true);
Expand Down
2 changes: 1 addition & 1 deletion Piwik/lang/ilias_de.lang
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ warning_no_site_id_or_url#:#Eine Url zu einer Piwik Installation und eine Seiten
piwik_site_id#:#Seiten ID
piwik_site_id_info#:#Seiten ID, wie sie in den Piwik Einstellungen angezeigt wird.
piwik_url_http#:#Piwik URL HTTP
piwik_url_http_info#:#Adresse zur Piwik Installation, (je nach Piwik Installation z.B. http://www.example.com/piwik/ oder http://piwik.example.com)
piwik_url_http_info#:#Adresse zur Piwik Installation, (je nach Piwik Installation z.B. www.example.com/piwik oder piwik.example.com)
piwik_url_https#:#Piwik URL HTTPs
piwik_url_https_info#:#Adresse zur Piwik Installation wenn SSL genutzt werden soll
2 changes: 1 addition & 1 deletion Piwik/lang/ilias_en.lang
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ warning_no_site_id_or_url#:#A valid url to a piwik installation, and a site id i
piwik_site_id#:#Site ID
piwik_site_id_info#:#Site ID, as shown in piwik settings
piwik_host#:#Piwik URL HTTP
piwik_host_info#:#Address to your piwik installation, (for example: http://www.example.com/piwik/ or http://piwik.example.com)
piwik_host_info#:#Address to your piwik installation, (for example: www.example.com/piwik or piwik.example.com)
piwik_host_https#:#Piwik URL HTTPS
piwik_host_https_info#:#Address to your piwik installation when using SSL
2 changes: 1 addition & 1 deletion Piwik/lang/ilias_fr.lang
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ warning_no_site_id_or_url#:#Une URL valide vers une installation piwik et un ide
piwik_site_id#:#ID du site
piwik_site_id_info#:#Identifiant du site, comme indiqué dans les paramètres de piwik
piwik_host#:#URL Piwik HTTP
piwik_host_info#:#Adresse à votre installation piwik, (par exemple : http://www.example.com/piwik/ ou http://piwik.example.com)
piwik_host_info#:#Adresse à votre installation piwik, (par exemple : www.example.com/piwik ou piwik.example.com)
piwik_host_https#:#URL Piwik HTTPS
piwik_host_https_info#:#Adresse à votre installation piwik lors de l'utilisation de SSL
2 changes: 1 addition & 1 deletion Piwik/lang/ilias_it.lang
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ warning_no_site_id_or_url#:#Un indirizzo valido verso l’installazione piwik e
piwik_site_id#:#ID del sito
piwik_site_id_info#:#ID del sito, come mostrato nelle impostazioni piwik
piwik_host#:#URL Piwik HTTP
piwik_host_info#:#L’indirizzo della tua installazione piwik, (ad esempio: http://www.example.com/piwik/ o http://piwik.example.com)
piwik_host_info#:#L’indirizzo della tua installazione piwik, (ad esempio: www.example.com/piwik o piwik.example.com)
piwik_host_https#:#URL Piwik HTTPS
piwik_host_https_info#:#L’indirizo alla tua installazione piwik quando SSL è in uso
4 changes: 2 additions & 2 deletions Piwik/plugin.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
$id = "piwik";
$id = "matomo";
$version = "1.1.00";
$ilias_min_version = "5.0.0";
$ilias_min_version = "6.0.0";
$ilias_max_version = "6.13.999";
$responsible = "Roberto Pasini";
$responsible_mail = "[email protected]";
22 changes: 12 additions & 10 deletions Piwik/templates/tpl.piwik_tracking.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
<!-- Matomo -->
<script type="text/javascript">
var _paq = _paq || [];
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="//{PIWIK_HOST}/";
_paq.push(['setTrackerUrl', u+'piwik.php']);
_paq.push(['setSiteId', {PIWIK_SITE_ID}]);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
})();
var _paq = window._paq || [];
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="//{PIWIK_HOST}/";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', '{PIWIK_SITE_ID}']);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
})();
</script>
<!-- End Matomo Code -->

0 comments on commit 8bb5a4f

Please sign in to comment.