1 | 1 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,136 @@ |
1 |
+<?php |
|
2 |
+ |
|
3 |
+/** |
|
4 |
+ * Contao Open Source CMS |
|
5 |
+ * Copyright (C) 2005-2011 Leo Feyer |
|
6 |
+ * |
|
7 |
+ * Formerly known as TYPOlight Open Source CMS. |
|
8 |
+ * |
|
9 |
+ * This program is free software: you can redistribute it and/or |
|
10 |
+ * modify it under the terms of the GNU Lesser General Public |
|
11 |
+ * License as published by the Free Software Foundation, either |
|
12 |
+ * version 3 of the License, or (at your option) any later version. |
|
13 |
+ * |
|
14 |
+ * This program is distributed in the hope that it will be useful, |
|
15 |
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
16 |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
17 |
+ * Lesser General Public License for more details. |
|
18 |
+ * |
|
19 |
+ * You should have received a copy of the GNU Lesser General Public |
|
20 |
+ * License along with this program. If not, please visit the Free |
|
21 |
+ * Software Foundation website at <http://www.gnu.org/licenses/>. |
|
22 |
+ * |
|
23 |
+ * PHP version 5 |
|
24 |
+ * @copyright eSales Media 2012 |
|
25 |
+ * @author Benjamin Roth <www.esales-media.de> |
|
26 |
+ * @package legalAgeCheck |
|
27 |
+ * @license GNU/LGPL |
|
28 |
+ * @filesource |
|
29 |
+ */ |
|
30 |
+ |
|
31 |
+namespace legalAgeCheck; |
|
32 |
+ |
|
33 |
+ |
|
34 |
+/** |
|
35 |
+ * Class LegalAgeCheck |
|
36 |
+ * |
|
37 |
+ * @copyright eSales Media 2012 |
|
38 |
+ * @author Benjamin Roth <www.esales-media.de> |
|
39 |
+ * @package Controller |
|
40 |
+ */ |
|
41 |
+class LegalAgeCheck extends \Frontend |
|
42 |
+{ |
|
43 |
+ |
|
44 |
+ /** |
|
45 |
+ * Template |
|
46 |
+ * @var string |
|
47 |
+ */ |
|
48 |
+ protected $strTemplate = 'agecheck_dialog'; |
|
49 |
+ |
|
50 |
+ |
|
51 |
+ /** |
|
52 |
+ * Perform age check |
|
53 |
+ */ |
|
54 |
+ public function performAgeCheck(\PageModel $objPage, \LayoutModel $objLayout, \PageRegular $objPageRegular) |
|
55 |
+ { |
|
56 |
+ // Skip age check if passed before |
|
57 |
+ //if ($this->Session->get('legalAgeCheck_passed')) |
|
58 |
+ if ($this->Input->cookie('legalAgeCheck_passed') || $objPage->es_ext_agecheck_ignorePage) |
|
59 |
+ { |
|
60 |
+ // $this->Session->set('legalAgeCheck_passed', null); |
|
61 |
+ return; |
|
62 |
+ } |
|
63 |
+ |
|
64 |
+ // Get root page |
|
65 |
+ $objRootPage = \PageModel::findByPk($objPage->rootId); |
|
66 |
+ |
|
67 |
+ // Cancel verification if age check is disabled |
|
68 |
+ if (is_null($objRootPage) || !$objRootPage->es_ext_agecheck || $objRootPage->es_ext_agecheck_exitPage == $objPage->id) |
|
69 |
+ return; |
|
70 |
+ |
|
71 |
+ // Get exit page |
|
72 |
+ $objExitPage = \PageModel::findWithDetails($objRootPage->es_ext_agecheck_exitPage); |
|
73 |
+ if (is_null($objExitPage) || !$objExitPage->published) |
|
74 |
+ return; |
|
75 |
+ |
|
76 |
+ // Load dialog template |
|
77 |
+ $objTemplate = new \FrontendTemplate($this->strTemplate); |
|
78 |
+ |
|
79 |
+ // Load modal box template |
|
80 |
+ //$objModalBoxTemplate = new FrontendTemplate('agecheck_dialog_template'); |
|
81 |
+ |
|
82 |
+ // Set template vars |
|
83 |
+ $objTemplate->title = $GLOBALS['TL_LANG']['MSC']['es_legalagecheck']['title']; |
|
84 |
+ $objTemplate->text = $GLOBALS['TL_LANG']['MSC']['es_legalagecheck']['text']; |
|
85 |
+ $objTemplate->btn_over_18 = $GLOBALS['TL_LANG']['MSC']['es_legalagecheck']['over_18']; |
|
86 |
+ $objTemplate->btn_under_18 = $GLOBALS['TL_LANG']['MSC']['es_legalagecheck']['under_18']; |
|
87 |
+ $objTemplate->exitPageURL = $this->generateFrontendUrl($objExitPage->row(), null, null, true); |
|
88 |
+ $objTemplate->commitURL = 'system/modules/legalAgeCheck/ajax/Ajax.php?do=legalage_authentication&legalage_commit='.$this->createToken(); |
|
89 |
+ //$objTemplate->modalBoxTemplate = addcslashes($objModalBoxTemplate->parse(), "\\'\"&\n\r"); |
|
90 |
+ |
|
91 |
+ // Add dialog code to page |
|
92 |
+ $GLOBALS['TL_JQUERY'][] = $objTemplate->parse(); |
|
93 |
+ |
|
94 |
+ |
|
95 |
+ } |
|
96 |
+ |
|
97 |
+ public static function ajaxUnlockPage() |
|
98 |
+ { |
|
99 |
+ if (!\Input::get('legalage_commit')) |
|
100 |
+ return false; |
|
101 |
+ |
|
102 |
+ /*if ($this->Input->get('legalage_commit') == $this->Session->get('legalAgeCheck_token')) |
|
103 |
+ { |
|
104 |
+ $this->Session->set('legalAgeCheck_passed', true); |
|
105 |
+ $this->Session->set('legalAgeCheck_token', null); |
|
106 |
+ }*/ |
|
107 |
+ |
|
108 |
+ if (\Input::get('legalage_commit') == $_SESSION['legalAgeCheck_token']) |
|
109 |
+ { |
|
110 |
+ //preg_match('/(?P<domain>[a-z0-9][a-z0-9\-]{1,63}\.[a-z\.]{2,6})$/i', \Environment::get('host'), $regs); |
|
111 |
+ preg_match('/(?P<subdomain>[a-z0-9][a-z0-9\-]{1,63}|)\.(?P<domain>[a-z0-9][a-z0-9\-]{1,63}\.[a-z\.]{2,6})$/i', \Environment::get('host'), $regs); |
|
112 |
+ |
|
113 |
+ setcookie('legalAgeCheck_passed', true, 0, '/',$regs['subdomain'].'.'.$regs['domain']); |
|
114 |
+ unset($_SESSION['legalAgeCheck_token']); |
|
115 |
+ |
|
116 |
+ return true; |
|
117 |
+ } |
|
118 |
+ |
|
119 |
+ return false; |
|
120 |
+ } |
|
121 |
+ |
|
122 |
+ protected function createToken() |
|
123 |
+ { |
|
124 |
+ if (!$_SESSION['legalAgeCheck_token']) |
|
125 |
+ { |
|
126 |
+ $length = 32; |
|
127 |
+ $characters = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'; |
|
128 |
+ $random_string = ""; |
|
129 |
+ for ($p = 0; $p < $length; $p++) { |
|
130 |
+ $random_string .= $characters[mt_rand(0, strlen($characters))]; |
|
131 |
+ } |
|
132 |
+ $_SESSION['legalAgeCheck_token'] = $random_string; |
|
133 |
+ } |
|
134 |
+ return $_SESSION['legalAgeCheck_token']; |
|
135 |
+ } |
|
136 |
+} |
|
0 | 137 |
\ No newline at end of file |
1 | 9 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,77 @@ |
1 |
+<?php |
|
2 |
+/** |
|
3 |
+ * eSales Media Legal Age Check |
|
4 |
+ * |
|
5 |
+ * Copyright (C) 2013-2015 eSalesMedia |
|
6 |
+ * |
|
7 |
+ * @package legalAgeCheck |
|
8 |
+ * @link http://www.esales-media.de |
|
9 |
+ * @license commercial |
|
10 |
+ * |
|
11 |
+ * @author Benjamin Roth <benjamin@esales-media.de> |
|
12 |
+ */ |
|
13 |
+ |
|
14 |
+namespace legalAgeCheck; |
|
15 |
+ |
|
16 |
+/** |
|
17 |
+ * AJAX check |
|
18 |
+ */ |
|
19 |
+ |
|
20 |
+if(!$_SERVER['HTTP_X_REQUESTED_WITH'] || strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) != 'xmlhttprequest') { |
|
21 |
+ header('HTTP/1.1 403 Forbidden'); |
|
22 |
+ die("File cannot be executed directly"); |
|
23 |
+} |
|
24 |
+ |
|
25 |
+ |
|
26 |
+/** |
|
27 |
+ * Initialize the system |
|
28 |
+ */ |
|
29 |
+ |
|
30 |
+define('TL_SCRIPT', 'system/modules/legalAgeCheck/ajax/Ajax.php'); |
|
31 |
+define('TL_MODE', 'FE'); |
|
32 |
+require '../../../initialize.php'; |
|
33 |
+ |
|
34 |
+class LegalAgeCheckAsync extends \Frontend |
|
35 |
+{ |
|
36 |
+ public function __construct() |
|
37 |
+ { |
|
38 |
+ \Controller::setStaticUrls(); |
|
39 |
+ \Controller::loadLanguageFile('default'); |
|
40 |
+ |
|
41 |
+ parent::__construct(); |
|
42 |
+ } |
|
43 |
+ |
|
44 |
+ public function run() |
|
45 |
+ { |
|
46 |
+ $strBuffer = ''; |
|
47 |
+ switch(\Input::get('do')) |
|
48 |
+ { |
|
49 |
+ case 'legalage_authentication': |
|
50 |
+ if (!is_null(\Input::get('legalage_commit'))) |
|
51 |
+ { |
|
52 |
+ $strBuffer = json_encode(array('status'=>(LegalAgeCheck::ajaxUnlockPage() ? 'OK' : 'FAILED'))); |
|
53 |
+ } else { |
|
54 |
+ $this->preconditionFailed(); |
|
55 |
+ } |
|
56 |
+ break; |
|
57 |
+ |
|
58 |
+ default: |
|
59 |
+ $this->preconditionFailed(); |
|
60 |
+ break; |
|
61 |
+ } |
|
62 |
+ |
|
63 |
+ header('Content-Type: application/json; charset=utf-8'); |
|
64 |
+ echo $strBuffer; |
|
65 |
+ exit; |
|
66 |
+ } |
|
67 |
+ |
|
68 |
+ protected function preconditionFailed() |
|
69 |
+ { |
|
70 |
+ header('HTTP/1.1 412 Precondition Failed'); |
|
71 |
+ echo 'Precondition failed'; |
|
72 |
+ exit(); |
|
73 |
+ } |
|
74 |
+} |
|
75 |
+ |
|
76 |
+$Ajax = new LegalAgeCheckAsync(); |
|
77 |
+$Ajax->run(); |
|
0 | 78 |
\ No newline at end of file |
1 | 4 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,20 @@ |
1 |
+;; |
|
2 |
+; List modules which are required to be loaded beforehand |
|
3 |
+;; |
|
4 |
+requires[] = "core" |
|
5 |
+requires[] = "eSM_vexdialog" |
|
6 |
+ |
|
7 |
+;; |
|
8 |
+; Configure what you want the autoload creator to register |
|
9 |
+;; |
|
10 |
+register_namespaces = true |
|
11 |
+register_classes = true |
|
12 |
+register_templates = true |
|
13 |
+ |
|
14 |
+;; |
|
15 |
+; Override the default configuration for certain sub directories |
|
16 |
+;; |
|
17 |
+[vendor/*] |
|
18 |
+register_namespaces = false |
|
19 |
+register_classes = false |
|
20 |
+register_templates = false |
0 | 21 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,38 @@ |
1 |
+<?php |
|
2 |
+ |
|
3 |
+/** |
|
4 |
+ * Contao Open Source CMS |
|
5 |
+ * |
|
6 |
+ * Copyright (c) 2005-2015 Leo Feyer |
|
7 |
+ * |
|
8 |
+ * @license LGPL-3.0+ |
|
9 |
+ */ |
|
10 |
+ |
|
11 |
+ |
|
12 |
+/** |
|
13 |
+ * Register the namespaces |
|
14 |
+ */ |
|
15 |
+ClassLoader::addNamespaces(array |
|
16 |
+( |
|
17 |
+ 'legalAgeCheck', |
|
18 |
+)); |
|
19 |
+ |
|
20 |
+ |
|
21 |
+/** |
|
22 |
+ * Register the classes |
|
23 |
+ */ |
|
24 |
+ClassLoader::addClasses(array |
|
25 |
+( |
|
26 |
+ 'legalAgeCheck\LegalAgeCheck' => 'system/modules/legalAgeCheck/LegalAgeCheck.php', |
|
27 |
+)); |
|
28 |
+ |
|
29 |
+ |
|
30 |
+/** |
|
31 |
+ * Register the templates |
|
32 |
+ */ |
|
33 |
+TemplateLoader::addFiles(array |
|
34 |
+( |
|
35 |
+ 'template_skeleton' => 'system/modules/legalAgeCheck/templates', |
|
36 |
+ 'agecheck_dialog' => 'system/modules/legalAgeCheck/templates', |
|
37 |
+ 'agecheck_dialog_template' => 'system/modules/legalAgeCheck/templates', |
|
38 |
+)); |
0 | 39 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,193 @@ |
1 |
+<?php if (!defined('TL_ROOT')) die('You cannot access this file directly!'); |
|
2 |
+ |
|
3 |
+/** |
|
4 |
+ * Contao Open Source CMS |
|
5 |
+ * Copyright (C) 2005-2011 Leo Feyer |
|
6 |
+ * |
|
7 |
+ * Formerly known as TYPOlight Open Source CMS. |
|
8 |
+ * |
|
9 |
+ * This program is free software: you can redistribute it and/or |
|
10 |
+ * modify it under the terms of the GNU Lesser General Public |
|
11 |
+ * License as published by the Free Software Foundation, either |
|
12 |
+ * version 3 of the License, or (at your option) any later version. |
|
13 |
+ * |
|
14 |
+ * This program is distributed in the hope that it will be useful, |
|
15 |
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
16 |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
17 |
+ * Lesser General Public License for more details. |
|
18 |
+ * |
|
19 |
+ * You should have received a copy of the GNU Lesser General Public |
|
20 |
+ * License along with this program. If not, please visit the Free |
|
21 |
+ * Software Foundation website at <http://www.gnu.org/licenses/>. |
|
22 |
+ * |
|
23 |
+ * PHP version 5 |
|
24 |
+ * @copyright eSales Media 2012 |
|
25 |
+ * @author Benjamin Roth <www.esales-media.de> |
|
26 |
+ * @package legalAgeCheck |
|
27 |
+ * @license GNU/LGPL |
|
28 |
+ * @filesource |
|
29 |
+ */ |
|
30 |
+ |
|
31 |
+ |
|
32 |
+/** |
|
33 |
+ * ------------------------------------------------------------------------- |
|
34 |
+ * BACK END MODULES |
|
35 |
+ * ------------------------------------------------------------------------- |
|
36 |
+ * |
|
37 |
+ * Back end modules are stored in a global array called "BE_MOD". Each module |
|
38 |
+ * has certain properties like an icon, an optional callback function and one |
|
39 |
+ * or more tables. Each module belongs to a particular group. |
|
40 |
+ * |
|
41 |
+ * $GLOBALS['BE_MOD'] = array |
|
42 |
+ * ( |
|
43 |
+ * 'group_1' => array |
|
44 |
+ * ( |
|
45 |
+ * 'module_1' => array |
|
46 |
+ * ( |
|
47 |
+ * 'tables' => array('table_1', 'table_2'), |
|
48 |
+ * 'key' => array('Class', 'method'), |
|
49 |
+ * 'callback' => 'ClassName', |
|
50 |
+ * 'icon' => 'path/to/icon.gif', |
|
51 |
+ * 'stylesheet' => 'path/to/stylesheet.css', |
|
52 |
+ * 'javascript' => 'path/to/javascript.js' |
|
53 |
+ * ) |
|
54 |
+ * ) |
|
55 |
+ * ); |
|
56 |
+ * |
|
57 |
+ * Use function array_insert() to modify an existing modules array. |
|
58 |
+ */ |
|
59 |
+ |
|
60 |
+ |
|
61 |
+/** |
|
62 |
+ * ------------------------------------------------------------------------- |
|
63 |
+ * FRONT END MODULES |
|
64 |
+ * ------------------------------------------------------------------------- |
|
65 |
+ * |
|
66 |
+ * List all front end modules and their class names. |
|
67 |
+ * |
|
68 |
+ * $GLOBALS['FE_MOD'] = array |
|
69 |
+ * ( |
|
70 |
+ * 'group_1' => array |
|
71 |
+ * ( |
|
72 |
+ * 'module_1' => 'Contentlass', |
|
73 |
+ * 'module_2' => 'Contentlass' |
|
74 |
+ * ) |
|
75 |
+ * ); |
|
76 |
+ * |
|
77 |
+ * Use function array_insert() to modify an existing CTE array. |
|
78 |
+ */ |
|
79 |
+ |
|
80 |
+ |
|
81 |
+/** |
|
82 |
+ * ------------------------------------------------------------------------- |
|
83 |
+ * CONTENT ELEMENTS |
|
84 |
+ * ------------------------------------------------------------------------- |
|
85 |
+ * |
|
86 |
+ * List all content elements and their class names. |
|
87 |
+ * |
|
88 |
+ * $GLOBALS['TL_CTE'] = array |
|
89 |
+ * ( |
|
90 |
+ * 'group_1' => array |
|
91 |
+ * ( |
|
92 |
+ * 'cte_1' => 'Contentlass', |
|
93 |
+ * 'cte_2' => 'Contentlass' |
|
94 |
+ * ) |
|
95 |
+ * ); |
|
96 |
+ * |
|
97 |
+ * Use function array_insert() to modify an existing CTE array. |
|
98 |
+ */ |
|
99 |
+ |
|
100 |
+ |
|
101 |
+/** |
|
102 |
+ * ------------------------------------------------------------------------- |
|
103 |
+ * BACK END FORM FIELDS |
|
104 |
+ * ------------------------------------------------------------------------- |
|
105 |
+ * |
|
106 |
+ * List all back end form fields and their class names. |
|
107 |
+ * |
|
108 |
+ * $GLOBALS['BE_FFL'] = array |
|
109 |
+ * ( |
|
110 |
+ * 'input' => 'Class', |
|
111 |
+ * 'select' => 'Class' |
|
112 |
+ * ); |
|
113 |
+ * |
|
114 |
+ * Use function array_insert() to modify an existing FFL array. |
|
115 |
+ */ |
|
116 |
+ |
|
117 |
+ |
|
118 |
+/** |
|
119 |
+ * ------------------------------------------------------------------------- |
|
120 |
+ * FRONT END FORM FIELDS |
|
121 |
+ * ------------------------------------------------------------------------- |
|
122 |
+ * |
|
123 |
+ * List all form fields and their class names. |
|
124 |
+ * |
|
125 |
+ * $GLOBALS['TL_FFL'] = array |
|
126 |
+ * ( |
|
127 |
+ * 'input' => Class, |
|
128 |
+ * 'select' => Class |
|
129 |
+ * ); |
|
130 |
+ * |
|
131 |
+ * Use function array_insert() to modify an existing FFL array. |
|
132 |
+ */ |
|
133 |
+ |
|
134 |
+ |
|
135 |
+/** |
|
136 |
+ * ------------------------------------------------------------------------- |
|
137 |
+ * CACHE TABLES |
|
138 |
+ * ------------------------------------------------------------------------- |
|
139 |
+ * |
|
140 |
+ * These tables are used to cache data and can be truncated using back end |
|
141 |
+ * module "clear cache". |
|
142 |
+ * |
|
143 |
+ * $GLOBALS['TL_CACHE'] = array |
|
144 |
+ * ( |
|
145 |
+ * 'table_1', |
|
146 |
+ * 'table_2' |
|
147 |
+ * ); |
|
148 |
+ * |
|
149 |
+ * Use function array_insert() to modify an existing cache array. |
|
150 |
+ */ |
|
151 |
+ |
|
152 |
+ |
|
153 |
+/** |
|
154 |
+ * ------------------------------------------------------------------------- |
|
155 |
+ * HOOKS |
|
156 |
+ * ------------------------------------------------------------------------- |
|
157 |
+ * |
|
158 |
+ * Hooking allows you to register one or more callback functions that are |
|
159 |
+ * called on a particular event in a specific order. Thus, third party |
|
160 |
+ * extensions can add functionality to the core system without having to |
|
161 |
+ * modify the source code. |
|
162 |
+ * |
|
163 |
+ * $GLOBALS['TL_HOOKS'] = array |
|
164 |
+ * ( |
|
165 |
+ * 'hook_1' => array |
|
166 |
+ * ( |
|
167 |
+ * array('Class', 'Method'), |
|
168 |
+ * array('Class', 'Method') |
|
169 |
+ * ) |
|
170 |
+ * ); |
|
171 |
+ * |
|
172 |
+ * Use function array_insert() to modify an existing hooks array. |
|
173 |
+ */ |
|
174 |
+$GLOBALS['TL_HOOKS']['generatePage'][] = array('LegalAgeCheck', 'performAgeCheck'); |
|
175 |
+$GLOBALS['TL_HOOKS']['dispatchAjax'][] = array('LegalAgeCheck', 'ajaxUnlockPage'); |
|
176 |
+ |
|
177 |
+/** |
|
178 |
+ * ------------------------------------------------------------------------- |
|
179 |
+ * PAGE TYPES |
|
180 |
+ * ------------------------------------------------------------------------- |
|
181 |
+ * |
|
182 |
+ * Page types and their corresponding front end controller class. |
|
183 |
+ * |
|
184 |
+ * $GLOBALS['TL_PTY'] = array |
|
185 |
+ * ( |
|
186 |
+ * 'type_1' => 'PageType1', |
|
187 |
+ * 'type_2' => 'PageType2' |
|
188 |
+ * ); |
|
189 |
+ * |
|
190 |
+ * Use function array_insert() to modify an existing page types array. |
|
191 |
+ */ |
|
192 |
+ |
|
193 |
+?> |
|
0 | 194 |
\ No newline at end of file |
1 | 195 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,21 @@ |
1 |
+-- ******************************************************** |
|
2 |
+-- * * |
|
3 |
+-- * IMPORTANT NOTE * |
|
4 |
+-- * * |
|
5 |
+-- * Do not import this file manually but use the Contao * |
|
6 |
+-- * install tool to create and maintain database tables! * |
|
7 |
+-- * * |
|
8 |
+-- ******************************************************** |
|
9 |
+ |
|
10 |
+ |
|
11 |
+-- -------------------------------------------------------- |
|
12 |
+ |
|
13 |
+-- |
|
14 |
+-- Table `tl_page` |
|
15 |
+-- |
|
16 |
+ |
|
17 |
+CREATE TABLE `tl_page` ( |
|
18 |
+ `es_ext_agecheck` char(1) NOT NULL default '', |
|
19 |
+ `es_ext_agecheck_exitPage` int(10) unsigned NOT NULL default '0', |
|
20 |
+ `es_ext_agecheck_ignorePage` char(1) NOT NULL default '', |
|
21 |
+) ENGINE=MyISAM DEFAULT CHARSET=utf8; |
|
0 | 22 |
\ No newline at end of file |
1 | 4 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,63 @@ |
1 |
+<?php if (!defined('TL_ROOT')) die('You can not access this file directly!'); |
|
2 |
+ |
|
3 |
+/** |
|
4 |
+ * Contao Open Source CMS |
|
5 |
+ * Copyright (C) 2005-2011 Leo Feyer |
|
6 |
+ * |
|
7 |
+ * Formerly known as TYPOlight Open Source CMS. |
|
8 |
+ * |
|
9 |
+ * This program is free software: you can redistribute it and/or |
|
10 |
+ * modify it under the terms of the GNU Lesser General Public |
|
11 |
+ * License as published by the Free Software Foundation, either |
|
12 |
+ * version 3 of the License, or (at your option) any later version. |
|
13 |
+ * |
|
14 |
+ * This program is distributed in the hope that it will be useful, |
|
15 |
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
16 |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
17 |
+ * Lesser General Public License for more details. |
|
18 |
+ * |
|
19 |
+ * You should have received a copy of the GNU Lesser General Public |
|
20 |
+ * License along with this program. If not, please visit the Free |
|
21 |
+ * Software Foundation website at <http://www.gnu.org/licenses/>. |
|
22 |
+ * |
|
23 |
+ * PHP version 5 |
|
24 |
+ * @copyright eSales Media 2012 |
|
25 |
+ * @author Benjamin Roth <www.esales-media.de> |
|
26 |
+ * @package legalAgeCheck |
|
27 |
+ * @license GNU/LGPL |
|
28 |
+ * @filesource |
|
29 |
+ */ |
|
30 |
+ |
|
31 |
+ |
|
32 |
+/** |
|
33 |
+ * Palettes |
|
34 |
+ */ |
|
35 |
+$GLOBALS['TL_DCA']['tl_page']['palettes']['root'] = str_replace('{meta_legend}', '{agecheck_legend:hide},es_ext_agecheck;{meta_legend}',$GLOBALS['TL_DCA']['tl_page']['palettes']['root']); |
|
36 |
+$GLOBALS['TL_DCA']['tl_page']['palettes']['regular'] = str_replace('{meta_legend}', '{agecheck_legend:hide},es_ext_agecheck_ignorePage;{meta_legend}',$GLOBALS['TL_DCA']['tl_page']['palettes']['regular']); |
|
37 |
+$GLOBALS['TL_DCA']['tl_page']['palettes']['__selector__'][] = 'es_ext_agecheck'; |
|
38 |
+$GLOBALS['TL_DCA']['tl_page']['subpalettes']['es_ext_agecheck'] = 'es_ext_agecheck_exitPage'; |
|
39 |
+/** |
|
40 |
+ * Fields |
|
41 |
+ */ |
|
42 |
+$GLOBALS['TL_DCA']['tl_page']['fields']['es_ext_agecheck'] = array |
|
43 |
+( |
|
44 |
+ 'label' => &$GLOBALS['TL_LANG']['tl_page']['es_ext_agecheck'], |
|
45 |
+ 'exclude' => true, |
|
46 |
+ 'inputType' => 'checkbox', |
|
47 |
+ 'eval' => array('submitOnChange'=>true) |
|
48 |
+); |
|
49 |
+ |
|
50 |
+$GLOBALS['TL_DCA']['tl_page']['fields']['es_ext_agecheck_exitPage'] = array |
|
51 |
+( |
|
52 |
+ 'label' => &$GLOBALS['TL_LANG']['tl_page']['es_ext_agecheck_exitPage'], |
|
53 |
+ 'exclude' => true, |
|
54 |
+ 'inputType' => 'pageTree', |
|
55 |
+ 'eval' => array('fieldType'=>'radio', 'mandatory'=>true) |
|
56 |
+); |
|
57 |
+ |
|
58 |
+$GLOBALS['TL_DCA']['tl_page']['fields']['es_ext_agecheck_ignorePage'] = array |
|
59 |
+( |
|
60 |
+ 'label' => &$GLOBALS['TL_LANG']['tl_page']['es_ext_agecheck_ignorePage'], |
|
61 |
+ 'exclude' => true, |
|
62 |
+ 'inputType' => 'checkbox' |
|
63 |
+); |
|
0 | 64 |
\ No newline at end of file |
1 | 4 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,40 @@ |
1 |
+<?php if (!defined('TL_ROOT')) die('You cannot access this file directly!'); |
|
2 |
+ |
|
3 |
+/** |
|
4 |
+ * Contao Open Source CMS |
|
5 |
+ * Copyright (C) 2005-2011 Leo Feyer |
|
6 |
+ * |
|
7 |
+ * Formerly known as TYPOlight Open Source CMS. |
|
8 |
+ * |
|
9 |
+ * This program is free software: you can redistribute it and/or |
|
10 |
+ * modify it under the terms of the GNU Lesser General Public |
|
11 |
+ * License as published by the Free Software Foundation, either |
|
12 |
+ * version 3 of the License, or (at your option) any later version. |
|
13 |
+ * |
|
14 |
+ * This program is distributed in the hope that it will be useful, |
|
15 |
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
16 |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
17 |
+ * Lesser General Public License for more details. |
|
18 |
+ * |
|
19 |
+ * You should have received a copy of the GNU Lesser General Public |
|
20 |
+ * License along with this program. If not, please visit the Free |
|
21 |
+ * Software Foundation website at <http://www.gnu.org/licenses/>. |
|
22 |
+ * |
|
23 |
+ * PHP version 5 |
|
24 |
+ * @copyright eSales Media 2012 |
|
25 |
+ * @author Benjamin Roth <www.esales-media.de> |
|
26 |
+ * @package legalAgeCheck |
|
27 |
+ * @license GNU/LGPL |
|
28 |
+ * @filesource |
|
29 |
+ */ |
|
30 |
+ |
|
31 |
+ |
|
32 |
+/** |
|
33 |
+ * Miscellaneous |
|
34 |
+ */ |
|
35 |
+$GLOBALS['TL_LANG']['MSC']['es_legalagecheck']['title'] = 'Altersprüfung'; |
|
36 |
+$GLOBALS['TL_LANG']['MSC']['es_legalagecheck']['text'] = 'Sind Sie schon 18 Jahre und älter?'; |
|
37 |
+$GLOBALS['TL_LANG']['MSC']['es_legalagecheck']['over_18'] = 'Ja, ich bin über 18'; |
|
38 |
+$GLOBALS['TL_LANG']['MSC']['es_legalagecheck']['under_18'] = 'Nein'; |
|
39 |
+ |
|
40 |
+?> |
|
0 | 41 |
\ No newline at end of file |
1 | 42 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,43 @@ |
1 |
+<?php if (!defined('TL_ROOT')) die('You cannot access this file directly!'); |
|
2 |
+ |
|
3 |
+/** |
|
4 |
+ * Contao Open Source CMS |
|
5 |
+ * Copyright (C) 2005-2011 Leo Feyer |
|
6 |
+ * |
|
7 |
+ * Formerly known as TYPOlight Open Source CMS. |
|
8 |
+ * |
|
9 |
+ * This program is free software: you can redistribute it and/or |
|
10 |
+ * modify it under the terms of the GNU Lesser General Public |
|
11 |
+ * License as published by the Free Software Foundation, either |
|
12 |
+ * version 3 of the License, or (at your option) any later version. |
|
13 |
+ * |
|
14 |
+ * This program is distributed in the hope that it will be useful, |
|
15 |
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
16 |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
17 |
+ * Lesser General Public License for more details. |
|
18 |
+ * |
|
19 |
+ * You should have received a copy of the GNU Lesser General Public |
|
20 |
+ * License along with this program. If not, please visit the Free |
|
21 |
+ * Software Foundation website at <http://www.gnu.org/licenses/>. |
|
22 |
+ * |
|
23 |
+ * PHP version 5 |
|
24 |
+ * @copyright eSales Media 2012 |
|
25 |
+ * @author Benjamin Roth <www.esales-media.de> |
|
26 |
+ * @package legalAgeCheck |
|
27 |
+ * @license GNU/LGPL |
|
28 |
+ * @filesource |
|
29 |
+ */ |
|
30 |
+ |
|
31 |
+ |
|
32 |
+/** |
|
33 |
+ * Back end modules |
|
34 |
+ */ |
|
35 |
+$GLOBALS['TL_LANG']['MOD'][''] = array('', ''); |
|
36 |
+ |
|
37 |
+ |
|
38 |
+/** |
|
39 |
+ * Front end modules |
|
40 |
+ */ |
|
41 |
+$GLOBALS['TL_LANG']['FMD'][''] = array('', ''); |
|
42 |
+ |
|
43 |
+?> |
|
0 | 44 |
\ No newline at end of file |
1 | 45 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,51 @@ |
1 |
+<?php if (!defined('TL_ROOT')) die('You cannot access this file directly!'); |
|
2 |
+ |
|
3 |
+/** |
|
4 |
+ * Contao Open Source CMS |
|
5 |
+ * Copyright (C) 2005-2011 Leo Feyer |
|
6 |
+ * |
|
7 |
+ * Formerly known as TYPOlight Open Source CMS. |
|
8 |
+ * |
|
9 |
+ * This program is free software: you can redistribute it and/or |
|
10 |
+ * modify it under the terms of the GNU Lesser General Public |
|
11 |
+ * License as published by the Free Software Foundation, either |
|
12 |
+ * version 3 of the License, or (at your option) any later version. |
|
13 |
+ * |
|
14 |
+ * This program is distributed in the hope that it will be useful, |
|
15 |
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
16 |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
17 |
+ * Lesser General Public License for more details. |
|
18 |
+ * |
|
19 |
+ * You should have received a copy of the GNU Lesser General Public |
|
20 |
+ * License along with this program. If not, please visit the Free |
|
21 |
+ * Software Foundation website at <http://www.gnu.org/licenses/>. |
|
22 |
+ * |
|
23 |
+ * PHP version 5 |
|
24 |
+ * @copyright eSales Media 2012 |
|
25 |
+ * @author Benjamin Roth <www.esales-media.de> |
|
26 |
+ * @package legalAgeCheck |
|
27 |
+ * @license GNU/LGPL |
|
28 |
+ * @filesource |
|
29 |
+ */ |
|
30 |
+ |
|
31 |
+ |
|
32 |
+/** |
|
33 |
+ * Fields |
|
34 |
+ */ |
|
35 |
+$GLOBALS['TL_LANG']['tl_page']['es_ext_agecheck'] = array('Altersabfrage', 'Es erscheint eine Dialogbox mit der Frage, ob der User schon Volljährig ist.'); |
|
36 |
+$GLOBALS['TL_LANG']['tl_page']['es_ext_agecheck_exitPage'] = array('Ausstiegs-/Fallbackseite', 'Seite, die geladen werden soll, wenn der User noch nicht volljährig ist, oder Javascript deaktiviert ist.'); |
|
37 |
+$GLOBALS['TL_LANG']['tl_page']['es_ext_agecheck_ignorePage'] = array('Alterscheck ignorieren', 'Keine Altersabfrage auf dieser Seite, falls aktiviert.'); |
|
38 |
+ |
|
39 |
+ |
|
40 |
+/** |
|
41 |
+ * Reference |
|
42 |
+ */ |
|
43 |
+$GLOBALS['TL_LANG']['tl_page'][''] = ''; |
|
44 |
+ |
|
45 |
+/** |
|
46 |
+ * Legends |
|
47 |
+ */ |
|
48 |
+$GLOBALS['TL_LANG']['tl_page']['agecheck_legend'] = 'Altersabfrage'; |
|
49 |
+ |
|
50 |
+ |
|
51 |
+?> |
|
0 | 52 |
\ No newline at end of file |
1 | 4 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,37 @@ |
1 |
+<?php if (!defined('TL_ROOT')) die('You cannot access this file directly!'); |
|
2 |
+ |
|
3 |
+/** |
|
4 |
+ * Contao Open Source CMS |
|
5 |
+ * Copyright (C) 2005-2011 Leo Feyer |
|
6 |
+ * |
|
7 |
+ * Formerly known as TYPOlight Open Source CMS. |
|
8 |
+ * |
|
9 |
+ * This program is free software: you can redistribute it and/or |
|
10 |
+ * modify it under the terms of the GNU Lesser General Public |
|
11 |
+ * License as published by the Free Software Foundation, either |
|
12 |
+ * version 3 of the License, or (at your option) any later version. |
|
13 |
+ * |
|
14 |
+ * This program is distributed in the hope that it will be useful, |
|
15 |
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
16 |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
17 |
+ * Lesser General Public License for more details. |
|
18 |
+ * |
|
19 |
+ * You should have received a copy of the GNU Lesser General Public |
|
20 |
+ * License along with this program. If not, please visit the Free |
|
21 |
+ * Software Foundation website at <http://www.gnu.org/licenses/>. |
|
22 |
+ * |
|
23 |
+ * PHP version 5 |
|
24 |
+ * @copyright eSales Media 2012 |
|
25 |
+ * @author Benjamin Roth <www.esales-media.de> |
|
26 |
+ * @package Language |
|
27 |
+ * @license Commercial |
|
28 |
+ * @filesource |
|
29 |
+ */ |
|
30 |
+ |
|
31 |
+ |
|
32 |
+/** |
|
33 |
+ * Miscellaneous |
|
34 |
+ */ |
|
35 |
+$GLOBALS['TL_LANG']['MSC'][''] = ''; |
|
36 |
+ |
|
37 |
+?> |
|
0 | 38 |
\ No newline at end of file |
1 | 39 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,43 @@ |
1 |
+<?php if (!defined('TL_ROOT')) die('You cannot access this file directly!'); |
|
2 |
+ |
|
3 |
+/** |
|
4 |
+ * Contao Open Source CMS |
|
5 |
+ * Copyright (C) 2005-2011 Leo Feyer |
|
6 |
+ * |
|
7 |
+ * Formerly known as TYPOlight Open Source CMS. |
|
8 |
+ * |
|
9 |
+ * This program is free software: you can redistribute it and/or |
|
10 |
+ * modify it under the terms of the GNU Lesser General Public |
|
11 |
+ * License as published by the Free Software Foundation, either |
|
12 |
+ * version 3 of the License, or (at your option) any later version. |
|
13 |
+ * |
|
14 |
+ * This program is distributed in the hope that it will be useful, |
|
15 |
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
16 |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
17 |
+ * Lesser General Public License for more details. |
|
18 |
+ * |
|
19 |
+ * You should have received a copy of the GNU Lesser General Public |
|
20 |
+ * License along with this program. If not, please visit the Free |
|
21 |
+ * Software Foundation website at <http://www.gnu.org/licenses/>. |
|
22 |
+ * |
|
23 |
+ * PHP version 5 |
|
24 |
+ * @copyright eSales Media 2012 |
|
25 |
+ * @author Benjamin Roth <www.esales-media.de> |
|
26 |
+ * @package Paketname |
|
27 |
+ * @license Commercial |
|
28 |
+ * @filesource |
|
29 |
+ */ |
|
30 |
+ |
|
31 |
+ |
|
32 |
+/** |
|
33 |
+ * Back end modules |
|
34 |
+ */ |
|
35 |
+$GLOBALS['TL_LANG']['MOD'][''] = array('', ''); |
|
36 |
+ |
|
37 |
+ |
|
38 |
+/** |
|
39 |
+ * Front end modules |
|
40 |
+ */ |
|
41 |
+$GLOBALS['TL_LANG']['FMD'][''] = array('', ''); |
|
42 |
+ |
|
43 |
+?> |
|
0 | 44 |
\ No newline at end of file |
1 | 45 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,53 @@ |
1 |
+<?php if (!defined('TL_ROOT')) die('You cannot access this file directly!'); |
|
2 |
+ |
|
3 |
+/** |
|
4 |
+ * Contao Open Source CMS |
|
5 |
+ * Copyright (C) 2005-2011 Leo Feyer |
|
6 |
+ * |
|
7 |
+ * Formerly known as TYPOlight Open Source CMS. |
|
8 |
+ * |
|
9 |
+ * This program is free software: you can redistribute it and/or |
|
10 |
+ * modify it under the terms of the GNU Lesser General Public |
|
11 |
+ * License as published by the Free Software Foundation, either |
|
12 |
+ * version 3 of the License, or (at your option) any later version. |
|
13 |
+ * |
|
14 |
+ * This program is distributed in the hope that it will be useful, |
|
15 |
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
16 |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
17 |
+ * Lesser General Public License for more details. |
|
18 |
+ * |
|
19 |
+ * You should have received a copy of the GNU Lesser General Public |
|
20 |
+ * License along with this program. If not, please visit the Free |
|
21 |
+ * Software Foundation website at <http://www.gnu.org/licenses/>. |
|
22 |
+ * |
|
23 |
+ * PHP version 5 |
|
24 |
+ * @copyright eSales Media 2012 |
|
25 |
+ * @author Benjamin Roth <www.esales-media.de> |
|
26 |
+ * @package Paketname |
|
27 |
+ * @license Commercial |
|
28 |
+ * @filesource |
|
29 |
+ */ |
|
30 |
+ |
|
31 |
+ |
|
32 |
+/** |
|
33 |
+ * Fields |
|
34 |
+ */ |
|
35 |
+$GLOBALS['TL_LANG']['tl_skeleton'][''] = array('', ''); |
|
36 |
+ |
|
37 |
+ |
|
38 |
+/** |
|
39 |
+ * Reference |
|
40 |
+ */ |
|
41 |
+$GLOBALS['TL_LANG']['tl_skeleton'][''] = ''; |
|
42 |
+ |
|
43 |
+ |
|
44 |
+/** |
|
45 |
+ * Buttons |
|
46 |
+ */ |
|
47 |
+$GLOBALS['TL_LANG']['tl_skeleton']['new'] = array('', ''); |
|
48 |
+$GLOBALS['TL_LANG']['tl_skeleton']['edit'] = array('', ''); |
|
49 |
+$GLOBALS['TL_LANG']['tl_skeleton']['copy'] = array('', ''); |
|
50 |
+$GLOBALS['TL_LANG']['tl_skeleton']['delete'] = array('', ''); |
|
51 |
+$GLOBALS['TL_LANG']['tl_skeleton']['show'] = array('', ''); |
|
52 |
+ |
|
53 |
+?> |
|
0 | 54 |
\ No newline at end of file |
1 | 4 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,24 @@ |
1 |
+<script> |
|
2 |
+ |
|
3 |
+ var comPromo = vex.dialog.open({ |
|
4 |
+ message: '<h1 class="vex-header"><?php echo $this->title; ?></h1>' + |
|
5 |
+ '<?php echo $this->text; ?>', |
|
6 |
+ overlayClosesOnClick: false, |
|
7 |
+ escapeButtonCloses: false, |
|
8 |
+ buttons: [{text: '<?php echo $this->btn_over_18; ?>',type: 'button',className: 'vex-dialog-button-primary',click: function(vexContent, event) { |
|
9 |
+ $.ajax({ |
|
10 |
+ url: '<?php echo $this->commitURL; ?>', |
|
11 |
+ type: 'GET', |
|
12 |
+ dataType: 'json', |
|
13 |
+ success: function (data) { |
|
14 |
+ if (data.status == 'OK') |
|
15 |
+ { |
|
16 |
+ return vex.close(vexContent.data().vex.id); |
|
17 |
+ } |
|
18 |
+ } |
|
19 |
+ }); |
|
20 |
+ }}, {text: '<?php echo $this->btn_under_18; ?>',type: 'button',className: 'vex-dialog-button-secondary',click: function(vexContent, event) { window.location = '<?php echo $this->exitPageURL; ?>'}}] |
|
21 |
+ }); |
|
22 |
+ |
|
23 |
+ |
|
24 |
+</script> |
|
0 | 25 |
\ No newline at end of file |