... | ... |
@@ -24,15 +24,17 @@ $GLOBALS['TL_DCA']['tl_content']['config']['onsubmit_callback'][] = array('tl_co |
24 | 24 |
*/ |
25 | 25 |
$GLOBALS['TL_DCA']['tl_content']['palettes']['__selector__'][] = 'eSM_addImage'; |
26 | 26 |
$GLOBALS['TL_DCA']['tl_content']['palettes']['__selector__'][] = 'eSM_addText'; |
27 |
+$GLOBALS['TL_DCA']['tl_content']['palettes']['__selector__'][] = 'eSM_slick_addImageLink'; |
|
27 | 28 |
$GLOBALS['TL_DCA']['tl_content']['palettes']['slickSliderStart'] = '{type_legend},type;{slickSlider_legend},eSM_slick_autoPlaySpeed,eSM_slick_speed,eSM_slick_initialSlide,eSM_slick_lazyLoad,eSM_slick_slidesToShow,eSM_slick_slidesToScroll,eSM_slick_infinite,eSM_slick_arrows,eSM_slick_pagination,eSM_slick_pause,eSM_slick_fade,eSM_slick_adaptiveHeight;{image_legend},eSM_addImage;{template_legend:hide},customTpl;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID,space;{invisible_legend:hide},invisible,start,stop'; |
28 | 29 |
$GLOBALS['TL_DCA']['tl_content']['palettes']['slickSliderStop'] = '{type_legend},type;{template_legend:hide},customTpl;{protected_legend:hide},protected;{expert_legend:hide},guests;{invisible_legend:hide},invisible,start,stop'; |
29 | 30 |
$GLOBALS['TL_DCA']['tl_content']['palettes']['slickSliderSlideStart'] = '{type_legend},type;{slickSlider_legend},eSM_addImage;{template_legend:hide},customTpl;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID,space;{invisible_legend:hide},invisible,start,stop'; |
30 | 31 |
$GLOBALS['TL_DCA']['tl_content']['palettes']['slickSliderSlideStop'] = '{type_legend},type;{template_legend:hide},customTpl;{protected_legend:hide},protected;{expert_legend:hide},guests;{invisible_legend:hide},invisible,start,stop'; |
31 |
-$GLOBALS['TL_DCA']['tl_content']['palettes']['slickSliderImage'] = '{type_legend},type;{slickSlider_legend},multiSRC,size,eSM_slick_bgSize,eSM_slick_bgPosition,eSM_slick_minHeight,eSM_slick_bgOpacity,eSM_slick_bgRepeat,eSM_addText;{template_legend:hide},customTpl;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID,space;{invisible_legend:hide},invisible,start,stop'; |
|
32 |
+$GLOBALS['TL_DCA']['tl_content']['palettes']['slickSliderImage'] = '{type_legend},type;{slickSlider_legend},multiSRC,size,eSM_slick_bgSize,eSM_slick_bgPosition,eSM_slick_minHeight,eSM_slick_bgOpacity,eSM_slick_bgRepeat,eSM_slick_addImageLink,eSM_addText;{template_legend:hide},customTpl;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID,space;{invisible_legend:hide},invisible,start,stop'; |
|
32 | 33 |
|
33 | 34 |
|
34 | 35 |
$GLOBALS['TL_DCA']['tl_content']['subpalettes']['eSM_addImage'] = 'multiSRC,size,eSM_slick_bgSize,eSM_slick_bgPosition,eSM_slick_minHeight,eSM_slick_bgOpacity,eSM_slick_bgRepeat'; |
35 | 36 |
$GLOBALS['TL_DCA']['tl_content']['subpalettes']['eSM_addText'] = 'eSM_slick_text,eSM_slick_url'; |
37 |
+$GLOBALS['TL_DCA']['tl_content']['subpalettes']['eSM_slick_addImageLink'] = 'imageUrl,fullsize'; |
|
36 | 38 |
|
37 | 39 |
/** |
38 | 40 |
* Add fields to tl_content |
... | ... |
@@ -186,7 +188,7 @@ $GLOBALS['TL_DCA']['tl_content']['fields']['eSM_addText'] = array |
186 | 188 |
'label' => &$GLOBALS['TL_LANG']['tl_content']['eSM_addText'], |
187 | 189 |
'exclude' => true, |
188 | 190 |
'inputType' => 'checkbox', |
189 |
- 'eval' => array('tl_class'=>'clr m12', 'submitOnChange'=>true), |
|
191 |
+ 'eval' => array('tl_class'=>'clr', 'submitOnChange'=>true), |
|
190 | 192 |
'sql' => "char(1) NOT NULL default ''" |
191 | 193 |
); |
192 | 194 |
|
... | ... |
@@ -199,6 +201,15 @@ $GLOBALS['TL_DCA']['tl_content']['fields']['eSM_slick_minHeight'] = array |
199 | 201 |
'sql' => "char(1) NOT NULL default ''" |
200 | 202 |
); |
201 | 203 |
|
204 |
+$GLOBALS['TL_DCA']['tl_content']['fields']['eSM_slick_addImageLink'] = array |
|
205 |
+( |
|
206 |
+ 'label' => &$GLOBALS['TL_LANG']['tl_content']['eSM_slick_addImageLink'], |
|
207 |
+ 'exclude' => true, |
|
208 |
+ 'inputType' => 'checkbox', |
|
209 |
+ 'eval' => array('tl_class'=>'clr w50','submitOnChange'=>true), |
|
210 |
+ 'sql' => "char(1) NOT NULL default ''" |
|
211 |
+); |
|
212 |
+ |
|
202 | 213 |
$GLOBALS['TL_DCA']['tl_content']['fields']['eSM_slick_bgPosition'] = array |
203 | 214 |
( |
204 | 215 |
'label' => &$GLOBALS['TL_LANG']['tl_content']['eSM_slick_bgPosition'], |
... | ... |
@@ -272,6 +272,9 @@ $GLOBALS['TL_DCA']['tl_content']['fields']['eSM_slick_bgOpacity'] = array |
272 | 272 |
'sql' => "varchar(16) NOT NULL default ''" |
273 | 273 |
); |
274 | 274 |
|
275 |
+$GLOBALS['TL_DCA']['tl_content']['fields']['multiSRC']['load_callback'][] = array('tl_content_eSM_slick', 'setMultiSrcFlags'); |
|
276 |
+ |
|
277 |
+ |
|
275 | 278 |
class tl_content_eSM_slick extends Backend |
276 | 279 |
{ |
277 | 280 |
|
... | ... |
@@ -371,4 +374,29 @@ class tl_content_eSM_slick extends Backend |
371 | 374 |
|
372 | 375 |
} |
373 | 376 |
} |
377 |
+ |
|
378 |
+ /** |
|
379 |
+ * Dynamically add flags to the "multiSRC" field |
|
380 |
+ * |
|
381 |
+ * @param mixed $varValue |
|
382 |
+ * @param Contao\DataContainer $dc |
|
383 |
+ * |
|
384 |
+ * @return mixed |
|
385 |
+ */ |
|
386 |
+ public function setMultiSrcFlags($varValue, Contao\DataContainer $dc) |
|
387 |
+ { |
|
388 |
+ if ($dc->activeRecord) |
|
389 |
+ { |
|
390 |
+ switch ($dc->activeRecord->type) |
|
391 |
+ { |
|
392 |
+ case 'slickSliderStart': |
|
393 |
+ case 'slickSliderSlideStart': |
|
394 |
+ case 'slickSliderImage': |
|
395 |
+ $GLOBALS['TL_DCA'][$dc->table]['fields'][$dc->field]['eval']['isGallery'] = true; |
|
396 |
+ $GLOBALS['TL_DCA'][$dc->table]['fields'][$dc->field]['eval']['extensions'] = Contao\Config::get('validImageTypes').'mp4,ogv,webm,mov'; |
|
397 |
+ break; |
|
398 |
+ } |
|
399 |
+ } |
|
400 |
+ return $varValue; |
|
401 |
+ } |
|
374 | 402 |
} |
375 | 403 |
\ No newline at end of file |
... | ... |
@@ -28,10 +28,10 @@ $GLOBALS['TL_DCA']['tl_content']['palettes']['slickSliderStart'] = '{type_legend |
28 | 28 |
$GLOBALS['TL_DCA']['tl_content']['palettes']['slickSliderStop'] = '{type_legend},type;{template_legend:hide},customTpl;{protected_legend:hide},protected;{expert_legend:hide},guests;{invisible_legend:hide},invisible,start,stop'; |
29 | 29 |
$GLOBALS['TL_DCA']['tl_content']['palettes']['slickSliderSlideStart'] = '{type_legend},type;{slickSlider_legend},eSM_addImage;{template_legend:hide},customTpl;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID,space;{invisible_legend:hide},invisible,start,stop'; |
30 | 30 |
$GLOBALS['TL_DCA']['tl_content']['palettes']['slickSliderSlideStop'] = '{type_legend},type;{template_legend:hide},customTpl;{protected_legend:hide},protected;{expert_legend:hide},guests;{invisible_legend:hide},invisible,start,stop'; |
31 |
-$GLOBALS['TL_DCA']['tl_content']['palettes']['slickSliderImage'] = '{type_legend},type;{slickSlider_legend},singleSRC,size,eSM_slick_bgSize,eSM_slick_bgPosition,eSM_slick_minHeight,eSM_slick_bgOpacity,eSM_slick_bgRepeat,eSM_addText;{template_legend:hide},customTpl;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID,space;{invisible_legend:hide},invisible,start,stop'; |
|
31 |
+$GLOBALS['TL_DCA']['tl_content']['palettes']['slickSliderImage'] = '{type_legend},type;{slickSlider_legend},multiSRC,size,eSM_slick_bgSize,eSM_slick_bgPosition,eSM_slick_minHeight,eSM_slick_bgOpacity,eSM_slick_bgRepeat,eSM_addText;{template_legend:hide},customTpl;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID,space;{invisible_legend:hide},invisible,start,stop'; |
|
32 | 32 |
|
33 | 33 |
|
34 |
-$GLOBALS['TL_DCA']['tl_content']['subpalettes']['eSM_addImage'] = 'singleSRC,size,eSM_slick_bgSize,eSM_slick_bgPosition,eSM_slick_minHeight,eSM_slick_bgOpacity,eSM_slick_bgRepeat'; |
|
34 |
+$GLOBALS['TL_DCA']['tl_content']['subpalettes']['eSM_addImage'] = 'multiSRC,size,eSM_slick_bgSize,eSM_slick_bgPosition,eSM_slick_minHeight,eSM_slick_bgOpacity,eSM_slick_bgRepeat'; |
|
35 | 35 |
$GLOBALS['TL_DCA']['tl_content']['subpalettes']['eSM_addText'] = 'eSM_slick_text,eSM_slick_url'; |
36 | 36 |
|
37 | 37 |
/** |
... | ... |
@@ -26,8 +26,8 @@ $GLOBALS['TL_DCA']['tl_content']['palettes']['__selector__'][] = 'eSM_addImage'; |
26 | 26 |
$GLOBALS['TL_DCA']['tl_content']['palettes']['__selector__'][] = 'eSM_addText'; |
27 | 27 |
$GLOBALS['TL_DCA']['tl_content']['palettes']['slickSliderStart'] = '{type_legend},type;{slickSlider_legend},eSM_slick_autoPlaySpeed,eSM_slick_speed,eSM_slick_initialSlide,eSM_slick_lazyLoad,eSM_slick_slidesToShow,eSM_slick_slidesToScroll,eSM_slick_infinite,eSM_slick_arrows,eSM_slick_pagination,eSM_slick_pause,eSM_slick_fade,eSM_slick_adaptiveHeight;{image_legend},eSM_addImage;{template_legend:hide},customTpl;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID,space;{invisible_legend:hide},invisible,start,stop'; |
28 | 28 |
$GLOBALS['TL_DCA']['tl_content']['palettes']['slickSliderStop'] = '{type_legend},type;{template_legend:hide},customTpl;{protected_legend:hide},protected;{expert_legend:hide},guests;{invisible_legend:hide},invisible,start,stop'; |
29 |
-$GLOBALS['TL_DCA']['tl_content']['palettes']['slickSliderSlideStart'] = '{type_legend},type;{slickSlider_legend},eSM_addImage;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID,space;{invisible_legend:hide},invisible,start,stop'; |
|
30 |
-$GLOBALS['TL_DCA']['tl_content']['palettes']['slickSliderSlideStop'] = '{type_legend},type;{protected_legend:hide},protected;{expert_legend:hide},guests;{invisible_legend:hide},invisible,start,stop'; |
|
29 |
+$GLOBALS['TL_DCA']['tl_content']['palettes']['slickSliderSlideStart'] = '{type_legend},type;{slickSlider_legend},eSM_addImage;{template_legend:hide},customTpl;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID,space;{invisible_legend:hide},invisible,start,stop'; |
|
30 |
+$GLOBALS['TL_DCA']['tl_content']['palettes']['slickSliderSlideStop'] = '{type_legend},type;{template_legend:hide},customTpl;{protected_legend:hide},protected;{expert_legend:hide},guests;{invisible_legend:hide},invisible,start,stop'; |
|
31 | 31 |
$GLOBALS['TL_DCA']['tl_content']['palettes']['slickSliderImage'] = '{type_legend},type;{slickSlider_legend},singleSRC,size,eSM_slick_bgSize,eSM_slick_bgPosition,eSM_slick_minHeight,eSM_slick_bgOpacity,eSM_slick_bgRepeat,eSM_addText;{template_legend:hide},customTpl;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID,space;{invisible_legend:hide},invisible,start,stop'; |
32 | 32 |
|
33 | 33 |
|
... | ... |
@@ -23,14 +23,16 @@ $GLOBALS['TL_DCA']['tl_content']['config']['onsubmit_callback'][] = array('tl_co |
23 | 23 |
* Add palettes to tl_content |
24 | 24 |
*/ |
25 | 25 |
$GLOBALS['TL_DCA']['tl_content']['palettes']['__selector__'][] = 'eSM_addImage'; |
26 |
+$GLOBALS['TL_DCA']['tl_content']['palettes']['__selector__'][] = 'eSM_addText'; |
|
26 | 27 |
$GLOBALS['TL_DCA']['tl_content']['palettes']['slickSliderStart'] = '{type_legend},type;{slickSlider_legend},eSM_slick_autoPlaySpeed,eSM_slick_speed,eSM_slick_initialSlide,eSM_slick_lazyLoad,eSM_slick_slidesToShow,eSM_slick_slidesToScroll,eSM_slick_infinite,eSM_slick_arrows,eSM_slick_pagination,eSM_slick_pause,eSM_slick_fade,eSM_slick_adaptiveHeight;{image_legend},eSM_addImage;{template_legend:hide},customTpl;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID,space;{invisible_legend:hide},invisible,start,stop'; |
27 | 28 |
$GLOBALS['TL_DCA']['tl_content']['palettes']['slickSliderStop'] = '{type_legend},type;{template_legend:hide},customTpl;{protected_legend:hide},protected;{expert_legend:hide},guests;{invisible_legend:hide},invisible,start,stop'; |
28 | 29 |
$GLOBALS['TL_DCA']['tl_content']['palettes']['slickSliderSlideStart'] = '{type_legend},type;{slickSlider_legend},eSM_addImage;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID,space;{invisible_legend:hide},invisible,start,stop'; |
29 | 30 |
$GLOBALS['TL_DCA']['tl_content']['palettes']['slickSliderSlideStop'] = '{type_legend},type;{protected_legend:hide},protected;{expert_legend:hide},guests;{invisible_legend:hide},invisible,start,stop'; |
30 |
-$GLOBALS['TL_DCA']['tl_content']['palettes']['slickSliderWallpaper'] = '{type_legend},type;{slickSlider_legend},eSM_slick_text,eSM_slick_url,singleSRC,size;{template_legend:hide},customTpl;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID,space;{invisible_legend:hide},invisible,start,stop'; |
|
31 |
+$GLOBALS['TL_DCA']['tl_content']['palettes']['slickSliderImage'] = '{type_legend},type;{slickSlider_legend},singleSRC,size,eSM_slick_bgSize,eSM_slick_bgPosition,eSM_slick_minHeight,eSM_slick_bgOpacity,eSM_slick_bgRepeat,eSM_addText;{template_legend:hide},customTpl;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID,space;{invisible_legend:hide},invisible,start,stop'; |
|
31 | 32 |
|
32 | 33 |
|
33 | 34 |
$GLOBALS['TL_DCA']['tl_content']['subpalettes']['eSM_addImage'] = 'singleSRC,size,eSM_slick_bgSize,eSM_slick_bgPosition,eSM_slick_minHeight,eSM_slick_bgOpacity,eSM_slick_bgRepeat'; |
35 |
+$GLOBALS['TL_DCA']['tl_content']['subpalettes']['eSM_addText'] = 'eSM_slick_text,eSM_slick_url'; |
|
34 | 36 |
|
35 | 37 |
/** |
36 | 38 |
* Add fields to tl_content |
... | ... |
@@ -179,6 +181,15 @@ $GLOBALS['TL_DCA']['tl_content']['fields']['eSM_addImage'] = array |
179 | 181 |
'sql' => "char(1) NOT NULL default ''" |
180 | 182 |
); |
181 | 183 |
|
184 |
+$GLOBALS['TL_DCA']['tl_content']['fields']['eSM_addText'] = array |
|
185 |
+( |
|
186 |
+ 'label' => &$GLOBALS['TL_LANG']['tl_content']['eSM_addText'], |
|
187 |
+ 'exclude' => true, |
|
188 |
+ 'inputType' => 'checkbox', |
|
189 |
+ 'eval' => array('tl_class'=>'clr m12', 'submitOnChange'=>true), |
|
190 |
+ 'sql' => "char(1) NOT NULL default ''" |
|
191 |
+); |
|
192 |
+ |
|
182 | 193 |
$GLOBALS['TL_DCA']['tl_content']['fields']['eSM_slick_minHeight'] = array |
183 | 194 |
( |
184 | 195 |
'label' => &$GLOBALS['TL_LANG']['tl_content']['eSM_slick_minHeight'], |
... | ... |
@@ -30,7 +30,7 @@ $GLOBALS['TL_DCA']['tl_content']['palettes']['slickSliderSlideStop'] = '{type_le |
30 | 30 |
$GLOBALS['TL_DCA']['tl_content']['palettes']['slickSliderWallpaper'] = '{type_legend},type;{slickSlider_legend},eSM_slick_text,eSM_slick_url,singleSRC,size;{template_legend:hide},customTpl;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID,space;{invisible_legend:hide},invisible,start,stop'; |
31 | 31 |
|
32 | 32 |
|
33 |
-$GLOBALS['TL_DCA']['tl_content']['subpalettes']['eSM_addImage'] = 'singleSRC,size,eSM_slick_bgSize,eSM_slick_bgPosition,eSM_slick_minHeight,eSM_slick_bgOpacity'; |
|
33 |
+$GLOBALS['TL_DCA']['tl_content']['subpalettes']['eSM_addImage'] = 'singleSRC,size,eSM_slick_bgSize,eSM_slick_bgPosition,eSM_slick_minHeight,eSM_slick_bgOpacity,eSM_slick_bgRepeat'; |
|
34 | 34 |
|
35 | 35 |
/** |
36 | 36 |
* Add fields to tl_content |
... | ... |
@@ -224,6 +224,21 @@ $GLOBALS['TL_DCA']['tl_content']['fields']['eSM_slick_bgSize'] = array |
224 | 224 |
'sql' => "varchar(16) NOT NULL default ''" |
225 | 225 |
); |
226 | 226 |
|
227 |
+$GLOBALS['TL_DCA']['tl_content']['fields']['eSM_slick_bgRepeat'] = array |
|
228 |
+( |
|
229 |
+ 'label' => &$GLOBALS['TL_LANG']['tl_content']['eSM_slick_bgRepeat'], |
|
230 |
+ 'exclude' => true, |
|
231 |
+ 'inputType' => 'select', |
|
232 |
+ 'options' => array |
|
233 |
+ ( |
|
234 |
+ 'repeat-x' => 'Horizontal wiederholen', |
|
235 |
+ 'repeat-y' => 'Vertikal wiedeholen', |
|
236 |
+ 'no-repeat' => 'Nicht wiederholen', |
|
237 |
+ ), |
|
238 |
+ 'eval' => array('tl_class' => 'w50','includeBlankOption'=>true,'blankOptionLabel'=>'Wiederholen'), |
|
239 |
+ 'sql' => "varchar(16) NOT NULL default ''" |
|
240 |
+); |
|
241 |
+ |
|
227 | 242 |
$GLOBALS['TL_DCA']['tl_content']['fields']['eSM_slick_bgOpacity'] = array |
228 | 243 |
( |
229 | 244 |
'label' => &$GLOBALS['TL_LANG']['tl_content']['eSM_slick_bgOpacity'], |
... | ... |
@@ -23,14 +23,14 @@ $GLOBALS['TL_DCA']['tl_content']['config']['onsubmit_callback'][] = array('tl_co |
23 | 23 |
* Add palettes to tl_content |
24 | 24 |
*/ |
25 | 25 |
$GLOBALS['TL_DCA']['tl_content']['palettes']['__selector__'][] = 'eSM_addImage'; |
26 |
-$GLOBALS['TL_DCA']['tl_content']['palettes']['slickSliderStart'] = '{type_legend},type;{slickSlider_legend},eSM_slick_autoPlaySpeed,eSM_slick_speed,eSM_slick_initialSlide,eSM_slick_lazyLoad,eSM_slick_slidesToShow,eSM_slick_slidesToScroll,eSM_slick_infinite,eSM_slick_arrows,eSM_slick_pagination,eSM_slick_pause,eSM_slick_fade,eSM_slick_adaptiveHeight;{template_legend:hide},customTpl;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID,space;{invisible_legend:hide},invisible,start,stop'; |
|
26 |
+$GLOBALS['TL_DCA']['tl_content']['palettes']['slickSliderStart'] = '{type_legend},type;{slickSlider_legend},eSM_slick_autoPlaySpeed,eSM_slick_speed,eSM_slick_initialSlide,eSM_slick_lazyLoad,eSM_slick_slidesToShow,eSM_slick_slidesToScroll,eSM_slick_infinite,eSM_slick_arrows,eSM_slick_pagination,eSM_slick_pause,eSM_slick_fade,eSM_slick_adaptiveHeight;{image_legend},eSM_addImage;{template_legend:hide},customTpl;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID,space;{invisible_legend:hide},invisible,start,stop'; |
|
27 | 27 |
$GLOBALS['TL_DCA']['tl_content']['palettes']['slickSliderStop'] = '{type_legend},type;{template_legend:hide},customTpl;{protected_legend:hide},protected;{expert_legend:hide},guests;{invisible_legend:hide},invisible,start,stop'; |
28 | 28 |
$GLOBALS['TL_DCA']['tl_content']['palettes']['slickSliderSlideStart'] = '{type_legend},type;{slickSlider_legend},eSM_addImage;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID,space;{invisible_legend:hide},invisible,start,stop'; |
29 | 29 |
$GLOBALS['TL_DCA']['tl_content']['palettes']['slickSliderSlideStop'] = '{type_legend},type;{protected_legend:hide},protected;{expert_legend:hide},guests;{invisible_legend:hide},invisible,start,stop'; |
30 | 30 |
$GLOBALS['TL_DCA']['tl_content']['palettes']['slickSliderWallpaper'] = '{type_legend},type;{slickSlider_legend},eSM_slick_text,eSM_slick_url,singleSRC,size;{template_legend:hide},customTpl;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID,space;{invisible_legend:hide},invisible,start,stop'; |
31 | 31 |
|
32 | 32 |
|
33 |
-$GLOBALS['TL_DCA']['tl_content']['subpalettes']['eSM_addImage'] = 'singleSRC,size,eSM_slick_slide_bgSize,eSM_slick_slide_bgPosition,eSM_slick_slide_minHeight,eSM_slick_slide_bgOpacity'; |
|
33 |
+$GLOBALS['TL_DCA']['tl_content']['subpalettes']['eSM_addImage'] = 'singleSRC,size,eSM_slick_bgSize,eSM_slick_bgPosition,eSM_slick_minHeight,eSM_slick_bgOpacity'; |
|
34 | 34 |
|
35 | 35 |
/** |
36 | 36 |
* Add fields to tl_content |
... | ... |
@@ -179,18 +179,18 @@ $GLOBALS['TL_DCA']['tl_content']['fields']['eSM_addImage'] = array |
179 | 179 |
'sql' => "char(1) NOT NULL default ''" |
180 | 180 |
); |
181 | 181 |
|
182 |
-$GLOBALS['TL_DCA']['tl_content']['fields']['eSM_slick_slide_minHeight'] = array |
|
182 |
+$GLOBALS['TL_DCA']['tl_content']['fields']['eSM_slick_minHeight'] = array |
|
183 | 183 |
( |
184 |
- 'label' => &$GLOBALS['TL_LANG']['tl_content']['eSM_slick_slide_minHeight'], |
|
184 |
+ 'label' => &$GLOBALS['TL_LANG']['tl_content']['eSM_slick_minHeight'], |
|
185 | 185 |
'exclude' => true, |
186 | 186 |
'inputType' => 'checkbox', |
187 | 187 |
'eval' => array('tl_class'=>'w50 m12'), |
188 | 188 |
'sql' => "char(1) NOT NULL default ''" |
189 | 189 |
); |
190 | 190 |
|
191 |
-$GLOBALS['TL_DCA']['tl_content']['fields']['eSM_slick_slide_bgPosition'] = array |
|
191 |
+$GLOBALS['TL_DCA']['tl_content']['fields']['eSM_slick_bgPosition'] = array |
|
192 | 192 |
( |
193 |
- 'label' => &$GLOBALS['TL_LANG']['tl_content']['eSM_slick_slide_bgPosition'], |
|
193 |
+ 'label' => &$GLOBALS['TL_LANG']['tl_content']['eSM_slick_bgPosition'], |
|
194 | 194 |
'exclude' => true, |
195 | 195 |
'inputType' => 'select', |
196 | 196 |
'options' => array |
... | ... |
@@ -209,9 +209,9 @@ $GLOBALS['TL_DCA']['tl_content']['fields']['eSM_slick_slide_bgPosition'] = array |
209 | 209 |
'sql' => "varchar(16) NOT NULL default ''" |
210 | 210 |
); |
211 | 211 |
|
212 |
-$GLOBALS['TL_DCA']['tl_content']['fields']['eSM_slick_slide_bgSize'] = array |
|
212 |
+$GLOBALS['TL_DCA']['tl_content']['fields']['eSM_slick_bgSize'] = array |
|
213 | 213 |
( |
214 |
- 'label' => &$GLOBALS['TL_LANG']['tl_content']['eSM_slick_slide_bgSize'], |
|
214 |
+ 'label' => &$GLOBALS['TL_LANG']['tl_content']['eSM_slick_bgSize'], |
|
215 | 215 |
'exclude' => true, |
216 | 216 |
'inputType' => 'select', |
217 | 217 |
'options' => array |
... | ... |
@@ -224,9 +224,9 @@ $GLOBALS['TL_DCA']['tl_content']['fields']['eSM_slick_slide_bgSize'] = array |
224 | 224 |
'sql' => "varchar(16) NOT NULL default ''" |
225 | 225 |
); |
226 | 226 |
|
227 |
-$GLOBALS['TL_DCA']['tl_content']['fields']['eSM_slick_slide_bgOpacity'] = array |
|
227 |
+$GLOBALS['TL_DCA']['tl_content']['fields']['eSM_slick_bgOpacity'] = array |
|
228 | 228 |
( |
229 |
- 'label' => &$GLOBALS['TL_LANG']['tl_content']['eSM_slick_slide_bgOpacity'], |
|
229 |
+ 'label' => &$GLOBALS['TL_LANG']['tl_content']['eSM_slick_bgOpacity'], |
|
230 | 230 |
'exclude' => true, |
231 | 231 |
'inputType' => 'select', |
232 | 232 |
'options' => array |
... | ... |
@@ -328,7 +328,7 @@ class tl_content_eSM_slick extends Backend |
328 | 328 |
// Check if a stop element should be created |
329 | 329 |
if ( |
330 | 330 |
!$nextElement->type |
331 |
- || ($activeRecord->type === 'slickSliderStart' && ($nextElement->type === 'slickSliderSlideStart' || $nextElement->type === 'slickSliderSlideStop' || $nextElement->type === 'slickSliderStart')) |
|
331 |
+ || ($activeRecord->type === 'slickSliderStart' && ($nextElement->type === 'slickSliderStart')) |
|
332 | 332 |
|| ($activeRecord->type === 'slickSliderSlideStart' && ($nextElement->type === 'slickSliderSlideStart' || $nextElement->type === 'slickSliderStart' || $nextElement->type === 'slickSliderStop')) |
333 | 333 |
) { |
334 | 334 |
\Database::getInstance() |
... | ... |
@@ -30,7 +30,7 @@ $GLOBALS['TL_DCA']['tl_content']['palettes']['slickSliderSlideStop'] = '{type_le |
30 | 30 |
$GLOBALS['TL_DCA']['tl_content']['palettes']['slickSliderWallpaper'] = '{type_legend},type;{slickSlider_legend},eSM_slick_text,eSM_slick_url,singleSRC,size;{template_legend:hide},customTpl;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID,space;{invisible_legend:hide},invisible,start,stop'; |
31 | 31 |
|
32 | 32 |
|
33 |
-$GLOBALS['TL_DCA']['tl_content']['subpalettes']['eSM_addImage'] = 'singleSRC,size'; |
|
33 |
+$GLOBALS['TL_DCA']['tl_content']['subpalettes']['eSM_addImage'] = 'singleSRC,size,eSM_slick_slide_bgSize,eSM_slick_slide_bgPosition,eSM_slick_slide_minHeight,eSM_slick_slide_bgOpacity'; |
|
34 | 34 |
|
35 | 35 |
/** |
36 | 36 |
* Add fields to tl_content |
... | ... |
@@ -179,6 +179,72 @@ $GLOBALS['TL_DCA']['tl_content']['fields']['eSM_addImage'] = array |
179 | 179 |
'sql' => "char(1) NOT NULL default ''" |
180 | 180 |
); |
181 | 181 |
|
182 |
+$GLOBALS['TL_DCA']['tl_content']['fields']['eSM_slick_slide_minHeight'] = array |
|
183 |
+( |
|
184 |
+ 'label' => &$GLOBALS['TL_LANG']['tl_content']['eSM_slick_slide_minHeight'], |
|
185 |
+ 'exclude' => true, |
|
186 |
+ 'inputType' => 'checkbox', |
|
187 |
+ 'eval' => array('tl_class'=>'w50 m12'), |
|
188 |
+ 'sql' => "char(1) NOT NULL default ''" |
|
189 |
+); |
|
190 |
+ |
|
191 |
+$GLOBALS['TL_DCA']['tl_content']['fields']['eSM_slick_slide_bgPosition'] = array |
|
192 |
+( |
|
193 |
+ 'label' => &$GLOBALS['TL_LANG']['tl_content']['eSM_slick_slide_bgPosition'], |
|
194 |
+ 'exclude' => true, |
|
195 |
+ 'inputType' => 'select', |
|
196 |
+ 'options' => array |
|
197 |
+ ( |
|
198 |
+ '0 0' => 'Links | Oben', |
|
199 |
+ '50% 0' => 'Mitte | Oben', |
|
200 |
+ '100% 0' => 'Rechts | Oben', |
|
201 |
+ '0 50%' => 'Links | Mitte', |
|
202 |
+ '50% 50%' => 'Mitte | Mitte', |
|
203 |
+ '100% 50%' => 'Rechts | Mitte', |
|
204 |
+ '0 100%' => 'Links | Unten', |
|
205 |
+ '50% 100%' => 'Mitte | Unten', |
|
206 |
+ '100% 100%' => 'Rechts | Unten', |
|
207 |
+ ), |
|
208 |
+ 'eval' => array('tl_class' => 'w50','includeBlankOption'=>true), |
|
209 |
+ 'sql' => "varchar(16) NOT NULL default ''" |
|
210 |
+); |
|
211 |
+ |
|
212 |
+$GLOBALS['TL_DCA']['tl_content']['fields']['eSM_slick_slide_bgSize'] = array |
|
213 |
+( |
|
214 |
+ 'label' => &$GLOBALS['TL_LANG']['tl_content']['eSM_slick_slide_bgSize'], |
|
215 |
+ 'exclude' => true, |
|
216 |
+ 'inputType' => 'select', |
|
217 |
+ 'options' => array |
|
218 |
+ ( |
|
219 |
+ 'contain' => 'Proportional', |
|
220 |
+ '100% 100%' => 'Verzerrt', |
|
221 |
+ 'auto auto' => 'Originalgröße', |
|
222 |
+ ), |
|
223 |
+ 'eval' => array('tl_class' => 'w50','includeBlankOption'=>true,'blankOptionLabel'=>'Beschnitten'), |
|
224 |
+ 'sql' => "varchar(16) NOT NULL default ''" |
|
225 |
+); |
|
226 |
+ |
|
227 |
+$GLOBALS['TL_DCA']['tl_content']['fields']['eSM_slick_slide_bgOpacity'] = array |
|
228 |
+( |
|
229 |
+ 'label' => &$GLOBALS['TL_LANG']['tl_content']['eSM_slick_slide_bgOpacity'], |
|
230 |
+ 'exclude' => true, |
|
231 |
+ 'inputType' => 'select', |
|
232 |
+ 'options' => array |
|
233 |
+ ( |
|
234 |
+ '10' => '10%', |
|
235 |
+ '20' => '20%', |
|
236 |
+ '30' => '30%', |
|
237 |
+ '40' => '40%', |
|
238 |
+ '50' => '50%', |
|
239 |
+ '60' => '60%', |
|
240 |
+ '70' => '70%', |
|
241 |
+ '80' => '80%', |
|
242 |
+ '90' => '90%', |
|
243 |
+ '100' => '100%', |
|
244 |
+ ), |
|
245 |
+ 'eval' => array('tl_class' => 'w50','includeBlankOption'=>true), |
|
246 |
+ 'sql' => "varchar(16) NOT NULL default ''" |
|
247 |
+); |
|
182 | 248 |
|
183 | 249 |
class tl_content_eSM_slick extends Backend |
184 | 250 |
{ |
... | ... |
@@ -23,7 +23,7 @@ $GLOBALS['TL_DCA']['tl_content']['config']['onsubmit_callback'][] = array('tl_co |
23 | 23 |
* Add palettes to tl_content |
24 | 24 |
*/ |
25 | 25 |
$GLOBALS['TL_DCA']['tl_content']['palettes']['__selector__'][] = 'eSM_addImage'; |
26 |
-$GLOBALS['TL_DCA']['tl_content']['palettes']['slickSliderStart'] = '{type_legend},type;{slickSlider_legend},eSM_slick_autoPlaySpeed,eSM_slick_speed,eSM_slick_initialSlide,eSM_slick_lazyLoad,eSM_slick_infinite,eSM_slick_arrows,eSM_slick_pagination,eSM_slick_pause,eSM_slick_fade;{template_legend:hide},customTpl;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID,space;{invisible_legend:hide},invisible,start,stop'; |
|
26 |
+$GLOBALS['TL_DCA']['tl_content']['palettes']['slickSliderStart'] = '{type_legend},type;{slickSlider_legend},eSM_slick_autoPlaySpeed,eSM_slick_speed,eSM_slick_initialSlide,eSM_slick_lazyLoad,eSM_slick_slidesToShow,eSM_slick_slidesToScroll,eSM_slick_infinite,eSM_slick_arrows,eSM_slick_pagination,eSM_slick_pause,eSM_slick_fade,eSM_slick_adaptiveHeight;{template_legend:hide},customTpl;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID,space;{invisible_legend:hide},invisible,start,stop'; |
|
27 | 27 |
$GLOBALS['TL_DCA']['tl_content']['palettes']['slickSliderStop'] = '{type_legend},type;{template_legend:hide},customTpl;{protected_legend:hide},protected;{expert_legend:hide},guests;{invisible_legend:hide},invisible,start,stop'; |
28 | 28 |
$GLOBALS['TL_DCA']['tl_content']['palettes']['slickSliderSlideStart'] = '{type_legend},type;{slickSlider_legend},eSM_addImage;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID,space;{invisible_legend:hide},invisible,start,stop'; |
29 | 29 |
$GLOBALS['TL_DCA']['tl_content']['palettes']['slickSliderSlideStop'] = '{type_legend},type;{protected_legend:hide},protected;{expert_legend:hide},guests;{invisible_legend:hide},invisible,start,stop'; |
... | ... |
@@ -64,6 +64,24 @@ $GLOBALS['TL_DCA']['tl_content']['fields']['eSM_slick_initialSlide'] = array |
64 | 64 |
'sql' => "int(10) unsigned NOT NULL default '0'" |
65 | 65 |
); |
66 | 66 |
|
67 |
+$GLOBALS['TL_DCA']['tl_content']['fields']['eSM_slick_slidesToShow'] = array |
|
68 |
+( |
|
69 |
+ 'label' => &$GLOBALS['TL_LANG']['tl_content']['eSM_slick_slidesToShow'], |
|
70 |
+ 'exclude' => true, |
|
71 |
+ 'inputType' => 'text', |
|
72 |
+ 'eval' => array('rgxp'=>'natural','minval'=>1,'tl_class'=>'w50'), |
|
73 |
+ 'sql' => "int(10) unsigned NOT NULL default '1'" |
|
74 |
+); |
|
75 |
+ |
|
76 |
+$GLOBALS['TL_DCA']['tl_content']['fields']['eSM_slick_slidesToScroll'] = array |
|
77 |
+( |
|
78 |
+ 'label' => &$GLOBALS['TL_LANG']['tl_content']['eSM_slick_slidesToScroll'], |
|
79 |
+ 'exclude' => true, |
|
80 |
+ 'inputType' => 'text', |
|
81 |
+ 'eval' => array('rgxp'=>'natural','minval'=>1,'tl_class'=>'w50'), |
|
82 |
+ 'sql' => "int(10) unsigned NOT NULL default '1'" |
|
83 |
+); |
|
84 |
+ |
|
67 | 85 |
$GLOBALS['TL_DCA']['tl_content']['fields']['eSM_slick_infinite'] = array |
68 | 86 |
( |
69 | 87 |
'label' => &$GLOBALS['TL_LANG']['tl_content']['eSM_slick_infinite'], |
... | ... |
@@ -121,6 +139,15 @@ $GLOBALS['TL_DCA']['tl_content']['fields']['eSM_slick_fade'] = array |
121 | 139 |
'sql' => "char(1) NOT NULL default ''" |
122 | 140 |
); |
123 | 141 |
|
142 |
+$GLOBALS['TL_DCA']['tl_content']['fields']['eSM_slick_adaptiveHeight'] = array |
|
143 |
+( |
|
144 |
+ 'label' => &$GLOBALS['TL_LANG']['tl_content']['eSM_slick_adaptiveHeight'], |
|
145 |
+ 'exclude' => true, |
|
146 |
+ 'inputType' => 'checkbox', |
|
147 |
+ 'eval' => array('tl_class'=>'w50 m12'), |
|
148 |
+ 'sql' => "char(1) NOT NULL default ''" |
|
149 |
+); |
|
150 |
+ |
|
124 | 151 |
$GLOBALS['TL_DCA']['tl_content']['fields']['eSM_slick_text'] = array |
125 | 152 |
( |
126 | 153 |
'label' => &$GLOBALS['TL_LANG']['tl_content']['eSM_slick_text'], |
... | ... |
@@ -17,6 +17,7 @@ |
17 | 17 |
* Add callback |
18 | 18 |
*/ |
19 | 19 |
$GLOBALS['TL_DCA']['tl_content']['config']['onload_callback'][] = array('tl_content_eSM_slick', 'showJsLibraryHint'); |
20 |
+$GLOBALS['TL_DCA']['tl_content']['config']['onsubmit_callback'][] = array('tl_content_eSM_slick', 'insertEndElement'); |
|
20 | 21 |
|
21 | 22 |
/** |
22 | 23 |
* Add palettes to tl_content |
... | ... |
@@ -197,4 +198,58 @@ class tl_content_eSM_slick extends Backend |
197 | 198 |
break; |
198 | 199 |
} |
199 | 200 |
} |
201 |
+ |
|
202 |
+ /** |
|
203 |
+ * Automatically insert end element if start element ist about to be added |
|
204 |
+ * |
|
205 |
+ * @param DataContainer $dc |
|
206 |
+ */ |
|
207 |
+ public function insertEndElement(\DataContainer $dc) |
|
208 |
+ { |
|
209 |
+ $activeRecord = $dc->activeRecord; |
|
210 |
+ if (!$activeRecord) { |
|
211 |
+ return; |
|
212 |
+ } |
|
213 |
+ |
|
214 |
+ if ($activeRecord->type === 'slickSliderStart' || $activeRecord->type === 'slickSliderSlideStart') { |
|
215 |
+ |
|
216 |
+ // Find the next boxwrapper element |
|
217 |
+ $nextElement = \Database::getInstance() |
|
218 |
+ ->prepare(" |
|
219 |
+ SELECT type |
|
220 |
+ FROM tl_content |
|
221 |
+ WHERE pid = ? |
|
222 |
+ AND (ptable = ? OR ptable = ?) |
|
223 |
+ AND type IN ('slickSliderSlideStart', 'slickSliderSlideStop','slickSliderStart', 'slickSliderStop') |
|
224 |
+ AND sorting > ? |
|
225 |
+ ORDER BY sorting ASC |
|
226 |
+ LIMIT 1 |
|
227 |
+ ") |
|
228 |
+ ->execute( |
|
229 |
+ $activeRecord->pid, |
|
230 |
+ $activeRecord->ptable ?: 'tl_article', |
|
231 |
+ $activeRecord->ptable === 'tl_article' ? '' : $activeRecord->ptable, |
|
232 |
+ $activeRecord->sorting |
|
233 |
+ ); |
|
234 |
+ |
|
235 |
+ // Check if a stop element should be created |
|
236 |
+ if ( |
|
237 |
+ !$nextElement->type |
|
238 |
+ || ($activeRecord->type === 'slickSliderStart' && ($nextElement->type === 'slickSliderSlideStart' || $nextElement->type === 'slickSliderSlideStop' || $nextElement->type === 'slickSliderStart')) |
|
239 |
+ || ($activeRecord->type === 'slickSliderSlideStart' && ($nextElement->type === 'slickSliderSlideStart' || $nextElement->type === 'slickSliderStart' || $nextElement->type === 'slickSliderStop')) |
|
240 |
+ ) { |
|
241 |
+ \Database::getInstance() |
|
242 |
+ ->prepare('INSERT INTO tl_content %s') |
|
243 |
+ ->set(array( |
|
244 |
+ 'pid' => $activeRecord->pid, |
|
245 |
+ 'ptable' => $activeRecord->ptable ?: 'tl_article', |
|
246 |
+ 'type' => substr($activeRecord->type, 0, -5) . 'Stop', |
|
247 |
+ 'sorting' => $activeRecord->sorting + 1, |
|
248 |
+ 'tstamp' => time(), |
|
249 |
+ )) |
|
250 |
+ ->execute(); |
|
251 |
+ } |
|
252 |
+ |
|
253 |
+ } |
|
254 |
+ } |
|
200 | 255 |
} |
201 | 256 |
\ No newline at end of file |
1 | 1 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,200 @@ |
1 |
+<?php |
|
2 |
+ |
|
3 |
+/** |
|
4 |
+ * Slick slider 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 callback |
|
18 |
+ */ |
|
19 |
+$GLOBALS['TL_DCA']['tl_content']['config']['onload_callback'][] = array('tl_content_eSM_slick', 'showJsLibraryHint'); |
|
20 |
+ |
|
21 |
+/** |
|
22 |
+ * Add palettes to tl_content |
|
23 |
+ */ |
|
24 |
+$GLOBALS['TL_DCA']['tl_content']['palettes']['__selector__'][] = 'eSM_addImage'; |
|
25 |
+$GLOBALS['TL_DCA']['tl_content']['palettes']['slickSliderStart'] = '{type_legend},type;{slickSlider_legend},eSM_slick_autoPlaySpeed,eSM_slick_speed,eSM_slick_initialSlide,eSM_slick_lazyLoad,eSM_slick_infinite,eSM_slick_arrows,eSM_slick_pagination,eSM_slick_pause,eSM_slick_fade;{template_legend:hide},customTpl;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID,space;{invisible_legend:hide},invisible,start,stop'; |
|
26 |
+$GLOBALS['TL_DCA']['tl_content']['palettes']['slickSliderStop'] = '{type_legend},type;{template_legend:hide},customTpl;{protected_legend:hide},protected;{expert_legend:hide},guests;{invisible_legend:hide},invisible,start,stop'; |
|
27 |
+$GLOBALS['TL_DCA']['tl_content']['palettes']['slickSliderSlideStart'] = '{type_legend},type;{slickSlider_legend},eSM_addImage;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID,space;{invisible_legend:hide},invisible,start,stop'; |
|
28 |
+$GLOBALS['TL_DCA']['tl_content']['palettes']['slickSliderSlideStop'] = '{type_legend},type;{protected_legend:hide},protected;{expert_legend:hide},guests;{invisible_legend:hide},invisible,start,stop'; |
|
29 |
+$GLOBALS['TL_DCA']['tl_content']['palettes']['slickSliderWallpaper'] = '{type_legend},type;{slickSlider_legend},eSM_slick_text,eSM_slick_url,singleSRC,size;{template_legend:hide},customTpl;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID,space;{invisible_legend:hide},invisible,start,stop'; |
|
30 |
+ |
|
31 |
+ |
|
32 |
+$GLOBALS['TL_DCA']['tl_content']['subpalettes']['eSM_addImage'] = 'singleSRC,size'; |
|
33 |
+ |
|
34 |
+/** |
|
35 |
+ * Add fields to tl_content |
|
36 |
+ */ |
|
37 |
+ |
|
38 |
+$GLOBALS['TL_DCA']['tl_content']['fields']['eSM_slick_autoPlaySpeed'] = array |
|
39 |
+( |
|
40 |
+ 'label' => &$GLOBALS['TL_LANG']['tl_content']['eSM_slick_autoPlaySpeed'], |
|
41 |
+ 'exclude' => true, |
|
42 |
+ 'inputType' => 'text', |
|
43 |
+ 'eval' => array('tl_class'=>'w50','rgxp'=>'digit'), |
|
44 |
+ 'sql' => "int(10) unsigned NOT NULL default '0'" |
|
45 |
+); |
|
46 |
+ |
|
47 |
+$GLOBALS['TL_DCA']['tl_content']['fields']['eSM_slick_speed'] = array |
|
48 |
+( |
|
49 |
+ 'label' => &$GLOBALS['TL_LANG']['tl_content']['eSM_slick_speed'], |
|
50 |
+ 'exclude' => true, |
|
51 |
+ 'inputType' => 'text', |
|
52 |
+ 'default' => '500', |
|
53 |
+ 'eval' => array('tl_class'=>'w50','rgxp'=>'digit'), |
|
54 |
+ 'sql' => "int(10) unsigned NOT NULL default '0'" |
|
55 |
+); |
|
56 |
+ |
|
57 |
+$GLOBALS['TL_DCA']['tl_content']['fields']['eSM_slick_initialSlide'] = array |
|
58 |
+( |
|
59 |
+ 'label' => &$GLOBALS['TL_LANG']['tl_content']['eSM_slick_initialSlide'], |
|
60 |
+ 'exclude' => true, |
|
61 |
+ 'inputType' => 'text', |
|
62 |
+ 'eval' => array('tl_class'=>'w50','rgxp'=>'digit'), |
|
63 |
+ 'sql' => "int(10) unsigned NOT NULL default '0'" |
|
64 |
+); |
|
65 |
+ |
|
66 |
+$GLOBALS['TL_DCA']['tl_content']['fields']['eSM_slick_infinite'] = array |
|
67 |
+( |
|
68 |
+ 'label' => &$GLOBALS['TL_LANG']['tl_content']['eSM_slick_infinite'], |
|
69 |
+ 'exclude' => true, |
|
70 |
+ 'inputType' => 'checkbox', |
|
71 |
+ 'eval' => array('tl_class'=>'w50 m12'), |
|
72 |
+ 'sql' => "char(1) NOT NULL default ''" |
|
73 |
+); |
|
74 |
+ |
|
75 |
+$GLOBALS['TL_DCA']['tl_content']['fields']['eSM_slick_arrows'] = array |
|
76 |
+( |
|
77 |
+ 'label' => &$GLOBALS['TL_LANG']['tl_content']['eSM_slick_arrows'], |
|
78 |
+ 'exclude' => true, |
|
79 |
+ 'inputType' => 'checkbox', |
|
80 |
+ 'eval' => array('tl_class'=>'w50 m12'), |
|
81 |
+ 'sql' => "char(1) NOT NULL default ''" |
|
82 |
+); |
|
83 |
+ |
|
84 |
+$GLOBALS['TL_DCA']['tl_content']['fields']['eSM_slick_pagination'] = array |
|
85 |
+( |
|
86 |
+ 'label' => &$GLOBALS['TL_LANG']['tl_content']['eSM_slick_pagination'], |
|
87 |
+ 'exclude' => true, |
|
88 |
+ 'inputType' => 'checkbox', |
|
89 |
+ 'eval' => array('tl_class'=>'w50 m12'), |
|
90 |
+ 'sql' => "char(1) NOT NULL default ''" |
|
91 |
+); |
|
92 |
+ |
|
93 |
+$GLOBALS['TL_DCA']['tl_content']['fields']['eSM_slick_pause'] = array |
|
94 |
+( |
|
95 |
+ 'label' => &$GLOBALS['TL_LANG']['tl_content']['eSM_slick_pause'], |
|
96 |
+ 'exclude' => true, |
|
97 |
+ 'inputType' => 'checkbox', |
|
98 |
+ 'eval' => array('tl_class'=>'w50 m12'), |
|
99 |
+ 'sql' => "char(1) NOT NULL default ''" |
|
100 |
+); |
|
101 |
+ |
|
102 |
+$GLOBALS['TL_DCA']['tl_content']['fields']['eSM_slick_lazyLoad'] = array |
|
103 |
+( |
|
104 |
+ 'label' => &$GLOBALS['TL_LANG']['tl_content']['eSM_slick_lazyLoad'], |
|
105 |
+ 'exclude' => true, |
|
106 |
+ 'inputType' => 'select', |
|
107 |
+ 'default' => 'ondemand', |
|
108 |
+ 'options' => array('ondemand','progressive'), |
|
109 |
+ 'reference' => &$GLOBALS['TL_LANG']['MSC']['slick_lazyLoad'], |
|
110 |
+ 'eval' => array('tl_class'=>'w50','includeBlankOption'=>true), |
|
111 |
+ 'sql' => "varchar(16) NOT NULL default ''" |
|
112 |
+); |
|
113 |
+ |
|
114 |
+$GLOBALS['TL_DCA']['tl_content']['fields']['eSM_slick_fade'] = array |
|
115 |
+( |
|
116 |
+ 'label' => &$GLOBALS['TL_LANG']['tl_content']['eSM_slick_fade'], |
|
117 |
+ 'exclude' => true, |
|
118 |
+ 'inputType' => 'checkbox', |
|
119 |
+ 'eval' => array('tl_class'=>'w50 m12'), |
|
120 |
+ 'sql' => "char(1) NOT NULL default ''" |
|
121 |
+); |
|
122 |
+ |
|
123 |
+$GLOBALS['TL_DCA']['tl_content']['fields']['eSM_slick_text'] = array |
|
124 |
+( |
|
125 |
+ 'label' => &$GLOBALS['TL_LANG']['tl_content']['eSM_slick_text'], |
|
126 |
+ 'exclude' => true, |
|
127 |
+ 'inputType' => 'textarea', |
|
128 |
+ 'eval' => array('rows'=>2,'style'=>'height: 2em;', 'maxlength'=>64), |
|
129 |
+ 'sql' => "varchar(64) NOT NULL default ''" |
|
130 |
+); |
|
131 |
+ |
|
132 |
+$GLOBALS['TL_DCA']['tl_content']['fields']['eSM_slick_url'] = array |
|
133 |
+( |
|
134 |
+ 'label' => &$GLOBALS['TL_LANG']['MSC']['url'], |
|
135 |
+ 'exclude' => true, |
|
136 |
+ 'inputType' => 'text', |
|
137 |
+ 'eval' => array('rgxp'=>'url', 'decodeEntities'=>true, 'maxlength'=>255, 'fieldType'=>'radio', 'filesOnly'=>true, 'tl_class'=>'w50 wizard'), |
|
138 |
+ 'wizard' => array |
|
139 |
+ ( |
|
140 |
+ array('tl_content', 'pagePicker') |
|
141 |
+ ), |
|
142 |
+ 'sql' => "varchar(255) NOT NULL default ''" |
|
143 |
+); |
|
144 |
+ |
|
145 |
+$GLOBALS['TL_DCA']['tl_content']['fields']['eSM_addImage'] = array |
|
146 |
+( |
|
147 |
+ 'label' => &$GLOBALS['TL_LANG']['tl_content']['addImage'], |
|
148 |
+ 'exclude' => true, |
|
149 |
+ 'inputType' => 'checkbox', |
|
150 |
+ 'eval' => array('submitOnChange'=>true), |
|
151 |
+ 'sql' => "char(1) NOT NULL default ''" |
|
152 |
+); |
|
153 |
+ |
|
154 |
+ |
|
155 |
+class tl_content_eSM_slick extends Backend |
|
156 |
+{ |
|
157 |
+ |
|
158 |
+ /** |
|
159 |
+ * Import the back end user object |
|
160 |
+ */ |
|
161 |
+ public function __construct() |
|
162 |
+ { |
|
163 |
+ parent::__construct(); |
|
164 |
+ $this->import('BackendUser', 'User'); |
|
165 |
+ } |
|
166 |
+ |
|
167 |
+ /** |
|
168 |
+ * Show a hint if a JavaScript library needs to be included in the page layout |
|
169 |
+ * |
|
170 |
+ * @param object |
|
171 |
+ */ |
|
172 |
+ public function showJsLibraryHint($dc) |
|
173 |
+ { |
|
174 |
+ if ($_POST || Input::get('act') != 'edit') |
|
175 |
+ { |
|
176 |
+ return; |
|
177 |
+ } |
|
178 |
+ |
|
179 |
+ // Return if the user cannot access the layout module (see #6190) |
|
180 |
+ if (!$this->User->hasAccess('themes', 'modules') || !$this->User->hasAccess('layout', 'themes')) |
|
181 |
+ { |
|
182 |
+ return; |
|
183 |
+ } |
|
184 |
+ |
|
185 |
+ $objCte = ContentModel::findByPk($dc->id); |
|
186 |
+ |
|
187 |
+ if ($objCte === null) |
|
188 |
+ { |
|
189 |
+ return; |
|
190 |
+ } |
|
191 |
+ |
|
192 |
+ switch ($objCte->type) |
|
193 |
+ { |
|
194 |
+ case 'slickSliderStart': |
|
195 |
+ case 'slickSliderStop': |
|
196 |
+ Message::addInfo(sprintf($GLOBALS['TL_LANG']['tl_content']['includeTemplatesJQuery'], 'j_slickslider')); |
|
197 |
+ break; |
|
198 |
+ } |
|
199 |
+ } |
|
200 |
+} |
|
0 | 201 |
\ No newline at end of file |