diff --git a/cache/.gitkeep b/cache/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/lib/Alchemy/Phrasea/Core/Configuration/RegistryFormManipulator.php b/lib/Alchemy/Phrasea/Core/Configuration/RegistryFormManipulator.php index fbce72ccc7..9ebd69c829 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, + '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 5a1c6a645e..767c91a782 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-analytics-url', 'text', [ + 'label' => 'Matomo Analytics url', + ]); + $builder->add('matomo-analytics-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/resources/hudson/_GV.php b/resources/hudson/_GV.php index 284f4db6ba..808768544e 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_matomoAnalyticsUrl', ''); +define('GV_matomoAnalyticsId', ''); define('GV_allow_search_engine', true); define('GV_display_gcf', true); 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..5c1e3251ac --- /dev/null +++ b/templates/mobile/common/matomo_analytics.html.twig @@ -0,0 +1,18 @@ +{% if app['conf'].get(['registry', 'general', 'matomo-analytics-url']) != '' %} +{% if app['conf'].get(['registry', 'general', 'matomo-analytics-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..25cbf79bc3 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/matomo_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..a44d0308a8 --- /dev/null +++ b/templates/web/common/matomo_analytics.html.twig @@ -0,0 +1,18 @@ +{% if app['conf'].get(['registry', 'general', 'matomo-analytics-url']) != '' %} +{% if app['conf'].get(['registry', 'general', 'matomo-analytics-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 %} diff --git a/tests/Alchemy/Tests/Phrasea/Core/Configuration/Fixtures/configuration-with-hosts.yml b/tests/Alchemy/Tests/Phrasea/Core/Configuration/Fixtures/configuration-with-hosts.yml index 8e0b322dce..adcc5c8165 100644 --- a/tests/Alchemy/Tests/Phrasea/Core/Configuration/Fixtures/configuration-with-hosts.yml +++ b/tests/Alchemy/Tests/Phrasea/Core/Configuration/Fixtures/configuration-with-hosts.yml @@ -193,6 +193,8 @@ registry: keywords: '' description: '' analytics: '' + matomo-analytics-url: '' + matomo-analytics-id: '' allow-indexation: true home-presentation-mode: COOLIRIS modules: