1 | 1 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,93 @@ |
1 |
+<?php |
|
2 |
+ |
|
3 |
+/** |
|
4 |
+ * JustifiedGallery for Contao |
|
5 |
+ * |
|
6 |
+ * Copyright (c) 2016 Benjamin Roth |
|
7 |
+ * |
|
8 |
+ * @license LGPL-3.0+ |
|
9 |
+ */ |
|
10 |
+ |
|
11 |
+ |
|
12 |
+/** |
|
13 |
+ * Table tl_content |
|
14 |
+ */ |
|
15 |
+ |
|
16 |
+/** |
|
17 |
+ * Add palettes to tl_content |
|
18 |
+ */ |
|
19 |
+$GLOBALS['TL_DCA']['tl_content']['palettes']['__selector__'][] = 'eSM_jg_enable'; |
|
20 |
+$GLOBALS['TL_DCA']['tl_content']['palettes']['gallery'] = str_replace(array('{template_legend}','{template_legend:hide}'), array('{justifiedGallery_legend:hide},eSM_jg_enable;{template_legend}','{justifiedGallery_legend:hide},eSM_jg_enable;{template_legend:hide}'), $GLOBALS['TL_DCA']['tl_content']['palettes']['gallery']); |
|
21 |
+ |
|
22 |
+/** |
|
23 |
+ * Add subpalettes to tl_content |
|
24 |
+ */ |
|
25 |
+$GLOBALS['TL_DCA']['tl_content']['subpalettes']['eSM_jg_enable'] = 'eSM_jg_height,eSM_jg_fixedHeight,eSM_jg_maxHeight,eSM_jg_margins,eSM_jg_captions,eSM_jg_waitLoaded'; |
|
26 |
+ |
|
27 |
+/** |
|
28 |
+ * Add fields to tl_content |
|
29 |
+ */ |
|
30 |
+ |
|
31 |
+$GLOBALS['TL_DCA']['tl_content']['fields']['eSM_jg_enable'] = array |
|
32 |
+( |
|
33 |
+ 'label' => &$GLOBALS['TL_LANG']['tl_content']['eSM_jg_enable'], |
|
34 |
+ 'exclude' => true, |
|
35 |
+ 'inputType' => 'checkbox', |
|
36 |
+ 'eval' => array('tl_class'=>'','submitOnChange'=>true), |
|
37 |
+ 'sql' => "char(1) NOT NULL default ''" |
|
38 |
+); |
|
39 |
+ |
|
40 |
+$GLOBALS['TL_DCA']['tl_content']['fields']['eSM_jg_fixedHeight'] = array |
|
41 |
+( |
|
42 |
+ 'label' => &$GLOBALS['TL_LANG']['tl_content']['eSM_jg_fixedHeight'], |
|
43 |
+ 'exclude' => true, |
|
44 |
+ 'inputType' => 'checkbox', |
|
45 |
+ 'eval' => array('tl_class'=>'w50 m12'), |
|
46 |
+ 'sql' => "char(1) NOT NULL default ''" |
|
47 |
+); |
|
48 |
+ |
|
49 |
+$GLOBALS['TL_DCA']['tl_content']['fields']['eSM_jg_height'] = array |
|
50 |
+( |
|
51 |
+ 'label' => &$GLOBALS['TL_LANG']['tl_content']['eSM_jg_height'], |
|
52 |
+ 'exclude' => true, |
|
53 |
+ 'inputType' => 'text', |
|
54 |
+ 'eval' => array('tl_class'=>'w50','rgxp'=>'natural'), |
|
55 |
+ 'sql' => "int(10) unsigned NOT NULL default '0'" |
|
56 |
+); |
|
57 |
+ |
|
58 |
+$GLOBALS['TL_DCA']['tl_content']['fields']['eSM_jg_maxHeight'] = array |
|
59 |
+( |
|
60 |
+ 'label' => &$GLOBALS['TL_LANG']['tl_content']['eSM_jg_maxHeight'], |
|
61 |
+ 'exclude' => true, |
|
62 |
+ 'inputType' => 'inputUnit', |
|
63 |
+ 'options' => array('px','%'), |
|
64 |
+ 'eval' => array('rgxp'=>'natural', 'tl_class'=>'w50'), |
|
65 |
+ 'sql' => "varchar(64) NOT NULL default ''" |
|
66 |
+); |
|
67 |
+ |
|
68 |
+$GLOBALS['TL_DCA']['tl_content']['fields']['eSM_jg_margins'] = array |
|
69 |
+( |
|
70 |
+ 'label' => &$GLOBALS['TL_LANG']['tl_content']['eSM_jg_margins'], |
|
71 |
+ 'exclude' => true, |
|
72 |
+ 'inputType' => 'text', |
|
73 |
+ 'eval' => array('tl_class'=>'w50','rgxp'=>'natural'), |
|
74 |
+ 'sql' => "int(10) unsigned NOT NULL default '5'" |
|
75 |
+); |
|
76 |
+ |
|
77 |
+$GLOBALS['TL_DCA']['tl_content']['fields']['eSM_jg_captions'] = array |
|
78 |
+( |
|
79 |
+ 'label' => &$GLOBALS['TL_LANG']['tl_content']['eSM_jg_captions'], |
|
80 |
+ 'exclude' => true, |
|
81 |
+ 'inputType' => 'checkbox', |
|
82 |
+ 'eval' => array('tl_class'=>'w50 m12'), |
|
83 |
+ 'sql' => "char(1) NOT NULL default ''" |
|
84 |
+); |
|
85 |
+ |
|
86 |
+$GLOBALS['TL_DCA']['tl_content']['fields']['eSM_jg_waitLoaded'] = array |
|
87 |
+( |
|
88 |
+ 'label' => &$GLOBALS['TL_LANG']['tl_content']['eSM_jg_waitLoaded'], |
|
89 |
+ 'exclude' => true, |
|
90 |
+ 'inputType' => 'checkbox', |
|
91 |
+ 'eval' => array('tl_class'=>'w50 m12'), |
|
92 |
+ 'sql' => "char(1) NOT NULL default '1'" |
|
93 |
+); |