Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/PrivacyManager/PrivacyManager.php4
-rw-r--r--plugins/PrivacyManager/SystemSettings.php14
-rw-r--r--plugins/PrivacyManager/lang/en.json3
-rw-r--r--plugins/PrivacyManager/templates/footerLinks.twig2
-rw-r--r--tests/PHPUnit/System/expected/test_ImportLogs__CorePluginsAdmin.getSystemSettings.xml16
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__CorePluginsAdmin.getSystemSettings.xml16
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__CorePluginsAdmin.getSystemSettings.xml16
-rw-r--r--tests/PHPUnit/System/expected/test_noVisit__CorePluginsAdmin.getSystemSettings.xml16
8 files changed, 86 insertions, 1 deletions
diff --git a/plugins/PrivacyManager/PrivacyManager.php b/plugins/PrivacyManager/PrivacyManager.php
index 46bbc5d64d..f11ff26b43 100644
--- a/plugins/PrivacyManager/PrivacyManager.php
+++ b/plugins/PrivacyManager/PrivacyManager.php
@@ -716,14 +716,16 @@ class PrivacyManager extends Plugin
return;
}
+ $imprintUrl = $settings->imprintUrl->getValue();
$privacyPolicyUrl = $settings->privacyPolicyUrl->getValue();
$termsAndConditionUrl = $settings->termsAndConditionUrl->getValue();
- if (empty($privacyPolicyUrl) && empty($termsAndConditionUrl)) {
+ if (empty($imprintUrl) && empty($privacyPolicyUrl) && empty($termsAndConditionUrl)) {
return;
}
$view = new View('@PrivacyManager/footerLinks.twig');
+ $view->imprintUrl = $imprintUrl;
$view->privacyPolicyUrl = $privacyPolicyUrl;
$view->termsAndCondition = $termsAndConditionUrl;
$out .= $view->render();
diff --git a/plugins/PrivacyManager/SystemSettings.php b/plugins/PrivacyManager/SystemSettings.php
index d64a116d3a..611a3d2786 100644
--- a/plugins/PrivacyManager/SystemSettings.php
+++ b/plugins/PrivacyManager/SystemSettings.php
@@ -21,6 +21,9 @@ use Piwik\Settings\FieldConfig;
class SystemSettings extends \Piwik\Settings\Plugin\SystemSettings
{
/** @var SystemSetting */
+ public $imprintUrl;
+
+ /** @var SystemSetting */
public $privacyPolicyUrl;
/** @var SystemSetting */
@@ -31,11 +34,22 @@ class SystemSettings extends \Piwik\Settings\Plugin\SystemSettings
protected function init()
{
+ $this->imprintUrl = $this->createImprintUrlSetting();
$this->privacyPolicyUrl = $this->createPrivacyPolicyUrlSetting();
$this->termsAndConditionUrl = $this->createTermsAndConditionUrlSetting();
$this->showInEmbeddedWidgets = $this->createShowInEmbeddedWidgetsSetting();
}
+ private function createImprintUrlSetting(): SystemSetting
+ {
+ return $this->makeSetting('ImprintUrl', $default = '', FieldConfig::TYPE_STRING, function (FieldConfig $field) {
+ $field->title = Piwik::translate('PrivacyManager_ImprintUrl');
+ $field->uiControl = FieldConfig::UI_CONTROL_TEXT;
+ $field->description = Piwik::translate('PrivacyManager_ImprintUrlDescription') . ' ' .
+ Piwik::translate('PrivacyManager_PrivacyPolicyUrlDescriptionSuffix', ['anonymous']);
+ });
+ }
+
private function createPrivacyPolicyUrlSetting(): SystemSetting
{
return $this->makeSetting('privacyPolicyUrl', $default = '', FieldConfig::TYPE_STRING, function (FieldConfig $field) {
diff --git a/plugins/PrivacyManager/lang/en.json b/plugins/PrivacyManager/lang/en.json
index f54dea529b..751b44f3e0 100644
--- a/plugins/PrivacyManager/lang/en.json
+++ b/plugins/PrivacyManager/lang/en.json
@@ -173,6 +173,8 @@
"UseDeleteLog": "Regularly delete old raw data from the database",
"UseDeleteReports": "Regularly delete old reports from the database",
"UsersOptOut": "Users opt-out",
+ "ImprintUrl": "Imprint URL",
+ "ImprintUrlDescription": "A link to your Imprint page.",
"PrivacyPolicyUrl": "Privacy Policy URL",
"PrivacyPolicyUrlDescription": "A link to your Privacy Policy page.",
"TermsAndConditionUrl": "Terms & Conditions URL",
@@ -180,6 +182,7 @@
"PrivacyPolicyUrlDescriptionSuffix": "If you set this, it will be displayed at the bottom of the login page and on pages that the '%1$s' user can access.",
"ShowInEmbeddedWidgets": "Show in embedded widgets",
"ShowInEmbeddedWidgetsDescription": "If checked, a link to your Privacy Policy and your Terms & Conditions will be displayed at the bottom of embedded widgets.",
+ "Imprint": "Imprint",
"PrivacyPolicy": "Privacy Policy",
"TermsAndConditions": "Terms & Conditions"
}
diff --git a/plugins/PrivacyManager/templates/footerLinks.twig b/plugins/PrivacyManager/templates/footerLinks.twig
index 61425ebdb0..5754e4f97f 100644
--- a/plugins/PrivacyManager/templates/footerLinks.twig
+++ b/plugins/PrivacyManager/templates/footerLinks.twig
@@ -1,4 +1,6 @@
<div id="footerLinks">
+ {% if imprintUrl|default('') is not empty %}<a target="_blank" rel="noreferrer noopener" href="{{ imprintUrl|safelink|e('html_attr') }}">{{ 'PrivacyManager_Imprint'|translate }}</a>{% endif %}
+ {% if imprintUrl|default('') is not empty and (privacyPolicyUrl|default('') is not empty or termsAndCondition|default('') is not empty) %}|{% endif %}
{% if privacyPolicyUrl|default('') is not empty %}<a target="_blank" rel="noreferrer noopener" href="{{ privacyPolicyUrl|safelink|e('html_attr') }}">{{ 'PrivacyManager_PrivacyPolicy'|translate }}</a>{% endif %}
{% if privacyPolicyUrl|default('') is not empty and termsAndCondition|default('') is not empty %}|{% endif %}
{% if termsAndCondition|default('') is not empty %}<a target="_blank" rel="noreferrer noopener" href="{{ termsAndCondition|safelink|e('html_attr') }}">{{ 'PrivacyManager_TermsAndConditions'|translate }}</a>{% endif %}
diff --git a/tests/PHPUnit/System/expected/test_ImportLogs__CorePluginsAdmin.getSystemSettings.xml b/tests/PHPUnit/System/expected/test_ImportLogs__CorePluginsAdmin.getSystemSettings.xml
index 57c2419562..f15c78e785 100644
--- a/tests/PHPUnit/System/expected/test_ImportLogs__CorePluginsAdmin.getSystemSettings.xml
+++ b/tests/PHPUnit/System/expected/test_ImportLogs__CorePluginsAdmin.getSystemSettings.xml
@@ -357,6 +357,22 @@
<title>PrivacyManager</title>
<settings>
<row>
+ <name>imprintUrl</name>
+ <title>Imprint URL</title>
+ <value />
+ <defaultValue />
+ <type>string</type>
+ <uiControl>text</uiControl>
+ <uiControlAttributes>
+ </uiControlAttributes>
+ <availableValues />
+ <description>A link to your Imprint page. If you set this, it will be displayed at the bottom of the login page and on pages that the 'anonymous' user can access.</description>
+ <inlineHelp />
+ <templateFile />
+ <introduction />
+ <condition />
+ </row>
+ <row>
<name>privacyPolicyUrl</name>
<title>Privacy Policy URL</title>
<value />
diff --git a/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__CorePluginsAdmin.getSystemSettings.xml b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__CorePluginsAdmin.getSystemSettings.xml
index 645c6f1534..2ed020728b 100644
--- a/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__CorePluginsAdmin.getSystemSettings.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitorTwoVisits__CorePluginsAdmin.getSystemSettings.xml
@@ -319,6 +319,22 @@
<title>PrivacyManager</title>
<settings>
<row>
+ <name>imprintUrl</name>
+ <title>Imprint URL</title>
+ <value />
+ <defaultValue />
+ <type>string</type>
+ <uiControl>text</uiControl>
+ <uiControlAttributes>
+ </uiControlAttributes>
+ <availableValues />
+ <description>A link to your Imprint page. If you set this, it will be displayed at the bottom of the login page and on pages that the 'anonymous' user can access.</description>
+ <inlineHelp />
+ <templateFile />
+ <introduction />
+ <condition />
+ </row>
+ <row>
<name>privacyPolicyUrl</name>
<title>Privacy Policy URL</title>
<value />
diff --git a/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__CorePluginsAdmin.getSystemSettings.xml b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__CorePluginsAdmin.getSystemSettings.xml
index 57c2419562..f15c78e785 100644
--- a/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__CorePluginsAdmin.getSystemSettings.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit_PeriodIsLast__CorePluginsAdmin.getSystemSettings.xml
@@ -357,6 +357,22 @@
<title>PrivacyManager</title>
<settings>
<row>
+ <name>imprintUrl</name>
+ <title>Imprint URL</title>
+ <value />
+ <defaultValue />
+ <type>string</type>
+ <uiControl>text</uiControl>
+ <uiControlAttributes>
+ </uiControlAttributes>
+ <availableValues />
+ <description>A link to your Imprint page. If you set this, it will be displayed at the bottom of the login page and on pages that the 'anonymous' user can access.</description>
+ <inlineHelp />
+ <templateFile />
+ <introduction />
+ <condition />
+ </row>
+ <row>
<name>privacyPolicyUrl</name>
<title>Privacy Policy URL</title>
<value />
diff --git a/tests/PHPUnit/System/expected/test_noVisit__CorePluginsAdmin.getSystemSettings.xml b/tests/PHPUnit/System/expected/test_noVisit__CorePluginsAdmin.getSystemSettings.xml
index 57c2419562..f15c78e785 100644
--- a/tests/PHPUnit/System/expected/test_noVisit__CorePluginsAdmin.getSystemSettings.xml
+++ b/tests/PHPUnit/System/expected/test_noVisit__CorePluginsAdmin.getSystemSettings.xml
@@ -357,6 +357,22 @@
<title>PrivacyManager</title>
<settings>
<row>
+ <name>imprintUrl</name>
+ <title>Imprint URL</title>
+ <value />
+ <defaultValue />
+ <type>string</type>
+ <uiControl>text</uiControl>
+ <uiControlAttributes>
+ </uiControlAttributes>
+ <availableValues />
+ <description>A link to your Imprint page. If you set this, it will be displayed at the bottom of the login page and on pages that the 'anonymous' user can access.</description>
+ <inlineHelp />
+ <templateFile />
+ <introduction />
+ <condition />
+ </row>
+ <row>
<name>privacyPolicyUrl</name>
<title>Privacy Policy URL</title>
<value />