... | ... |
@@ -14,12 +14,11 @@ use Contao\CoreBundle\DataContainer\PaletteManipulator; |
14 | 14 |
* Palettes |
15 | 15 |
*/ |
16 | 16 |
|
17 |
-//$GLOBALS['TL_DCA']['tl_news']['palettes']['default'] = str_replace(array('{publish_legend}','{publish_legend:hide}'),array('{nc_legend:hide},nc_sent,nc_testmail;{publish_legend}','{nc_legend:hide},nc_sent,nc_testmail;{publish_legend:hide}'),$GLOBALS['TL_DCA']['tl_news']['palettes']['default']); |
|
18 | 17 |
PaletteManipulator::create() |
19 |
- ->addLegend('nc_legend','publish_legend',PaletteManipulator::POSITION_BEFORE) |
|
20 |
- ->addField('nc_sent','nc_legend', PaletteManipulator::POSITION_APPEND) |
|
21 |
- ->addField('nc_testmail','nc_legend', PaletteManipulator::POSITION_APPEND) |
|
22 |
- ->applyToPalette('default','tl_news') |
|
18 |
+ ->addLegend('nc_legend','contact_legend') |
|
19 |
+ ->addField('nc_news_subscribe','nc_legend', PaletteManipulator::POSITION_APPEND) |
|
20 |
+ ->addField('nc_news_additionalEmail','nc_legend', PaletteManipulator::POSITION_APPEND) |
|
21 |
+ ->applyToPalette('default','tl_member') |
|
23 | 22 |
; |
24 | 23 |
|
25 | 24 |
/** |
... | ... |
@@ -31,10 +30,6 @@ $GLOBALS['TL_DCA']['tl_member']['fields']['nc_news_subscribe'] = array |
31 | 30 |
'exclude' => true, |
32 | 31 |
'inputType' => 'checkbox', |
33 | 32 |
'eval' => array('tl_class'=>'w50 m12', 'doNotCopy'=>true, 'feEditable'=>true, 'feViewable'=>true, 'feGroup'=>'contact'), |
34 |
- 'save_callback' => array |
|
35 |
- ( |
|
36 |
- array('tl_member_eSM_nc_news', 'setNcNewsChangedate'), |
|
37 |
- ), |
|
38 | 33 |
'sql' => "char(1) NOT NULL default '1'" |
39 | 34 |
); |
40 | 35 |
|
1 | 1 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,54 @@ |
1 |
+<?php |
|
2 |
+ |
|
3 |
+/* |
|
4 |
+ * This file is part of newsmailer bundle for Contao. |
|
5 |
+ * |
|
6 |
+ * (c) Benjamin Roth |
|
7 |
+ * |
|
8 |
+ * @license LGPL-3.0-or-later |
|
9 |
+ */ |
|
10 |
+ |
|
11 |
+use Contao\CoreBundle\DataContainer\PaletteManipulator; |
|
12 |
+ |
|
13 |
+/** |
|
14 |
+ * Palettes |
|
15 |
+ */ |
|
16 |
+ |
|
17 |
+//$GLOBALS['TL_DCA']['tl_news']['palettes']['default'] = str_replace(array('{publish_legend}','{publish_legend:hide}'),array('{nc_legend:hide},nc_sent,nc_testmail;{publish_legend}','{nc_legend:hide},nc_sent,nc_testmail;{publish_legend:hide}'),$GLOBALS['TL_DCA']['tl_news']['palettes']['default']); |
|
18 |
+PaletteManipulator::create() |
|
19 |
+ ->addLegend('nc_legend','publish_legend',PaletteManipulator::POSITION_BEFORE) |
|
20 |
+ ->addField('nc_sent','nc_legend', PaletteManipulator::POSITION_APPEND) |
|
21 |
+ ->addField('nc_testmail','nc_legend', PaletteManipulator::POSITION_APPEND) |
|
22 |
+ ->applyToPalette('default','tl_news') |
|
23 |
+; |
|
24 |
+ |
|
25 |
+/** |
|
26 |
+ * Fields |
|
27 |
+ */ |
|
28 |
+ |
|
29 |
+$GLOBALS['TL_DCA']['tl_member']['fields']['nc_news_subscribe'] = array |
|
30 |
+( |
|
31 |
+ 'exclude' => true, |
|
32 |
+ 'inputType' => 'checkbox', |
|
33 |
+ 'eval' => array('tl_class'=>'w50 m12', 'doNotCopy'=>true, 'feEditable'=>true, 'feViewable'=>true, 'feGroup'=>'contact'), |
|
34 |
+ 'save_callback' => array |
|
35 |
+ ( |
|
36 |
+ array('tl_member_eSM_nc_news', 'setNcNewsChangedate'), |
|
37 |
+ ), |
|
38 |
+ 'sql' => "char(1) NOT NULL default '1'" |
|
39 |
+); |
|
40 |
+ |
|
41 |
+$GLOBALS['TL_DCA']['tl_member']['fields']['nc_news_subscribe_changed'] = array |
|
42 |
+( |
|
43 |
+ 'eval' => array('rgxp'=>'datim'), |
|
44 |
+ 'sql' => "int(10) unsigned NOT NULL default '0'" |
|
45 |
+); |
|
46 |
+ |
|
47 |
+$GLOBALS['TL_DCA']['tl_member']['fields']['nc_news_additionalEmail'] = array |
|
48 |
+( |
|
49 |
+ 'exclude' => true, |
|
50 |
+ 'search' => true, |
|
51 |
+ 'inputType' => 'text', |
|
52 |
+ 'eval' => array('mandatory'=>false, 'maxlength'=>1022, 'rgxp'=>'emails', 'tl_class'=>'w50', 'feEditable'=>true, 'feViewable'=>true, 'feGroup'=>'contact'), |
|
53 |
+ 'sql' => "varchar(1022) NOT NULL default ''" |
|
54 |
+); |