From 7d2941146aee67eb79d143e5de63acbd616837be Mon Sep 17 00:00:00 2001 From: Harrys Ravalomanana Date: Tue, 24 Mar 2020 17:38:39 +0400 Subject: [PATCH 1/5] PHRAS-2997- #comment add matomo script --- .../Form/Configuration/GeneralFormType.php | 6 ++++++ templates/mobile/common/index.html.twig | 1 + .../mobile/common/matomo_analytics.html.twig | 18 ++++++++++++++++++ templates/web/common/index_bootstrap.html.twig | 1 + templates/web/common/indexfloat.html.twig | 1 + .../web/common/matomo_analytics.html.twig | 18 ++++++++++++++++++ .../web/login/layout/base-layout.html.twig | 1 + 7 files changed, 46 insertions(+) create mode 100644 templates/mobile/common/matomo_analytics.html.twig create mode 100644 templates/web/common/matomo_analytics.html.twig diff --git a/lib/Alchemy/Phrasea/Form/Configuration/GeneralFormType.php b/lib/Alchemy/Phrasea/Form/Configuration/GeneralFormType.php index 5a1c6a645e..99526167d6 100644 --- a/lib/Alchemy/Phrasea/Form/Configuration/GeneralFormType.php +++ b/lib/Alchemy/Phrasea/Form/Configuration/GeneralFormType.php @@ -38,6 +38,12 @@ class GeneralFormType extends AbstractType $builder->add('analytics', 'text', [ 'label' => 'Google Analytics identifier', ]); + $builder->add('matomo-url', 'text', [ + 'label' => 'Matomo Analytics url', + ]); + $builder->add('matomo-id', 'text', [ + 'label' => 'Matomo Analytics identifier', + ]); $builder->add('allow-indexation', 'checkbox', [ 'label' => 'Allow the website to be indexed by search engines like Google', ]); diff --git a/templates/mobile/common/index.html.twig b/templates/mobile/common/index.html.twig index 32a08cc094..c5b68592da 100644 --- a/templates/mobile/common/index.html.twig +++ b/templates/mobile/common/index.html.twig @@ -24,5 +24,6 @@ {% block content %}{% endblock %} {% include 'common/analytics.html.twig' %} + {% include 'common/matomo_analytics.html.twig' %} diff --git a/templates/mobile/common/matomo_analytics.html.twig b/templates/mobile/common/matomo_analytics.html.twig new file mode 100644 index 0000000000..affad06a56 --- /dev/null +++ b/templates/mobile/common/matomo_analytics.html.twig @@ -0,0 +1,18 @@ +{% if app['conf'].get(['registry', 'general', 'matomo-url']) != '' %} +{% if app['conf'].get(['registry', 'general', 'matomo-id']) != '' %} + + + +{% endif %} +{% endif %} diff --git a/templates/web/common/index_bootstrap.html.twig b/templates/web/common/index_bootstrap.html.twig index 9b9f27a228..5c535b1767 100644 --- a/templates/web/common/index_bootstrap.html.twig +++ b/templates/web/common/index_bootstrap.html.twig @@ -42,5 +42,6 @@ {% block extra_content %}{% endblock %} {% block bodyJavascript %}{% endblock %} {% include 'common/analytics.html.twig' %} + {% include 'common/matomo_analytics.html.twig' %} diff --git a/templates/web/common/indexfloat.html.twig b/templates/web/common/indexfloat.html.twig index 8727aae954..a5f6aad392 100644 --- a/templates/web/common/indexfloat.html.twig +++ b/templates/web/common/indexfloat.html.twig @@ -25,5 +25,6 @@ {% include 'common/analytics.html.twig' %} + {% include 'common/mamoto_analytics.html.twig' %} diff --git a/templates/web/common/matomo_analytics.html.twig b/templates/web/common/matomo_analytics.html.twig new file mode 100644 index 0000000000..affad06a56 --- /dev/null +++ b/templates/web/common/matomo_analytics.html.twig @@ -0,0 +1,18 @@ +{% if app['conf'].get(['registry', 'general', 'matomo-url']) != '' %} +{% if app['conf'].get(['registry', 'general', 'matomo-id']) != '' %} + + + +{% endif %} +{% endif %} diff --git a/templates/web/login/layout/base-layout.html.twig b/templates/web/login/layout/base-layout.html.twig index 8d96cea003..155de6bd6e 100644 --- a/templates/web/login/layout/base-layout.html.twig +++ b/templates/web/login/layout/base-layout.html.twig @@ -100,6 +100,7 @@ {% endblock %} {% block analytics %} {% include 'common/analytics.html.twig' %} + {% include 'common/matomo_analytics.html.twig' %} {% endblock analytics %} {% block scripts %}{% endblock scripts %} From 8e03128544da227733437013276ab2d3c89c23f3 Mon Sep 17 00:00:00 2001 From: Harrys Ravalomanana Date: Tue, 24 Mar 2020 17:59:34 +0400 Subject: [PATCH 2/5] PHRAS-2997 --- .../Phrasea/Core/Configuration/RegistryFormManipulator.php | 2 ++ resources/hudson/_GV.php | 2 ++ 2 files changed, 4 insertions(+) diff --git a/lib/Alchemy/Phrasea/Core/Configuration/RegistryFormManipulator.php b/lib/Alchemy/Phrasea/Core/Configuration/RegistryFormManipulator.php index fbce72ccc7..78b91bb90e 100644 --- a/lib/Alchemy/Phrasea/Core/Configuration/RegistryFormManipulator.php +++ b/lib/Alchemy/Phrasea/Core/Configuration/RegistryFormManipulator.php @@ -102,6 +102,8 @@ class RegistryFormManipulator 'keywords' => null, 'description' => null, 'analytics' => null, + 'mamoto-url' => null, + 'mamoto-id' => null, 'allow-indexation' => true, 'home-presentation-mode' => 'GALLERIA', 'default-subdef-url-ttl' => 7200, diff --git a/resources/hudson/_GV.php b/resources/hudson/_GV.php index 284f4db6ba..7c95d79cdd 100644 --- a/resources/hudson/_GV.php +++ b/resources/hudson/_GV.php @@ -84,5 +84,7 @@ define('GV_homeTitle', 'SuperPhraseanet'); define('GV_metaKeywords', ''); define('GV_metaDescription', ''); define('GV_googleAnalytics', ''); +define('GV_matomoUrl', ''); +define('GV_matomoId', ''); define('GV_allow_search_engine', true); define('GV_display_gcf', true); From 49ce33ceefc2ada06a316aa418128128e254877c Mon Sep 17 00:00:00 2001 From: Harrys Ravalomanana Date: Tue, 24 Mar 2020 18:25:31 +0400 Subject: [PATCH 3/5] PHRAS-2997 Rename properties --- .../Core/Configuration/RegistryFormManipulator.php | 4 ++-- .../Phrasea/Form/Configuration/GeneralFormType.php | 4 ++-- templates/web/common/indexfloat.html.twig | 2 +- templates/web/common/matomo_analytics.html.twig | 8 ++++---- .../Configuration/Fixtures/configuration-with-hosts.yml | 2 ++ 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/lib/Alchemy/Phrasea/Core/Configuration/RegistryFormManipulator.php b/lib/Alchemy/Phrasea/Core/Configuration/RegistryFormManipulator.php index 78b91bb90e..9ebd69c829 100644 --- a/lib/Alchemy/Phrasea/Core/Configuration/RegistryFormManipulator.php +++ b/lib/Alchemy/Phrasea/Core/Configuration/RegistryFormManipulator.php @@ -102,8 +102,8 @@ class RegistryFormManipulator 'keywords' => null, 'description' => null, 'analytics' => null, - 'mamoto-url' => null, - 'mamoto-id' => null, + 'matomo-analytics-url' => null, + 'matomo-analytics-id' => null, 'allow-indexation' => true, 'home-presentation-mode' => 'GALLERIA', 'default-subdef-url-ttl' => 7200, diff --git a/lib/Alchemy/Phrasea/Form/Configuration/GeneralFormType.php b/lib/Alchemy/Phrasea/Form/Configuration/GeneralFormType.php index 99526167d6..767c91a782 100644 --- a/lib/Alchemy/Phrasea/Form/Configuration/GeneralFormType.php +++ b/lib/Alchemy/Phrasea/Form/Configuration/GeneralFormType.php @@ -38,10 +38,10 @@ class GeneralFormType extends AbstractType $builder->add('analytics', 'text', [ 'label' => 'Google Analytics identifier', ]); - $builder->add('matomo-url', 'text', [ + $builder->add('matomo-analytics-url', 'text', [ 'label' => 'Matomo Analytics url', ]); - $builder->add('matomo-id', 'text', [ + $builder->add('matomo-analytics-id', 'text', [ 'label' => 'Matomo Analytics identifier', ]); $builder->add('allow-indexation', 'checkbox', [ diff --git a/templates/web/common/indexfloat.html.twig b/templates/web/common/indexfloat.html.twig index a5f6aad392..25cbf79bc3 100644 --- a/templates/web/common/indexfloat.html.twig +++ b/templates/web/common/indexfloat.html.twig @@ -25,6 +25,6 @@ {% include 'common/analytics.html.twig' %} - {% include 'common/mamoto_analytics.html.twig' %} + {% include 'common/matomo_analytics.html.twig' %} diff --git a/templates/web/common/matomo_analytics.html.twig b/templates/web/common/matomo_analytics.html.twig index affad06a56..5c1e3251ac 100644 --- a/templates/web/common/matomo_analytics.html.twig +++ b/templates/web/common/matomo_analytics.html.twig @@ -1,14 +1,14 @@ -{% if app['conf'].get(['registry', 'general', 'matomo-url']) != '' %} -{% if app['conf'].get(['registry', 'general', 'matomo-id']) != '' %} +{% if app['conf'].get(['registry', 'general', 'matomo-analytics-url']) != '' %} +{% if app['conf'].get(['registry', 'general', 'matomo-analytics-id']) != '' %}