Browse code

Add dca fields for settings and translations

Benjamin Roth authored on11/12/2019 21:56:05
Showing3 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,22 @@
1
+<?php
2
+
3
+/*
4
+* This file is part of eSales Media cookieconsent module
5
+*
6
+* (c) Benjamin Roth
7
+*
8
+* @license https://www.gnu.org/licenses/gpl-3.0.html GPL
9
+*/
10
+
11
+/**
12
+ * Fields.
13
+ */
14
+$GLOBALS['TL_LANG']['tl_page']['cookieconsent_enable'] = ['Cookie-Einwilligung aktivieren', 'Die Cookie-Einwilligung auf der Webseite anzeigen.'];
15
+$GLOBALS['TL_LANG']['tl_page']['cookieconsent_link'] = ['Link zur Datenschutzerklärung', 'Hier können Sie einen Link zur Datenschutzerklärung angeben'];
16
+$GLOBALS['TL_LANG']['tl_page']['cookieconsent_services'] = ['Geblockte Dienste', 'Wählen Sie aus, welche Dienste sie blocken möchten und die der User mit einer Einwilligung freischalten kann.'];
17
+
18
+/*
19
+ * Legends
20
+ */
21
+$GLOBALS['TL_LANG']['tl_page']['cookieconsent_legend'] = 'Cookie-Einwilligung';
22
+
0 23
new file mode 100644
... ...
@@ -0,0 +1,22 @@
1
+<?php
2
+
3
+/*
4
+* This file is part of eSales Media cookieconsent module
5
+*
6
+* (c) Benjamin Roth
7
+*
8
+* @license https://www.gnu.org/licenses/gpl-3.0.html GPL
9
+*/
10
+
11
+/**
12
+ * Fields.
13
+ */
14
+$GLOBALS['TL_LANG']['tl_page']['cookieconsent_enable'] = ['Enable cookie consent', 'Show the cookie consent bar on the website.'];
15
+$GLOBALS['TL_LANG']['tl_page']['cookieconsent_link'] = ['Link to privacy policy', 'Here you can provide a link to the privacy policy.'];
16
+$GLOBALS['TL_LANG']['tl_page']['cookieconsent_services'] = ['Blocked services', 'Select which services you want to block and which the user can unlock with a consent.'];
17
+
18
+/*
19
+ * Legends
20
+ */
21
+$GLOBALS['TL_LANG']['tl_page']['cookieconsent_legend'] = 'Cookie-Consent';
22
+
0 23
new file mode 100644
... ...
@@ -0,0 +1,50 @@
1
+<?php
2
+
3
+/*
4
+* This file is part of eSales Media cookieconsent module
5
+*
6
+* (c) Benjamin Roth
7
+*
8
+* @license https://www.gnu.org/licenses/gpl-3.0.html GPL
9
+*/
10
+
11
+/**
12
+ * Extend the palettes.
13
+ */
14
+$GLOBALS['TL_DCA']['tl_page']['palettes']['__selector__'][] = 'cookieconsent_enable';
15
+$GLOBALS['TL_DCA']['tl_page']['palettes']['root'] .= ';{cookieconsent_legend},cookieconsent_enable';
16
+
17
+$GLOBALS['TL_DCA']['tl_page']['subpalettes']['cookieconsent_enable'] = 'cookieconsent_link,cookieconsent_statistics_analytics';
18
+
19
+/*
20
+ * Add the fields
21
+ */
22
+$GLOBALS['TL_DCA']['tl_page']['fields']['cookieconsent_enable'] = [
23
+  'label' => &$GLOBALS['TL_LANG']['tl_page']['cookieconsent_enable'],
24
+  'exclude' => true,
25
+  'inputType' => 'checkbox',
26
+  'eval' => array('submitOnChange' => true, 'tl_class' => 'clr'),
27
+  'sql' => "char(1) NOT NULL default ''",
28
+];
29
+
30
+$GLOBALS['TL_DCA']['tl_page']['fields']['cookieconsent_link'] = [
31
+  'label' => &$GLOBALS['TL_LANG']['tl_page']['cookieconsent_link'],
32
+  'exclude' => true,
33
+  'search' => true,
34
+  'inputType' => 'text',
35
+  'eval' => array('rgxp'=>'url', 'decodeEntities'=>true, 'maxlength'=>255, 'fieldType'=>'radio', 'tl_class'=>'clr wizard'),
36
+  'wizard' => array
37
+  (
38
+    array('tl_content', 'pagePicker')
39
+  ),
40
+  'sql'=> "varchar(255) NOT NULL default ''"
41
+];
42
+
43
+$GLOBALS['TL_DCA']['tl_page']['fields']['cookieconsent_services'] = [
44
+  'label' => &$GLOBALS['TL_LANG']['tl_page']['cookieconsent_services'],
45
+  'exclude' => true,
46
+  'inputType' => 'checkbox',
47
+  'options' => array('analytics','matomo'),
48
+  'eval' => array('tl_class' => 'clr'),
49
+  'sql' => "char(1) NOT NULL default ''",
50
+];