... | ... |
@@ -14,20 +14,22 @@ |
14 | 14 |
$GLOBALS['TL_DCA']['tl_page']['palettes']['__selector__'][] = 'cookieconsent_enable'; |
15 | 15 |
$GLOBALS['TL_DCA']['tl_page']['palettes']['root'] .= ';{cookieconsent_legend},cookieconsent_enable'; |
16 | 16 |
|
17 |
-$GLOBALS['TL_DCA']['tl_page']['subpalettes']['cookieconsent_enable'] = 'cookieconsent_link,cookieconsent_services'; |
|
17 |
+$GLOBALS['TL_DCA']['tl_page']['subpalettes']['cookieconsent_enable'] = 'cookieconsent_link,cookieconsent_services,cookieconsent_categories_custom,cookieconsent_services_custom'; |
|
18 | 18 |
|
19 | 19 |
/* |
20 | 20 |
* Add the fields |
21 | 21 |
*/ |
22 |
-$GLOBALS['TL_DCA']['tl_page']['fields']['cookieconsent_enable'] = [ |
|
22 |
+$GLOBALS['TL_DCA']['tl_page']['fields']['cookieconsent_enable'] = array |
|
23 |
+( |
|
23 | 24 |
'label' => &$GLOBALS['TL_LANG']['tl_page']['cookieconsent_enable'], |
24 | 25 |
'exclude' => true, |
25 | 26 |
'inputType' => 'checkbox', |
26 | 27 |
'eval' => array('submitOnChange' => true, 'tl_class' => 'clr'), |
27 | 28 |
'sql' => "char(1) NOT NULL default ''", |
28 |
-]; |
|
29 |
+); |
|
29 | 30 |
|
30 |
-$GLOBALS['TL_DCA']['tl_page']['fields']['cookieconsent_link'] = [ |
|
31 |
+$GLOBALS['TL_DCA']['tl_page']['fields']['cookieconsent_link'] = array |
|
32 |
+( |
|
31 | 33 |
'label' => &$GLOBALS['TL_LANG']['tl_page']['cookieconsent_link'], |
32 | 34 |
'exclude' => true, |
33 | 35 |
'search' => true, |
... | ... |
@@ -38,16 +40,35 @@ $GLOBALS['TL_DCA']['tl_page']['fields']['cookieconsent_link'] = [ |
38 | 40 |
array('tl_content_cookieconsent', 'pagePicker') |
39 | 41 |
), |
40 | 42 |
'sql'=> "varchar(255) NOT NULL default ''" |
41 |
-]; |
|
43 |
+); |
|
42 | 44 |
|
43 |
-$GLOBALS['TL_DCA']['tl_page']['fields']['cookieconsent_services'] = [ |
|
45 |
+$GLOBALS['TL_DCA']['tl_page']['fields']['cookieconsent_services'] = array |
|
46 |
+( |
|
44 | 47 |
'label' => &$GLOBALS['TL_LANG']['tl_page']['cookieconsent_services'], |
45 | 48 |
'exclude' => true, |
46 | 49 |
'inputType' => 'checkbox', |
47 | 50 |
'options' => array('analytics','matomo'), |
48 | 51 |
'eval' => array('multiple'=>true, 'tl_class' => 'clr'), |
49 | 52 |
'sql' => "blob NULL", |
50 |
-]; |
|
53 |
+); |
|
54 |
+ |
|
55 |
+$GLOBALS['TL_DCA']['tl_page']['fields']['cookieconsent_categories_custom'] = array |
|
56 |
+( |
|
57 |
+ 'label' => &$GLOBALS['TL_LANG']['tl_page']['cookieconsent_services_custom'], |
|
58 |
+ 'exclude' => true, |
|
59 |
+ 'inputType' => 'textarea', |
|
60 |
+ 'eval' => array('allowHtml'=>true, 'class'=>'monospace', 'rte'=>'ace|javascript', 'tl_class'=>'clr'), |
|
61 |
+ 'sql'=> "mediumtext NULL" |
|
62 |
+); |
|
63 |
+ |
|
64 |
+$GLOBALS['TL_DCA']['tl_page']['fields']['cookieconsent_services_custom'] = array |
|
65 |
+( |
|
66 |
+ 'label' => &$GLOBALS['TL_LANG']['tl_page']['cookieconsent_services_custom'], |
|
67 |
+ 'exclude' => true, |
|
68 |
+ 'inputType' => 'textarea', |
|
69 |
+ 'eval' => array('allowHtml'=>true, 'class'=>'monospace', 'rte'=>'ace|javascript', 'tl_class'=>'clr'), |
|
70 |
+ 'sql'=> "mediumtext NULL" |
|
71 |
+); |
|
51 | 72 |
|
52 | 73 |
class tl_content_cookieconsent extends Backend |
53 | 74 |
{ |
... | ... |
@@ -14,6 +14,8 @@ |
14 | 14 |
$GLOBALS['TL_LANG']['tl_page']['cookieconsent_enable'] = array('Cookie-Einwilligung aktivieren', 'Die Cookie-Einwilligung auf der Webseite anzeigen.'); |
15 | 15 |
$GLOBALS['TL_LANG']['tl_page']['cookieconsent_link'] = array('Link zur Datenschutzerklärung', 'Hier können Sie einen Link zur Datenschutzerklärung angeben'); |
16 | 16 |
$GLOBALS['TL_LANG']['tl_page']['cookieconsent_services'] = array('Geblockte Dienste', 'Wählen Sie aus, welche Dienste sie blocken möchten und die der User mit einer Einwilligung freischalten kann.'); |
17 |
+$GLOBALS['TL_LANG']['tl_page']['cookieconsent_services_custom'] = array('Weitere Dienste', 'Hier können Sie weitere Dienste als Javascript-Objekt konfigurieren.'); |
|
18 |
+$GLOBALS['TL_LANG']['tl_page']['cookieconsent_categories_custom'] = array('Weitere Kategorien', 'Hier können Sie weitere Kategorien als Javascript-Objekt konfigurieren.'); |
|
17 | 19 |
|
18 | 20 |
/* |
19 | 21 |
* Legends |
... | ... |
@@ -14,6 +14,8 @@ |
14 | 14 |
$GLOBALS['TL_LANG']['tl_page']['cookieconsent_enable'] = array('Enable cookie consent', 'Show the cookie consent bar on the website.'); |
15 | 15 |
$GLOBALS['TL_LANG']['tl_page']['cookieconsent_link'] = array('Link to privacy policy', 'Here you can provide a link to the privacy policy.'); |
16 | 16 |
$GLOBALS['TL_LANG']['tl_page']['cookieconsent_services'] = array('Blocked services', 'Select which services you want to block and which the user can unlock with a consent.'); |
17 |
+$GLOBALS['TL_LANG']['tl_page']['cookieconsent_services_custom'] = array('Custom services', 'Here you can configure additional services as Javascript objects.'); |
|
18 |
+$GLOBALS['TL_LANG']['tl_page']['cookieconsent_categories_custom'] = array('Weitere Kategorien', 'Here you can configure additional categories as Javascript objects.'); |
|
17 | 19 |
|
18 | 20 |
/* |
19 | 21 |
* Legends |
... | ... |
@@ -18,6 +18,8 @@ class TemplateListener |
18 | 18 |
{ |
19 | 19 |
$Template = new \FrontendTemplate('cookieconsent'); |
20 | 20 |
$arrServices = deserialize($rootPage->cookieconsent_services); |
21 |
+ $strCustomCategories = ''; |
|
22 |
+ $strServices = ''; |
|
21 | 23 |
|
22 | 24 |
$arrServiceConfiguration = array(); |
23 | 25 |
|
... | ... |
@@ -70,9 +72,21 @@ class TemplateListener |
70 | 72 |
), |
71 | 73 |
); |
72 | 74 |
} |
73 |
- $Template->services = json_encode($arrServiceConfiguration); |
|
75 |
+ $strServices = json_encode($arrServiceConfiguration); |
|
74 | 76 |
} |
75 | 77 |
|
78 |
+ if ($strServices != '') |
|
79 |
+ { |
|
80 |
+ $strServices .= trim($rootPage->cookieconsent_services_custom,"\t\n\r\0\x0B ,"); |
|
81 |
+ } |
|
82 |
+ |
|
83 |
+ if (($strCustomCategories = trim($rootPage->cookieconsent_categories_custom,"\t\n\r\0\x0B ,")) != '') |
|
84 |
+ { |
|
85 |
+ $strCustomCategories = ",".$strCustomCategories; |
|
86 |
+ } |
|
87 |
+ |
|
88 |
+ $Template->custom_categories = $strCustomCategories; |
|
89 |
+ $Template->services = $strServices; |
|
76 | 90 |
$Template->privacy_policy_link = $rootPage->cookieconsent_link != '' ? "'".$rootPage->cookieconsent_link."'" : "null"; |
77 | 91 |
|
78 | 92 |
if (strpos($strBuffer, '<head>')) |
... | ... |
@@ -1,102 +1,109 @@ |
1 | 1 |
<script> |
2 | 2 |
window.CookieConsent.init({ |
3 |
- // More link URL on bar |
|
4 |
- modalMainTextMoreLink: <?= $this->privacy_policy_link ?>, |
|
5 |
- // How lond to wait until bar comes up |
|
6 |
- barTimeout: 1000, |
|
7 |
- // Look and feel |
|
8 |
- theme: { |
|
9 |
- barColor: '#2C7CBF', |
|
10 |
- barTextColor: '#FFF', |
|
11 |
- barMainButtonColor: '#FFF', |
|
12 |
- barMainButtonTextColor: '#2C7CBF', |
|
13 |
- modalMainButtonColor: '#4285F4', |
|
14 |
- modalMainButtonTextColor: '#FFF', |
|
15 |
- }, |
|
16 |
- language: { |
|
17 |
- // Current language |
|
18 |
- current: '{{iflng::de}}de{{iflng}}{{ifnlng::de}}en{{ifnlng}}', |
|
19 |
- locale: { |
|
20 |
- de: { |
|
21 |
- barMainText: 'Diese Webseite nutzt teilweise Cookies um Ihnen das bestmögliche Besuchererlebnis zu ermöglichen. Wir verwenden auch Cookies von Drittanbietern um unsere Seitennutzung zu analysieren und zu verbessern. Genaue Infos über die verwendeten Tools und die Nutzung der Daten erhalten Sie in unserer Datenschutzerklärung. Sie können der Nutzung von Cookies, die nicht zwingend für die Funktion der Webseite erforderlich sind widersprechen.', |
|
22 |
- barLinkSetting: 'Cookie-Einstellungen', |
|
23 |
- barBtnAcceptAll: 'Alle Cookies akzeptieren', |
|
24 |
- modalMainTitle: 'Cookie-Einstellungen', |
|
25 |
- modalMainText: 'Cookies sind kleine Datenspeicher, die von einer Website gesendet und von Ihrem Webbrowser während des Besuchs auf Ihrem Computer gespeichert werden. Ihr Browser speichert diese Informationen in einer kleinen Datei, dem sogenannten Cookie. Wenn Sie eine andere Seite vom Server anfordern, sendet Ihr Browser das Cookie an den Server zurück. Cookies wurden als zuverlässiger Mechanismus für Websites entwickelt, um Informationen zu speichern oder die Browseraktivitäten des Benutzers aufzuzeichnen.', |
|
26 |
- modalBtnSave: 'Einstellungen speichern', |
|
27 |
- modalBtnAcceptAll: 'Alle Cookies akzeptieren und schließen', |
|
28 |
- modalAffectedSolutions: 'Betroffene Services:', |
|
29 |
- learnMore: 'Mehr dazu', |
|
30 |
- on: 'Ein', |
|
31 |
- off: 'Aus', |
|
32 |
- }, |
|
33 |
- en: { |
|
34 |
- barMainText: 'This website uses cookies to provide you with the best possible visitor experience. We also use third party cookies to analyze and improve our site usage. You can find out more about the tools we use and how we use them in our privacy policy. You may refuse the use of cookies, which are not required for the functionality of this website.', |
|
35 |
- barLinkSetting: 'Cookie Settings', |
|
36 |
- barBtnAcceptAll: 'Accept all cookies', |
|
37 |
- modalMainTitle: 'Cookie settings', |
|
38 |
- modalMainText: 'Cookies are small data pieces that are sent by a website and stored on your computer by your web browser during your visit. Your browser stores this information in a small file called a cookie. If you request another page from the server, your browser sends the cookie back to the server. Cookies have been developed as a reliable mechanism for websites to store information or record user browser activity.', |
|
39 |
- modalBtnSave: 'Save current settings', |
|
40 |
- modalBtnAcceptAll: 'Accept all cookies and close', |
|
41 |
- modalAffectedSolutions: 'Affected solutions:', |
|
42 |
- learnMore: 'Learn More', |
|
43 |
- on: 'On', |
|
44 |
- off: 'Off', |
|
45 |
- } |
|
46 |
- } |
|
47 |
- }, |
|
48 |
- // List all the categories you want to display |
|
49 |
- categories: { |
|
50 |
- // Unique name |
|
51 |
- // This probably will be the default category |
|
52 |
- necessary: { |
|
53 |
- // The cookies here are necessary and category cant be turned off. |
|
54 |
- // Wanted config value will be ignored. |
|
55 |
- needed: true, |
|
56 |
- // The cookies in this category will be let trough. |
|
57 |
- // This probably should be false if not necessary category |
|
58 |
- wanted: true, |
|
59 |
- // If the checkbox is on or off at first run. |
|
60 |
- checked: true, |
|
61 |
- // Language settings for categories |
|
62 |
- language: { |
|
3 |
+ <?php $this->block('config'); ?> |
|
4 |
+ // More link URL on bar |
|
5 |
+ modalMainTextMoreLink: <?= $this->privacy_policy_link ?>, |
|
6 |
+ // How lond to wait until bar comes up |
|
7 |
+ barTimeout: 1000, |
|
8 |
+ // Look and feel |
|
9 |
+ theme: { |
|
10 |
+ <?php $this->block('theme'); ?> |
|
11 |
+ barColor: '#2C7CBF', |
|
12 |
+ barTextColor: '#FFF', |
|
13 |
+ barMainButtonColor: '#FFF', |
|
14 |
+ barMainButtonTextColor: '#2C7CBF', |
|
15 |
+ modalMainButtonColor: '#4285F4', |
|
16 |
+ modalMainButtonTextColor: '#FFF', |
|
17 |
+ <?php $this->endblock(); ?> |
|
18 |
+ }, |
|
19 |
+ language: { |
|
20 |
+ <?php $this->block('language'); ?> |
|
21 |
+ // Current language |
|
22 |
+ current: '{{iflng::de}}de{{iflng}}{{ifnlng::de}}en{{ifnlng}}', |
|
63 | 23 |
locale: { |
64 | 24 |
de: { |
65 |
- name: 'Unbedingt erforderliche Cookies', |
|
66 |
- description: 'Diese Cookies sind für die vollständige Funktion der Webseite erforderlich. Diese Cookies werden ausschließlich für die Funktion der Webseite verwendet. In der Regel werden diese Cookies nach dem Schließen Ihres Browsers gelöscht.', |
|
25 |
+ barMainText: 'Diese Webseite nutzt teilweise Cookies um Ihnen das bestmögliche Besuchererlebnis zu ermöglichen. Wir verwenden auch Cookies von Drittanbietern um unsere Seitennutzung zu analysieren und zu verbessern. Genaue Infos über die verwendeten Tools und die Nutzung der Daten erhalten Sie in unserer Datenschutzerklärung. Sie können der Nutzung von Cookies, die nicht zwingend für die Funktion der Webseite erforderlich sind widersprechen.', |
|
26 |
+ barLinkSetting: 'Cookie-Einstellungen', |
|
27 |
+ barBtnAcceptAll: 'Alle Cookies akzeptieren', |
|
28 |
+ modalMainTitle: 'Cookie-Einstellungen', |
|
29 |
+ modalMainText: 'Cookies sind kleine Datenspeicher, die von einer Website gesendet und von Ihrem Webbrowser während des Besuchs auf Ihrem Computer gespeichert werden. Ihr Browser speichert diese Informationen in einer kleinen Datei, dem sogenannten Cookie. Wenn Sie eine andere Seite vom Server anfordern, sendet Ihr Browser das Cookie an den Server zurück. Cookies wurden als zuverlässiger Mechanismus für Websites entwickelt, um Informationen zu speichern oder die Browseraktivitäten des Benutzers aufzuzeichnen.', |
|
30 |
+ modalBtnSave: 'Einstellungen speichern', |
|
31 |
+ modalBtnAcceptAll: 'Alle Cookies akzeptieren und schließen', |
|
32 |
+ modalAffectedSolutions: 'Betroffene Services:', |
|
33 |
+ learnMore: 'Mehr dazu', |
|
34 |
+ on: 'Ein', |
|
35 |
+ off: 'Aus', |
|
67 | 36 |
}, |
68 | 37 |
en: { |
69 |
- name: 'Strictly Necessary Cookies', |
|
70 |
- description: 'These cookies are necessary for the full functionality of this website. These cookies are used exclusively for the operation of this website. Usually, these cookies are deleted when you close your browser.', |
|
38 |
+ barMainText: 'This website uses cookies to provide you with the best possible visitor experience. We also use third party cookies to analyze and improve our site usage. You can find out more about the tools we use and how we use them in our privacy policy. You may refuse the use of cookies, which are not required for the functionality of this website.', |
|
39 |
+ barLinkSetting: 'Cookie Settings', |
|
40 |
+ barBtnAcceptAll: 'Accept all cookies', |
|
41 |
+ modalMainTitle: 'Cookie settings', |
|
42 |
+ modalMainText: 'Cookies are small data pieces that are sent by a website and stored on your computer by your web browser during your visit. Your browser stores this information in a small file called a cookie. If you request another page from the server, your browser sends the cookie back to the server. Cookies have been developed as a reliable mechanism for websites to store information or record user browser activity.', |
|
43 |
+ modalBtnSave: 'Save current settings', |
|
44 |
+ modalBtnAcceptAll: 'Accept all cookies and close', |
|
45 |
+ modalAffectedSolutions: 'Affected solutions:', |
|
46 |
+ learnMore: 'Learn More', |
|
47 |
+ on: 'On', |
|
48 |
+ off: 'Off', |
|
71 | 49 |
} |
72 | 50 |
} |
73 |
- } |
|
51 |
+ <?php $this->endblock(); ?> |
|
74 | 52 |
}, |
75 |
- statistics: { |
|
76 |
- // The cookies here are necessary and category cant be turned off. |
|
77 |
- // Wanted config value will be ignored. |
|
78 |
- needed: false, |
|
79 |
- // The cookies in this category will be let trough. |
|
80 |
- // This probably should be false if not necessary category |
|
81 |
- wanted: false, |
|
82 |
- // If the checkbox is on or off at first run. |
|
83 |
- checked: false, |
|
84 |
- // Language settings for categories |
|
85 |
- language: { |
|
86 |
- locale: { |
|
87 |
- de: { |
|
88 |
- name: 'Performance und Statistik Cookies', |
|
89 |
- description: 'Diese Cookies erlauben uns die Nutzung unserer Webseite zu analysieren und Ihren Besuch auszuwerten, so dass wir die Leistung unserer Webseite messen und verbessern können. Die gesammelten Daten werden dabei anonymisiert gespeichert für eine statistische Auswertung.', |
|
90 |
- }, |
|
91 |
- en: { |
|
92 |
- name: 'Performance and Statistics Cookies', |
|
93 |
- description: 'These cookies allow us to analyze the use of our website and evaluate your visit so that we can measure and improve the performance of our website. The collected data is stored anonymously for statistical purposes.', |
|
53 |
+ // List all the categories you want to display |
|
54 |
+ categories: { |
|
55 |
+ // Unique name |
|
56 |
+ // This probably will be the default category |
|
57 |
+ necessary: { |
|
58 |
+ // The cookies here are necessary and category cant be turned off. |
|
59 |
+ // Wanted config value will be ignored. |
|
60 |
+ needed: true, |
|
61 |
+ // The cookies in this category will be let trough. |
|
62 |
+ // This probably should be false if not necessary category |
|
63 |
+ wanted: true, |
|
64 |
+ // If the checkbox is on or off at first run. |
|
65 |
+ checked: true, |
|
66 |
+ // Language settings for categories |
|
67 |
+ language: { |
|
68 |
+ locale: { |
|
69 |
+ de: { |
|
70 |
+ name: 'Unbedingt erforderliche Cookies', |
|
71 |
+ description: 'Diese Cookies sind für die vollständige Funktion der Webseite erforderlich. Diese Cookies werden ausschließlich für die Funktion der Webseite verwendet. In der Regel werden diese Cookies nach dem Schließen Ihres Browsers gelöscht.', |
|
72 |
+ }, |
|
73 |
+ en: { |
|
74 |
+ name: 'Strictly Necessary Cookies', |
|
75 |
+ description: 'These cookies are necessary for the full functionality of this website. These cookies are used exclusively for the operation of this website. Usually, these cookies are deleted when you close your browser.', |
|
76 |
+ } |
|
77 |
+ } |
|
78 |
+ } |
|
79 |
+ }, |
|
80 |
+ statistics: { |
|
81 |
+ // The cookies here are necessary and category cant be turned off. |
|
82 |
+ // Wanted config value will be ignored. |
|
83 |
+ needed: false, |
|
84 |
+ // The cookies in this category will be let trough. |
|
85 |
+ // This probably should be false if not necessary category |
|
86 |
+ wanted: false, |
|
87 |
+ // If the checkbox is on or off at first run. |
|
88 |
+ checked: false, |
|
89 |
+ // Language settings for categories |
|
90 |
+ language: { |
|
91 |
+ locale: { |
|
92 |
+ de: { |
|
93 |
+ name: 'Performance und Statistik Cookies', |
|
94 |
+ description: 'Diese Cookies erlauben uns die Nutzung unserer Webseite zu analysieren und Ihren Besuch auszuwerten, so dass wir die Leistung unserer Webseite messen und verbessern können. Die gesammelten Daten werden dabei anonymisiert gespeichert für eine statistische Auswertung.', |
|
95 |
+ }, |
|
96 |
+ en: { |
|
97 |
+ name: 'Performance and Statistics Cookies', |
|
98 |
+ description: 'These cookies allow us to analyze the use of our website and evaluate your visit so that we can measure and improve the performance of our website. The collected data is stored anonymously for statistical purposes.', |
|
99 |
+ } |
|
94 | 100 |
} |
95 | 101 |
} |
96 | 102 |
} |
103 |
+ <?php if ($this->custom_categories): ?>,services: <?= $this->custom_categories ?><?php endif; ?> |
|
97 | 104 |
} |
98 |
- } |
|
99 |
- // List actual services here |
|
100 |
- <?php if ($this->services): ?>,services: <?= $this->services ?><?php endif; ?> |
|
105 |
+ // List actual services here |
|
106 |
+ <?php if ($this->services): ?>,services: <?= $this->services ?><?php endif; ?> |
|
107 |
+ <?php $this->endblock(); ?> |
|
101 | 108 |
}); |
102 | 109 |
</script> |
103 | 110 |
\ No newline at end of file |