Browse code

Add deny all button

Benjamin Roth authored on08/06/2020 13:49:53
Showing1 changed files
... ...
@@ -12,8 +12,10 @@
12 12
           barTextColor: '#FFF',
13 13
           barMainButtonColor: '#FFF',
14 14
           barMainButtonTextColor: '#2C7CBF',
15
+          barShowDenyButton: true,
16
+          barLinkAsButton: false,
15 17
           modalMainButtonColor: '#4285F4',
16
-          modalMainButtonTextColor: '#FFF',
18
+          modalMainButtonTextColor: '#FFF'
17 19
         <?php $this->endblock(); ?>
18 20
       },
19 21
       language: {
... ...
@@ -25,6 +27,7 @@
25 27
               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 28
               barLinkSetting: 'Anpassen',
27 29
               barBtnAcceptAll: 'Alle Cookies akzeptieren',
30
+              barBtnDenyAll: 'Alles ablehnen',
28 31
               modalMainTitle: 'Cookie-Einstellungen',
29 32
               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 33
               modalBtnSave: 'Einstellungen speichern',
... ...
@@ -38,6 +41,7 @@
38 41
               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 42
               barLinkSetting: 'Adjust',
40 43
               barBtnAcceptAll: 'Accept all cookies',
44
+              barBtnDenyAll: 'Deny all cookies',
41 45
               modalMainTitle: 'Cookie settings',
42 46
               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 47
               modalBtnSave: 'Save current settings',
Browse code

Bugfixing

Benjamin Roth authored on19/05/2020 12:06:40
Showing1 changed files
... ...
@@ -23,12 +23,12 @@
23 23
           locale: {
24 24
             de: {
25 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',
26
+              barLinkSetting: 'Anpassen',
27 27
               barBtnAcceptAll: 'Alle Cookies akzeptieren',
28 28
               modalMainTitle: 'Cookie-Einstellungen',
29 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 30
               modalBtnSave: 'Einstellungen speichern',
31
-              modalBtnAcceptAll: 'Alle Cookies akzeptieren und schließen',
31
+              modalBtnAcceptAll: 'Alle Cookies akzeptieren',
32 32
               modalAffectedSolutions: 'Betroffene Services:',
33 33
               learnMore: 'Mehr dazu',
34 34
               on: 'Ein',
... ...
@@ -36,12 +36,12 @@
36 36
             },
37 37
             en: {
38 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',
39
+              barLinkSetting: 'Adjust',
40 40
               barBtnAcceptAll: 'Accept all cookies',
41 41
               modalMainTitle: 'Cookie settings',
42 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 43
               modalBtnSave: 'Save current settings',
44
-              modalBtnAcceptAll: 'Accept all cookies and close',
44
+              modalBtnAcceptAll: 'Accept all cookies',
45 45
               modalAffectedSolutions: 'Affected solutions:',
46 46
               learnMore: 'Learn More',
47 47
               on: 'On',
Browse code

Do not show statistics category if there's no service for configured

Benjamin Roth authored on12/12/2019 10:50:37
Showing1 changed files
... ...
@@ -76,7 +76,7 @@
76 76
               }
77 77
             }
78 78
           }
79
-        },
79
+        }<?php if ($this->services): ?>,
80 80
         statistics: {
81 81
           // The cookies here are necessary and category cant be turned off.
82 82
           // Wanted config value  will be ignored.
... ...
@@ -99,7 +99,7 @@
99 99
               }
100 100
             }
101 101
           }
102
-        }
102
+        }<?php endif; ?>
103 103
         <?php if ($this->custom_categories): ?><?= $this->custom_categories ?><?php endif; ?>
104 104
       }
105 105
       // List actual services here
Browse code

Fix config javascript due to a copy'n paste error

Benjamin Roth authored on12/12/2019 10:13:05
Showing1 changed files
... ...
@@ -100,7 +100,7 @@
100 100
             }
101 101
           }
102 102
         }
103
-        <?php if ($this->custom_categories): ?>,services: <?= $this->custom_categories ?><?php endif; ?>
103
+        <?php if ($this->custom_categories): ?><?= $this->custom_categories ?><?php endif; ?>
104 104
       }
105 105
       // List actual services here
106 106
       <?php if ($this->services): ?>,services: <?= $this->services ?><?php endif; ?>
Browse code

Add more configuration possibilities and make use of template blocks

Benjamin Roth authored on12/12/2019 09:59:34
Showing1 changed files
... ...
@@ -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
Browse code

Some more config optimization

