Skip to content

Commit 67a60a2

Browse files
committed
Review:
- Cube707#1 (review) Signed-off-by: Zorglube <630192+zorglube@users.noreply.github.com>
1 parent 407b726 commit 67a60a2

3 files changed

Lines changed: 128 additions & 3 deletions

File tree

event/listener.php

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,10 @@ public function __construct(config $config, language $language, template $templa
6060
public static function getSubscribedEvents()
6161
{
6262
return [
63-
'core.acp_board_config_edit_add' => 'add_matomoanalytics_configs',
64-
'core.page_header' => 'load_matomoanalytics',
65-
'core.validate_config_variable' => 'validate_matomoanalytics_url',
63+
'core.page_header' => 'load_matomoanalytics',
64+
'core.acp_board_config_edit_add' => 'add_matomoanalytics_configs',
65+
'core.validate_config_variable' => 'validate_matomoanalytics_url',
66+
'core.page_footer_after' => 'append_agreement',
6667
];
6768
}
6869

@@ -159,4 +160,24 @@ public function validate_matomoanalytics_url($event)
159160
// Update error event data
160161
$event['error'] = $error;
161162
}
163+
164+
/**
165+
* Append additional agreement details to the privacy agreement.
166+
*
167+
* @return void
168+
*/
169+
public function append_agreement()
170+
{
171+
if (!$this->config['googleanalytics_id']
172+
|| (strpos($this->user->page['page_name'], 'ucp') !== 0)
173+
|| !$this->template->retrieve_var('S_AGREEMENT')
174+
|| ($this->template->retrieve_var('AGREEMENT_TITLE') !== $this->language->lang('PRIVACY')))
175+
{
176+
return;
177+
}
178+
179+
$this->language->add_lang('googleanalytics_ucp', 'cube/matomoanalytics');
180+
181+
$this->template->append_var('AGREEMENT_TEXT', $this->language->lang('PHPBB_ANALYTICS_PRIVACY_POLICY', $this->config['sitename']));
182+
}
162183
}
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<?php
2+
/**
3+
*
4+
* Matomo Analytics extension for the phpBB Forum Software package.
5+
*
6+
* @copyright (c) 2014 phpBB Limited <https://www.phpbb.com>
7+
* @license GNU General Public License, version 2 (GPL-2.0)
8+
*
9+
*/
10+
11+
/**
12+
* DO NOT CHANGE
13+
*/
14+
if (!defined('IN_PHPBB'))
15+
{
16+
exit;
17+
}
18+
19+
if (empty($lang) || !is_array($lang))
20+
{
21+
$lang = [];
22+
}
23+
24+
// DEVELOPERS PLEASE NOTE
25+
//
26+
// All language files should use UTF-8 as their encoding and the files must not contain a BOM.
27+
//
28+
// Placeholders can now contain order information, e.g. instead of
29+
// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
30+
// translators to re-order the output of data while ensuring it remains correct
31+
//
32+
// You do not need this where single placeholders are used, e.g. 'Message %d' is fine
33+
// equally where a string contains only two placeholders which are used to wrap text
34+
// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine
35+
//
36+
// Some characters you may want to copy&paste:
37+
// ’ » “ ” …
38+
//
39+
40+
$lang = array_merge($lang, [
41+
'PHPBB_ANALYTICS_PRIVACY_POLICY' => '
42+
<br><br>
43+
<h3>Analytics</h3>
44+
“%1$s” may use MAtomo Analytics, a web analytics service provided by InnoCraft Limited (InnoCraft, we), to help us understand how visitors use the site. Matomo uses cookies and similar technologies to collect information about your interactions with the site, including the pages you visit, the time spent on each page, and general usage patterns.
45+
<br><br>
46+
The information generated by these cookies about your use of “%1$s” (may include your IP address) is transmitted to and stored on the Matomo deployement solution choosed by the website owned (might be on premise, or into cloud solution). The website owner uses this information to evaluate your use of the site, compile reports on website activity, the uses of thoses infornation is decided by the website owner.
47+
<br><br>
48+
Thoses informations may be transfer to a third parties. To learn more about how the statistics informations are used, contact the website owner.
49+
<br><br>
50+
If you want to opt out of the statistics collection <div id="matomo-opt-out"></div><script src="%1$s/index.php?module=CoreAdminHome&action=optOutJS&div=matomo-opt-out></script>.
51+
',
52+
]);
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<?php
2+
/**
3+
*
4+
* Matomo Analytics extension for the phpBB Forum Software package.
5+
*
6+
* @copyright (c) 2014 phpBB Limited <https://www.phpbb.com>
7+
* @license GNU General Public License, version 2 (GPL-2.0)
8+
*
9+
*/
10+
11+
/**
12+
* DO NOT CHANGE
13+
*/
14+
if (!defined('IN_PHPBB'))
15+
{
16+
exit;
17+
}
18+
19+
if (empty($lang) || !is_array($lang))
20+
{
21+
$lang = [];
22+
}
23+
24+
// DEVELOPERS PLEASE NOTE
25+
//
26+
// All language files should use UTF-8 as their encoding and the files must not contain a BOM.
27+
//
28+
// Placeholders can now contain order information, e.g. instead of
29+
// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
30+
// translators to re-order the output of data while ensuring it remains correct
31+
//
32+
// You do not need this where single placeholders are used, e.g. 'Message %d' is fine
33+
// equally where a string contains only two placeholders which are used to wrap text
34+
// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine
35+
//
36+
// Some characters you may want to copy&paste:
37+
// ’ » “ ” …
38+
//
39+
40+
$lang = array_merge($lang, [
41+
'PHPBB_ANALYTICS_PRIVACY_POLICY' => '
42+
<br><br>
43+
<h3>Analytics</h3>
44+
“%1$s” may use MAtomo Analytics, a web analytics service provided by InnoCraft Limited (InnoCraft, we), to help us understand how visitors use the site. Matomo uses cookies and similar technologies to collect information about your interactions with the site, including the pages you visit, the time spent on each page, and general usage patterns.
45+
<br><br>
46+
The information generated by these cookies about your use of “%1$s” (may include your IP address) is transmitted to and stored on the Matomo deployement solution choosed by the website owned (might be on premise, or into cloud solution). The website owner uses this information to evaluate your use of the site, compile reports on website activity, the uses of thoses infornation is decided by the website owner.
47+
<br><br>
48+
Thoses informations may be transfer to a third parties. To learn more about how the statistics informations are used, contact the website owner.
49+
<br><br>
50+
If you want to opt out of the statistics collection <div id="matomo-opt-out"></div><script src="%1$s/index.php?module=CoreAdminHome&action=optOutJS&div=matomo-opt-out></script>.
51+
',
52+
]);

0 commit comments

Comments
 (0)