Benjamin Roth authored on11/12/2019 22:52:17
Showing1 changed files
... ...
@@ -95,10 +95,8 @@
95 95
           }
96 96
         }
97 97
       }
98
-    }<?php if ($this->services): ?>,
98
+    }
99 99
     // List actual services here
100
-    services: {
101
-      <?= $this->services ?>
102
-    }<?php endif; ?>
100
+    <?php if ($this->services): ?>,services: <?= $this->services ?><?php endif; ?>
103 101
   });
104 102
 </script>
105 103
\ No newline at end of file
Browse code

Correct german translation

Benjamin Roth authored on11/12/2019 22:46:02
Showing1 changed files
... ...
@@ -86,7 +86,7 @@
86 86
           locale: {
87 87
             de: {
88 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 sind werden dabei anonymisiert gespeichert für eine statistische Auswertung.',
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 90
             },
91 91
             en: {
92 92
               name: 'Performance and Statistics Cookies',
Browse code

Only build services config in consent configuration if any services selected.

Benjamin Roth authored on11/12/2019 22:43:09
Showing1 changed files
... ...
@@ -95,10 +95,10 @@
95 95
           }
96 96
         }
97 97
       }
98
-    },
98
+    }<?php if ($this->services): ?>,
99 99
     // List actual services here
100 100
     services: {
101 101
       <?= $this->services ?>
102
-    }
102
+    }<?php endif; ?>
103 103
   });
104 104
 </script>
105 105
\ No newline at end of file
Browse code

Use variables in configuration

Benjamin Roth authored on11/12/2019 22:22:04
Showing1 changed files
... ...
@@ -1,7 +1,7 @@
1 1
 <script>
2 2
   window.CookieConsent.init({
3 3
     // More link URL on bar
4
-    modalMainTextMoreLink: null,
4
+    modalMainTextMoreLink: <?= $this->privacy_policy_link ?>,
5 5
     // How lond to wait until bar comes up
6 6
     barTimeout: 1000,
7 7
     // Look and feel
... ...
@@ -98,30 +98,7 @@
98 98
     },
99 99
     // List actual services here
100 100
     services: {
101
-      // Unique name
102
-      analytics: {
103
-        // Existing category Unique name
104
-        // This example shows how to block Google Analytics
105
-        category: 'statistics',
106
-        // Type of blocking to apply here.
107
-        // This depends on the type of script we are trying to block
108
-        // Can be: dynamic-script, script-tag, wrapped, localcookie
109
-        type: 'dynamic-script',
110
-        // Only needed if "type: dynamic-script"
111
-        // The filter will look for this keyword in inserted scipt tags
112
-        // and block if match found
113
-        search: 'analytics',
114
-        language: {
115
-          locale: {
116
-            de: {
117
-              name: 'Google Analytics'
118
-            },
119
-            en: {
120
-              name: 'Google Analytics'
121
-            }
122
-          }
123
-        }
124
-      }
101
+      <?= $this->services ?>
125 102
     }
126 103
   });
127 104
 </script>
128 105
\ No newline at end of file
Browse code

Adjust Template

Benjamin Roth authored on11/12/2019 21:05:45
Showing1 changed files
... ...
@@ -1,12 +1,3 @@
1
-<?php
2
-if (!\is_array($GLOBALS['TL_HEAD']))
3
-{
4
-  $GLOBALS['TL_HEAD'] = array();
5
-}
6
-array_unshift($GLOBALS['TL_HEAD'],'<script src="system/modules/eSM_cookieconsent/assets/js/lib/cookieconsent.min.js"></script>');
7
-
8
-?>
9
-
10 1
 <script>
11 2
   window.CookieConsent.init({
12 3
     // More link URL on bar
Browse code

First working draft

Benjamin Roth authored on11/12/2019 21:04:43
Showing1 changed files
... ...
@@ -1,5 +1,9 @@
1 1
 <?php
2
-$GLOBALS['TL_JAVASCRIPT'][] = 'system/modules/eSM_cookieconsent/assets/js/lib/cookieconsent.min.js|static';
2
+if (!\is_array($GLOBALS['TL_HEAD']))
3
+{
4
+  $GLOBALS['TL_HEAD'] = array();
5
+}
6
+array_unshift($GLOBALS['TL_HEAD'],'<script src="system/modules/eSM_cookieconsent/assets/js/lib/cookieconsent.min.js"></script>');
3 7
 
4 8
 ?>
5 9
 
... ...
@@ -20,14 +24,27 @@ $GLOBALS['TL_JAVASCRIPT'][] = 'system/modules/eSM_cookieconsent/assets/js/lib/co
20 24
     },
21 25
     language: {
22 26
       // Current language
23
-      current: 'en',
27
+      current: '{{iflng::de}}de{{iflng}}{{ifnlng::de}}en{{ifnlng}}',
24 28
       locale: {
29
+        de: {
30
+          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.',
31
+          barLinkSetting: 'Cookie-Einstellungen',
32
+          barBtnAcceptAll: 'Alle Cookies akzeptieren',
33
+          modalMainTitle: 'Cookie-Einstellungen',
34
+          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.',
35
+          modalBtnSave: 'Einstellungen speichern',
36
+          modalBtnAcceptAll: 'Alle Cookies akzeptieren und schließen',
37
+          modalAffectedSolutions: 'Betroffene Services:',
38
+          learnMore: 'Mehr dazu',
39
+          on: 'Ein',
40
+          off: 'Aus',
41
+        },
25 42
         en: {
26
-          barMainText: 'This website uses cookies to ensure you get the best experience on our website.',
43
+          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.',
27 44
           barLinkSetting: 'Cookie Settings',
28 45
           barBtnAcceptAll: 'Accept all cookies',
29 46
           modalMainTitle: 'Cookie settings',
30
-          modalMainText: 'Cookies are small piece of data sent from a website and stored on the user\'s computer by the user\'s web browser while the user is browsing. Your browser stores each message in a small file, called cookie. When you request another page from the server, your browser sends the cookie back to the server. Cookies were designed to be a reliable mechanism for websites to remember information or to record the user\'s browsing activity.',
47
+          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.',
31 48
           modalBtnSave: 'Save current settings',
32 49
           modalBtnAcceptAll: 'Accept all cookies and close',
33 50
           modalAffectedSolutions: 'Affected solutions:',
... ...
@@ -53,9 +70,36 @@ $GLOBALS['TL_JAVASCRIPT'][] = 'system/modules/eSM_cookieconsent/assets/js/lib/co
53 70
         // Language settings for categories
54 71
         language: {
55 72
           locale: {
73
+            de: {
74
+              name: 'Unbedingt erforderliche Cookies',
75
+              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.',
76
+            },
56 77
             en: {
57 78
               name: 'Strictly Necessary Cookies',
58
-              description: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur eu commodo est, nec gravida odio. Suspendisse scelerisque a ex nec semper.',
79
+              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.',
80
+            }
81
+          }
82
+        }
83
+      },
84
+      statistics: {
85
+        // The cookies here are necessary and category cant be turned off.
86
+        // Wanted config value  will be ignored.
87
+        needed: false,
88
+        // The cookies in this category will be let trough.
89
+        // This probably should be false if not necessary category
90
+        wanted: false,
91
+        // If the checkbox is on or off at first run.
92
+        checked: false,
93
+        // Language settings for categories
94
+        language: {
95
+          locale: {
96
+            de: {
97
+              name: 'Performance und Statistik Cookies',
98
+              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 sind werden dabei anonymisiert gespeichert für eine statistische Auswertung.',
99
+            },
100
+            en: {
101
+              name: 'Performance and Statistics Cookies',
102
+              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.',
59 103
             }
60 104
           }
61 105
         }
... ...
@@ -67,7 +111,7 @@ $GLOBALS['TL_JAVASCRIPT'][] = 'system/modules/eSM_cookieconsent/assets/js/lib/co
67 111
       analytics: {
68 112
         // Existing category Unique name
69 113
         // This example shows how to block Google Analytics
70
-        category: 'necessary',
114
+        category: 'statistics',
71 115
         // Type of blocking to apply here.
72 116
         // This depends on the type of script we are trying to block
73 117
         // Can be: dynamic-script, script-tag, wrapped, localcookie
... ...
@@ -78,6 +122,9 @@ $GLOBALS['TL_JAVASCRIPT'][] = 'system/modules/eSM_cookieconsent/assets/js/lib/co
78 122
         search: 'analytics',
79 123
         language: {
80 124
           locale: {
125
+            de: {
126
+              name: 'Google Analytics'
127
+            },
81 128
             en: {
82 129
               name: 'Google Analytics'
83 130
             }
Browse code

Fix missing comma in js

Benjamin Roth authored on11/12/2019 16:35:14
Showing1 changed files
... ...
@@ -36,7 +36,7 @@ $GLOBALS['TL_JAVASCRIPT'][] = 'system/modules/eSM_cookieconsent/assets/js/lib/co
36 36
           off: 'Off',
37 37
         }
38 38
       }
39
-    }
39
+    },
40 40
     // List all the categories you want to display
41 41
     categories: {
42 42
       // Unique name
Browse code

Inject Init Code

Benjamin Roth authored on11/12/2019 14:16:27
Showing1 changed files
... ...
@@ -1,2 +1,89 @@
1 1
 <?php
2
-$GLOBALS['TL_JAVASCRIPT'][] = 'system/modules/eSM_cookieconsent/assets/js/lib/cookieconsent.min.js|static';
3 2
\ No newline at end of file
3
+$GLOBALS['TL_JAVASCRIPT'][] = 'system/modules/eSM_cookieconsent/assets/js/lib/cookieconsent.min.js|static';
4
+
5
+?>
6
+
7
+<script>
8
+  window.CookieConsent.init({
9
+    // More link URL on bar
10
+    modalMainTextMoreLink: null,
11
+    // How lond to wait until bar comes up
12
+    barTimeout: 1000,
13
+    // Look and feel
14
+    theme: {
15
+      barColor: '#2C7CBF',
16
+      barTextColor: '#FFF',
17
+      barMainButtonColor: '#FFF',
18
+      barMainButtonTextColor: '#2C7CBF',
19
+      modalMainButtonColor: '#4285F4',
20
+      modalMainButtonTextColor: '#FFF',
21
+    },
22
+    language: {
23
+      // Current language
24
+      current: 'en',
25
+      locale: {
26
+        en: {
27
+          barMainText: 'This website uses cookies to ensure you get the best experience on our website.',
28
+          barLinkSetting: 'Cookie Settings',
29
+          barBtnAcceptAll: 'Accept all cookies',
30
+          modalMainTitle: 'Cookie settings',
31
+          modalMainText: 'Cookies are small piece of data sent from a website and stored on the user\'s computer by the user\'s web browser while the user is browsing. Your browser stores each message in a small file, called cookie. When you request another page from the server, your browser sends the cookie back to the server. Cookies were designed to be a reliable mechanism for websites to remember information or to record the user\'s browsing activity.',
32
+          modalBtnSave: 'Save current settings',
33
+          modalBtnAcceptAll: 'Accept all cookies and close',
34
+          modalAffectedSolutions: 'Affected solutions:',
35
+          learnMore: 'Learn More',
36
+          on: 'On',
37
+          off: 'Off',
38
+        }
39
+      }
40
+    }
41
+    // List all the categories you want to display
42
+    categories: {
43
+      // Unique name
44
+      // This probably will be the default category
45
+      necessary: {
46
+        // The cookies here are necessary and category cant be turned off.
47
+        // Wanted config value  will be ignored.
48
+        needed: true,
49
+        // The cookies in this category will be let trough.
50
+        // This probably should be false if not necessary category
51
+        wanted: true,
52
+        // If the checkbox is on or off at first run.
53
+        checked: true,
54
+        // Language settings for categories
55
+        language: {
56
+          locale: {
57
+            en: {
58
+              name: 'Strictly Necessary Cookies',
59
+              description: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur eu commodo est, nec gravida odio. Suspendisse scelerisque a ex nec semper.',
60
+            }
61
+          }
62
+        }
63
+      }
64
+    },
65
+    // List actual services here
66
+    services: {
67
+      // Unique name
68
+      analytics: {
69
+        // Existing category Unique name
70
+        // This example shows how to block Google Analytics
71
+        category: 'necessary',
72
+        // Type of blocking to apply here.
73
+        // This depends on the type of script we are trying to block
74
+        // Can be: dynamic-script, script-tag, wrapped, localcookie
75
+        type: 'dynamic-script',
76
+        // Only needed if "type: dynamic-script"
77
+        // The filter will look for this keyword in inserted scipt tags
78
+        // and block if match found
79
+        search: 'analytics',
80
+        language: {
81
+          locale: {
82
+            en: {
83
+              name: 'Google Analytics'
84
+            }
85
+          }
86
+        }
87
+      }
88
+    }
89
+  });
90
+</script>
4 91
\ No newline at end of file
Browse code

Test script injection

Benjamin Roth authored on11/12/2019 13:43:09
Showing1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,2 @@
1
+<?php
2
+$GLOBALS['TL_JAVASCRIPT'][] = 'system/modules/eSM_cookieconsent/assets/js/lib/cookieconsent.min.js|static';
0 3
\ No newline at end of file