From 2d844673101ff4bfd97b784b45e320dad30b331f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Auswo=CC=88ger?= Date: Fri, 10 Apr 2015 14:21:09 +0200 Subject: [PATCH] Added thumbnail navigation options, closes #17 --- dca/tl_content.php | 162 +++++++++++++++++++++- dca/tl_module.php | 166 ++++++++++++++++++++++- dca/tl_rocksolid_slide.php | 14 +- languages/de/tl_content.php | 1 + languages/de/tl_module.php | 4 + languages/de/tl_rocksolid_slide.php | 2 + languages/en/tl_content.php | 1 + languages/en/tl_module.php | 4 + languages/en/tl_rocksolid_slide.php | 2 + src/MadeYourDay/Contao/Module/Slider.php | 126 +++++++++++++++-- templates/rsts_default.html5 | 9 +- 11 files changed, 471 insertions(+), 20 deletions(-) diff --git a/dca/tl_content.php b/dca/tl_content.php index d3576ed..c113c26 100644 --- a/dca/tl_content.php +++ b/dca/tl_content.php @@ -28,8 +28,11 @@ $GLOBALS['TL_DCA']['tl_content']['palettes']['__selector__'][] = 'rsts_content_type'; $GLOBALS['TL_DCA']['tl_content']['palettes']['rocksolid_slider'] = '{type_legend},type,headline,rsts_content_type'; -$GLOBALS['TL_DCA']['tl_content']['palettes']['rocksolid_sliderrsts_default'] = '{type_legend},type,headline,rsts_content_type;{rocksolid_slider_legend},rsts_id,rsts_type,rsts_direction,rsts_random,rsts_loop,rsts_centerContent,rsts_skin,rsts_width,rsts_height,rsts_preloadSlides,rsts_gapSize,rsts_duration,rsts_captions,rsts_scaleMode,rsts_imagePosition;{rsts_navigation_legend},rsts_navType,rsts_deepLinkPrefix,rsts_controls,rsts_keyboard,rsts_invertControls;{rsts_autoplay_legend},rsts_autoplay,rsts_autoplayRestart,rsts_autoplayProgress,rsts_pauseAutoplayOnHover,rsts_videoAutoplay;{rsts_carousel_legend},rsts_slideMaxCount,rsts_slideMinSize,rsts_slideMaxSize,rsts_rowMaxCount,rsts_rowMinSize,rsts_rowSlideRatio,rsts_prevNextSteps,rsts_combineNavItems,rsts_visibleArea,rsts_visibleAreaMax;{template_legend:hide},rsts_template,size,fullsize;{protected_legend:hide},protected;{expert_legend:hide},guests,rsts_customSkin,rsts_cssPrefix,cssID,space;{invisible_legend:hide},invisible,start,stop'; -$GLOBALS['TL_DCA']['tl_content']['palettes']['rocksolid_sliderrsts_images'] = '{type_legend},type,headline,rsts_content_type;{source_legend:hide},multiSRC;{rocksolid_slider_legend},rsts_type,rsts_direction,rsts_random,rsts_loop,rsts_centerContent,rsts_skin,rsts_width,rsts_height,rsts_preloadSlides,rsts_gapSize,rsts_duration,rsts_captions,rsts_scaleMode,rsts_imagePosition;{rsts_navigation_legend},rsts_navType,rsts_deepLinkPrefix,rsts_controls,rsts_keyboard,rsts_invertControls;{rsts_autoplay_legend},rsts_autoplay,rsts_autoplayRestart,rsts_autoplayProgress,rsts_pauseAutoplayOnHover,rsts_videoAutoplay;{rsts_carousel_legend},rsts_slideMaxCount,rsts_slideMinSize,rsts_slideMaxSize,rsts_rowMaxCount,rsts_rowMinSize,rsts_rowSlideRatio,rsts_prevNextSteps,rsts_combineNavItems,rsts_visibleArea,rsts_visibleAreaMax;{template_legend:hide},rsts_template,size,fullsize;{protected_legend:hide},protected;{expert_legend:hide},guests,rsts_customSkin,rsts_cssPrefix,cssID,space;{invisible_legend:hide},invisible,start,stop'; +$GLOBALS['TL_DCA']['tl_content']['palettes']['rocksolid_sliderrsts_default'] = '{type_legend},type,headline,rsts_content_type;{rocksolid_slider_legend},rsts_id,rsts_type,rsts_direction,rsts_random,rsts_loop,rsts_centerContent,rsts_skin,rsts_width,rsts_height,rsts_preloadSlides,rsts_gapSize,rsts_duration,rsts_captions,rsts_scaleMode,rsts_imagePosition;{rsts_navigation_legend},rsts_navType,rsts_deepLinkPrefix,rsts_controls,rsts_keyboard,rsts_invertControls;{rsts_thumbs_legend},rsts_thumbs_imgSize,rsts_thumbs;{rsts_autoplay_legend},rsts_autoplay,rsts_autoplayRestart,rsts_autoplayProgress,rsts_pauseAutoplayOnHover,rsts_videoAutoplay;{rsts_carousel_legend},rsts_slideMaxCount,rsts_slideMinSize,rsts_slideMaxSize,rsts_rowMaxCount,rsts_rowMinSize,rsts_rowSlideRatio,rsts_prevNextSteps,rsts_combineNavItems,rsts_visibleArea,rsts_visibleAreaMax;{template_legend:hide},rsts_template,size,fullsize;{protected_legend:hide},protected;{expert_legend:hide},guests,rsts_customSkin,rsts_cssPrefix,cssID,space;{invisible_legend:hide},invisible,start,stop'; +$GLOBALS['TL_DCA']['tl_content']['palettes']['rocksolid_sliderrsts_images'] = '{type_legend},type,headline,rsts_content_type;{source_legend:hide},multiSRC;{rocksolid_slider_legend},rsts_type,rsts_direction,rsts_random,rsts_loop,rsts_centerContent,rsts_skin,rsts_width,rsts_height,rsts_preloadSlides,rsts_gapSize,rsts_duration,rsts_captions,rsts_scaleMode,rsts_imagePosition;{rsts_navigation_legend},rsts_navType,rsts_deepLinkPrefix,rsts_controls,rsts_keyboard,rsts_invertControls;{rsts_thumbs_legend},rsts_thumbs_imgSize,rsts_thumbs;{rsts_autoplay_legend},rsts_autoplay,rsts_autoplayRestart,rsts_autoplayProgress,rsts_pauseAutoplayOnHover,rsts_videoAutoplay;{rsts_carousel_legend},rsts_slideMaxCount,rsts_slideMinSize,rsts_slideMaxSize,rsts_rowMaxCount,rsts_rowMinSize,rsts_rowSlideRatio,rsts_prevNextSteps,rsts_combineNavItems,rsts_visibleArea,rsts_visibleAreaMax;{template_legend:hide},rsts_template,size,fullsize;{protected_legend:hide},protected;{expert_legend:hide},guests,rsts_customSkin,rsts_cssPrefix,cssID,space;{invisible_legend:hide},invisible,start,stop'; + +$GLOBALS['TL_DCA']['tl_content']['palettes']['__selector__'][] = 'rsts_thumbs'; +$GLOBALS['TL_DCA']['tl_content']['subpalettes']['rsts_thumbs'] = 'rsts_thumbs_width,rsts_thumbs_height,rsts_thumbs_gapSize,rsts_thumbs_duration,rsts_thumbs_scaleMode,rsts_thumbs_imagePosition,rsts_thumbs_controls,rsts_thumbs_slideMaxCount,rsts_thumbs_slideMinSize,rsts_thumbs_slideMaxSize,rsts_thumbs_rowMaxCount,rsts_thumbs_rowMinSize,rsts_thumbs_rowSlideRatio,rsts_thumbs_prevNextSteps,rsts_thumbs_visibleArea,rsts_thumbs_visibleAreaMax'; $GLOBALS['TL_DCA']['tl_content']['fields']['rsts_content_type'] = array( 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_content_type'], @@ -232,6 +235,7 @@ 'bullets' => $GLOBALS['TL_LANG']['tl_module']['rsts_navType_bullets'], 'numbers' => $GLOBALS['TL_LANG']['tl_module']['rsts_navType_numbers'], 'tabs' => $GLOBALS['TL_LANG']['tl_module']['rsts_navType_tabs'], + 'thumbs' => $GLOBALS['TL_LANG']['tl_module']['rsts_navType_thumbs'], 'none' => $GLOBALS['TL_LANG']['tl_module']['rsts_navType_none'], ), 'eval' => array('tl_class' => 'w50'), @@ -303,6 +307,160 @@ 'eval' => array('tl_class' => 'w50 m12'), 'sql' => "char(1) NOT NULL default '1'", ); +$GLOBALS['TL_DCA']['tl_content']['fields']['rsts_thumbs'] = array( + 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_thumbs'], + 'exclude' => true, + 'inputType' => 'checkbox', + 'eval' => array( + 'submitOnChange' => true, + 'tl_class' => 'w50 m12', + ), + 'sql' => "char(1) NOT NULL default ''", +); +$GLOBALS['TL_DCA']['tl_content']['fields']['rsts_thumbs_width'] = array( + 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_width'], + 'exclude' => true, + 'inputType' => 'text', + 'eval' => array('tl_class' => 'clr w50'), + 'sql' => "varchar(64) NOT NULL default ''", +); +$GLOBALS['TL_DCA']['tl_content']['fields']['rsts_thumbs_height'] = array( + 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_height'], + 'exclude' => true, + 'inputType' => 'text', + 'eval' => array('tl_class' => 'w50'), + 'sql' => "varchar(64) NOT NULL default ''", +); +$GLOBALS['TL_DCA']['tl_content']['fields']['rsts_thumbs_gapSize'] = array( + 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_gapSize'], + 'exclude' => true, + 'inputType' => 'text', + 'eval' => array('tl_class' => 'w50'), + 'sql' => "varchar(64) NOT NULL default ''", +); +$GLOBALS['TL_DCA']['tl_content']['fields']['rsts_thumbs_duration'] = array( + 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_duration'], + 'exclude' => true, + 'inputType' => 'text', + 'eval' => array('tl_class' => 'w50'), + 'sql' => "int(10) unsigned NOT NULL default '0'", +); +$GLOBALS['TL_DCA']['tl_content']['fields']['rsts_thumbs_scaleMode'] = array( + 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_scaleMode'], + 'exclude' => true, + 'inputType' => 'select', + 'options' => array( + 'fit' => $GLOBALS['TL_LANG']['tl_module']['rsts_scaleMode_fit'], + 'crop' => $GLOBALS['TL_LANG']['tl_module']['rsts_scaleMode_crop'], + 'scale' => $GLOBALS['TL_LANG']['tl_module']['rsts_scaleMode_scale'], + 'none' => $GLOBALS['TL_LANG']['tl_module']['rsts_scaleMode_none'], + ), + 'eval' => array( + 'tl_class' => 'w50 clr', + 'includeBlankOption' => true, + ), + 'sql' => "varchar(64) NOT NULL default ''", +); +$GLOBALS['TL_DCA']['tl_content']['fields']['rsts_thumbs_imagePosition'] = array( + 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_imagePosition'], + 'exclude' => true, + 'inputType' => 'select', + 'options' => array('center', 'top', 'right', 'bottom', 'left', 'top-left', 'top-right', 'bottom-left', 'bottom-right'), + 'reference' => &$GLOBALS['TL_LANG']['tl_module']['rsts_imagePositions'], + 'eval' => array( + 'tl_class' => 'w50', + 'includeBlankOption' => true, + ), + 'sql' => "varchar(64) NOT NULL default ''", +); +$GLOBALS['TL_DCA']['tl_content']['fields']['rsts_thumbs_controls'] = array( + 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_controls'], + 'exclude' => true, + 'inputType' => 'checkbox', + 'eval' => array('tl_class' => 'w50'), + 'sql' => "char(1) NOT NULL default '1'", +); +$GLOBALS['TL_DCA']['tl_content']['fields']['rsts_thumbs_imgSize'] = array( + 'label' => &$GLOBALS['TL_LANG']['tl_module']['imgSize'], + 'exclude' => true, + 'inputType' => 'imageSize', + 'options' => System::getImageSizes(), + 'reference' => &$GLOBALS['TL_LANG']['MSC'], + 'eval' => array( + 'rgxp' => 'natural', + 'includeBlankOption' => true, + 'nospace' => true, + 'helpwizard' => true, + 'tl_class' => 'w50', + ), + 'sql' => "varchar(64) NOT NULL default 'a:3:{i:0;s:2:\"50\";i:1;s:2:\"50\";i:2;s:4:\"crop\";}'", +); +$GLOBALS['TL_DCA']['tl_content']['fields']['rsts_thumbs_slideMaxCount'] = array( + 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_slideMaxCount'], + 'exclude' => true, + 'inputType' => 'select', + 'options' => array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20), + 'eval' => array('tl_class' => 'w50 clr', 'includeBlankOption' => true), + 'sql' => "int(10) unsigned NOT NULL default '0'", +); +$GLOBALS['TL_DCA']['tl_content']['fields']['rsts_thumbs_prevNextSteps'] = array( + 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_prevNextSteps'], + 'exclude' => true, + 'inputType' => 'select', + 'options' => array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20), + 'eval' => array('tl_class' => 'w50 clr', 'includeBlankOption' => true), + 'sql' => "int(10) unsigned NOT NULL default '0'", +); +$GLOBALS['TL_DCA']['tl_content']['fields']['rsts_thumbs_visibleArea'] = array( + 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_visibleArea'], + 'exclude' => true, + 'inputType' => 'text', + 'eval' => array('tl_class' => 'w50 clr'), + 'sql' => "double unsigned NOT NULL default '0'", +); +$GLOBALS['TL_DCA']['tl_content']['fields']['rsts_thumbs_visibleAreaMax'] = array( + 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_visibleAreaMax'], + 'exclude' => true, + 'inputType' => 'text', + 'eval' => array('tl_class' => 'w50'), + 'sql' => "double unsigned NOT NULL default '0'", +); +$GLOBALS['TL_DCA']['tl_content']['fields']['rsts_thumbs_slideMinSize'] = array( + 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_slideMinSize'], + 'exclude' => true, + 'inputType' => 'text', + 'eval' => array('tl_class' => 'clr w50'), + 'sql' => "int(10) unsigned NOT NULL default '0'", +); +$GLOBALS['TL_DCA']['tl_content']['fields']['rsts_thumbs_slideMaxSize'] = array( + 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_slideMaxSize'], + 'exclude' => true, + 'inputType' => 'text', + 'eval' => array('tl_class' => 'w50'), + 'sql' => "int(10) unsigned NOT NULL default '0'", +); +$GLOBALS['TL_DCA']['tl_content']['fields']['rsts_thumbs_rowMaxCount'] = array( + 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_rowMaxCount'], + 'exclude' => true, + 'inputType' => 'select', + 'options' => array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20), + 'eval' => array('tl_class' => 'clr w50', 'includeBlankOption' => true), + 'sql' => "int(10) unsigned NOT NULL default '0'", +); +$GLOBALS['TL_DCA']['tl_content']['fields']['rsts_thumbs_rowMinSize'] = array( + 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_rowMinSize'], + 'exclude' => true, + 'inputType' => 'text', + 'eval' => array('tl_class' => 'w50'), + 'sql' => "int(10) unsigned NOT NULL default '0'", +); +$GLOBALS['TL_DCA']['tl_content']['fields']['rsts_thumbs_rowSlideRatio'] = array( + 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_rowSlideRatio'], + 'exclude' => true, + 'inputType' => 'text', + 'eval' => array('tl_class' => 'w50'), + 'sql' => "varchar(255) NOT NULL default ''", +); // maximum number of visible slides $GLOBALS['TL_DCA']['tl_content']['fields']['rsts_slideMaxCount'] = array( 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_slideMaxCount'], diff --git a/dca/tl_module.php b/dca/tl_module.php index efe2bf9..b617a02 100644 --- a/dca/tl_module.php +++ b/dca/tl_module.php @@ -16,10 +16,13 @@ $GLOBALS['TL_DCA']['tl_module']['palettes']['__selector__'][] = 'rsts_content_type'; $GLOBALS['TL_DCA']['tl_module']['palettes']['rocksolid_slider'] = '{title_legend},name,headline,type,rsts_content_type'; -$GLOBALS['TL_DCA']['tl_module']['palettes']['rocksolid_sliderrsts_default'] = '{title_legend},name,headline,type,rsts_content_type;{config_legend},rsts_id,rsts_type,rsts_direction,rsts_random,rsts_loop,rsts_centerContent,rsts_skin,rsts_width,rsts_height,rsts_preloadSlides,rsts_gapSize,rsts_duration,rsts_captions,rsts_scaleMode,rsts_imagePosition;{rsts_navigation_legend},rsts_navType,rsts_deepLinkPrefix,rsts_controls,rsts_keyboard,rsts_invertControls;{rsts_autoplay_legend},rsts_autoplay,rsts_autoplayRestart,rsts_autoplayProgress,rsts_pauseAutoplayOnHover,rsts_videoAutoplay;{rsts_carousel_legend},rsts_slideMaxCount,rsts_slideMinSize,rsts_slideMaxSize,rsts_rowMaxCount,rsts_rowMinSize,rsts_rowSlideRatio,rsts_prevNextSteps,rsts_combineNavItems,rsts_visibleArea,rsts_visibleAreaMax;{template_legend:hide},rsts_template,imgSize,fullsize;{expert_legend:hide},rsts_customSkin,rsts_cssPrefix,cssID,space'; -$GLOBALS['TL_DCA']['tl_module']['palettes']['rocksolid_sliderrsts_news'] = '{title_legend},name,headline,type,rsts_content_type;{rsts_news_legend},news_archives,numberOfItems,news_featured,skipFirst,news_template,news_metaFields;{config_legend},rsts_type,rsts_direction,rsts_random,rsts_loop,rsts_centerContent,rsts_skin,rsts_width,rsts_height,rsts_preloadSlides,rsts_gapSize,rsts_duration,rsts_captions,rsts_scaleMode,rsts_imagePosition;{rsts_navigation_legend},rsts_navType,rsts_deepLinkPrefix,rsts_controls,rsts_keyboard,rsts_invertControls;{rsts_autoplay_legend},rsts_autoplay,rsts_autoplayRestart,rsts_autoplayProgress,rsts_pauseAutoplayOnHover,rsts_videoAutoplay;{rsts_carousel_legend},rsts_slideMaxCount,rsts_slideMinSize,rsts_slideMaxSize,rsts_rowMaxCount,rsts_rowMinSize,rsts_rowSlideRatio,rsts_prevNextSteps,rsts_combineNavItems,rsts_visibleArea,rsts_visibleAreaMax;{template_legend:hide},rsts_template,imgSize,fullsize;{expert_legend:hide},rsts_customSkin,rsts_cssPrefix,cssID,space'; -$GLOBALS['TL_DCA']['tl_module']['palettes']['rocksolid_sliderrsts_events'] = '{title_legend},name,headline,type,rsts_content_type;{rsts_events_legend},cal_calendar,cal_noSpan,cal_format,cal_ignoreDynamic,cal_order,cal_readerModule,cal_limit,cal_template;{config_legend},rsts_type,rsts_direction,rsts_random,rsts_loop,rsts_centerContent,rsts_skin,rsts_width,rsts_height,rsts_preloadSlides,rsts_gapSize,rsts_duration,rsts_captions,rsts_scaleMode,rsts_imagePosition;{rsts_navigation_legend},rsts_navType,rsts_deepLinkPrefix,rsts_controls,rsts_keyboard,rsts_invertControls;{rsts_autoplay_legend},rsts_autoplay,rsts_autoplayRestart,rsts_autoplayProgress,rsts_pauseAutoplayOnHover,rsts_videoAutoplay;{rsts_carousel_legend},rsts_slideMaxCount,rsts_slideMinSize,rsts_slideMaxSize,rsts_rowMaxCount,rsts_rowMinSize,rsts_rowSlideRatio,rsts_prevNextSteps,rsts_combineNavItems,rsts_visibleArea,rsts_visibleAreaMax;{template_legend:hide},rsts_template,imgSize,fullsize;{expert_legend:hide},rsts_customSkin,rsts_cssPrefix,cssID,space'; -$GLOBALS['TL_DCA']['tl_module']['palettes']['rocksolid_sliderrsts_images'] = '{title_legend},name,headline,type,rsts_content_type;{rsts_images_legend},multiSRC;{config_legend},rsts_type,rsts_direction,rsts_random,rsts_loop,rsts_centerContent,rsts_skin,rsts_width,rsts_height,rsts_preloadSlides,rsts_gapSize,rsts_duration,rsts_captions,rsts_scaleMode,rsts_imagePosition;{rsts_navigation_legend},rsts_navType,rsts_deepLinkPrefix,rsts_controls,rsts_keyboard,rsts_invertControls;{rsts_autoplay_legend},rsts_autoplay,rsts_autoplayRestart,rsts_autoplayProgress,rsts_pauseAutoplayOnHover,rsts_videoAutoplay;{rsts_carousel_legend},rsts_slideMaxCount,rsts_slideMinSize,rsts_slideMaxSize,rsts_rowMaxCount,rsts_rowMinSize,rsts_rowSlideRatio,rsts_prevNextSteps,rsts_combineNavItems,rsts_visibleArea,rsts_visibleAreaMax;{template_legend:hide},rsts_template,imgSize,fullsize;{expert_legend:hide},rsts_customSkin,rsts_cssPrefix,cssID,space'; +$GLOBALS['TL_DCA']['tl_module']['palettes']['rocksolid_sliderrsts_default'] = '{title_legend},name,headline,type,rsts_content_type;{config_legend},rsts_id,rsts_type,rsts_direction,rsts_random,rsts_loop,rsts_centerContent,rsts_skin,rsts_width,rsts_height,rsts_preloadSlides,rsts_gapSize,rsts_duration,rsts_captions,rsts_scaleMode,rsts_imagePosition;{rsts_navigation_legend},rsts_navType,rsts_deepLinkPrefix,rsts_controls,rsts_keyboard,rsts_invertControls;{rsts_thumbs_legend},rsts_thumbs_imgSize,rsts_thumbs;{rsts_autoplay_legend},rsts_autoplay,rsts_autoplayRestart,rsts_autoplayProgress,rsts_pauseAutoplayOnHover,rsts_videoAutoplay;{rsts_carousel_legend},rsts_slideMaxCount,rsts_slideMinSize,rsts_slideMaxSize,rsts_rowMaxCount,rsts_rowMinSize,rsts_rowSlideRatio,rsts_prevNextSteps,rsts_combineNavItems,rsts_visibleArea,rsts_visibleAreaMax;{template_legend:hide},rsts_template,imgSize,fullsize;{expert_legend:hide},rsts_customSkin,rsts_cssPrefix,cssID,space'; +$GLOBALS['TL_DCA']['tl_module']['palettes']['rocksolid_sliderrsts_news'] = '{title_legend},name,headline,type,rsts_content_type;{rsts_news_legend},news_archives,numberOfItems,news_featured,skipFirst,news_template,news_metaFields;{config_legend},rsts_type,rsts_direction,rsts_random,rsts_loop,rsts_centerContent,rsts_skin,rsts_width,rsts_height,rsts_preloadSlides,rsts_gapSize,rsts_duration,rsts_captions,rsts_scaleMode,rsts_imagePosition;{rsts_navigation_legend},rsts_navType,rsts_deepLinkPrefix,rsts_controls,rsts_keyboard,rsts_invertControls;{rsts_thumbs_legend},rsts_thumbs_imgSize,rsts_thumbs;{rsts_autoplay_legend},rsts_autoplay,rsts_autoplayRestart,rsts_autoplayProgress,rsts_pauseAutoplayOnHover,rsts_videoAutoplay;{rsts_carousel_legend},rsts_slideMaxCount,rsts_slideMinSize,rsts_slideMaxSize,rsts_rowMaxCount,rsts_rowMinSize,rsts_rowSlideRatio,rsts_prevNextSteps,rsts_combineNavItems,rsts_visibleArea,rsts_visibleAreaMax;{template_legend:hide},rsts_template,imgSize,fullsize;{expert_legend:hide},rsts_customSkin,rsts_cssPrefix,cssID,space'; +$GLOBALS['TL_DCA']['tl_module']['palettes']['rocksolid_sliderrsts_events'] = '{title_legend},name,headline,type,rsts_content_type;{rsts_events_legend},cal_calendar,cal_noSpan,cal_format,cal_ignoreDynamic,cal_order,cal_readerModule,cal_limit,cal_template;{config_legend},rsts_type,rsts_direction,rsts_random,rsts_loop,rsts_centerContent,rsts_skin,rsts_width,rsts_height,rsts_preloadSlides,rsts_gapSize,rsts_duration,rsts_captions,rsts_scaleMode,rsts_imagePosition;{rsts_navigation_legend},rsts_navType,rsts_deepLinkPrefix,rsts_controls,rsts_keyboard,rsts_invertControls;{rsts_thumbs_legend},rsts_thumbs_imgSize,rsts_thumbs;{rsts_autoplay_legend},rsts_autoplay,rsts_autoplayRestart,rsts_autoplayProgress,rsts_pauseAutoplayOnHover,rsts_videoAutoplay;{rsts_carousel_legend},rsts_slideMaxCount,rsts_slideMinSize,rsts_slideMaxSize,rsts_rowMaxCount,rsts_rowMinSize,rsts_rowSlideRatio,rsts_prevNextSteps,rsts_combineNavItems,rsts_visibleArea,rsts_visibleAreaMax;{template_legend:hide},rsts_template,imgSize,fullsize;{expert_legend:hide},rsts_customSkin,rsts_cssPrefix,cssID,space'; +$GLOBALS['TL_DCA']['tl_module']['palettes']['rocksolid_sliderrsts_images'] = '{title_legend},name,headline,type,rsts_content_type;{rsts_images_legend},multiSRC;{config_legend},rsts_type,rsts_direction,rsts_random,rsts_loop,rsts_centerContent,rsts_skin,rsts_width,rsts_height,rsts_preloadSlides,rsts_gapSize,rsts_duration,rsts_captions,rsts_scaleMode,rsts_imagePosition;{rsts_navigation_legend},rsts_navType,rsts_deepLinkPrefix,rsts_controls,rsts_keyboard,rsts_invertControls;{rsts_thumbs_legend},rsts_thumbs_imgSize,rsts_thumbs;{rsts_autoplay_legend},rsts_autoplay,rsts_autoplayRestart,rsts_autoplayProgress,rsts_pauseAutoplayOnHover,rsts_videoAutoplay;{rsts_carousel_legend},rsts_slideMaxCount,rsts_slideMinSize,rsts_slideMaxSize,rsts_rowMaxCount,rsts_rowMinSize,rsts_rowSlideRatio,rsts_prevNextSteps,rsts_combineNavItems,rsts_visibleArea,rsts_visibleAreaMax;{template_legend:hide},rsts_template,imgSize,fullsize;{expert_legend:hide},rsts_customSkin,rsts_cssPrefix,cssID,space'; + +$GLOBALS['TL_DCA']['tl_module']['palettes']['__selector__'][] = 'rsts_thumbs'; +$GLOBALS['TL_DCA']['tl_module']['subpalettes']['rsts_thumbs'] = 'rsts_thumbs_width,rsts_thumbs_height,rsts_thumbs_gapSize,rsts_thumbs_duration,rsts_thumbs_scaleMode,rsts_thumbs_imagePosition,rsts_thumbs_controls,rsts_thumbs_slideMaxCount,rsts_thumbs_slideMinSize,rsts_thumbs_slideMaxSize,rsts_thumbs_rowMaxCount,rsts_thumbs_rowMinSize,rsts_thumbs_rowSlideRatio,rsts_thumbs_prevNextSteps,rsts_thumbs_visibleArea,rsts_thumbs_visibleAreaMax'; $GLOBALS['TL_DCA']['tl_module']['fields']['news_metaFields']['eval']['tl_class'] .= ' clr'; @@ -229,6 +232,7 @@ 'bullets' => $GLOBALS['TL_LANG']['tl_module']['rsts_navType_bullets'], 'numbers' => $GLOBALS['TL_LANG']['tl_module']['rsts_navType_numbers'], 'tabs' => $GLOBALS['TL_LANG']['tl_module']['rsts_navType_tabs'], + 'thumbs' => $GLOBALS['TL_LANG']['tl_module']['rsts_navType_thumbs'], 'none' => $GLOBALS['TL_LANG']['tl_module']['rsts_navType_none'], ), 'eval' => array('tl_class' => 'w50'), @@ -300,6 +304,160 @@ 'eval' => array('tl_class' => 'w50 m12'), 'sql' => "char(1) NOT NULL default '1'", ); +$GLOBALS['TL_DCA']['tl_module']['fields']['rsts_thumbs'] = array( + 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_thumbs'], + 'exclude' => true, + 'inputType' => 'checkbox', + 'eval' => array( + 'submitOnChange' => true, + 'tl_class' => 'w50 m12', + ), + 'sql' => "char(1) NOT NULL default ''", +); +$GLOBALS['TL_DCA']['tl_module']['fields']['rsts_thumbs_width'] = array( + 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_width'], + 'exclude' => true, + 'inputType' => 'text', + 'eval' => array('tl_class' => 'clr w50'), + 'sql' => "varchar(64) NOT NULL default ''", +); +$GLOBALS['TL_DCA']['tl_module']['fields']['rsts_thumbs_height'] = array( + 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_height'], + 'exclude' => true, + 'inputType' => 'text', + 'eval' => array('tl_class' => 'w50'), + 'sql' => "varchar(64) NOT NULL default ''", +); +$GLOBALS['TL_DCA']['tl_module']['fields']['rsts_thumbs_gapSize'] = array( + 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_gapSize'], + 'exclude' => true, + 'inputType' => 'text', + 'eval' => array('tl_class' => 'w50'), + 'sql' => "varchar(64) NOT NULL default ''", +); +$GLOBALS['TL_DCA']['tl_module']['fields']['rsts_thumbs_duration'] = array( + 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_duration'], + 'exclude' => true, + 'inputType' => 'text', + 'eval' => array('tl_class' => 'w50'), + 'sql' => "int(10) unsigned NOT NULL default '0'", +); +$GLOBALS['TL_DCA']['tl_module']['fields']['rsts_thumbs_scaleMode'] = array( + 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_scaleMode'], + 'exclude' => true, + 'inputType' => 'select', + 'options' => array( + 'fit' => $GLOBALS['TL_LANG']['tl_module']['rsts_scaleMode_fit'], + 'crop' => $GLOBALS['TL_LANG']['tl_module']['rsts_scaleMode_crop'], + 'scale' => $GLOBALS['TL_LANG']['tl_module']['rsts_scaleMode_scale'], + 'none' => $GLOBALS['TL_LANG']['tl_module']['rsts_scaleMode_none'], + ), + 'eval' => array( + 'tl_class' => 'w50 clr', + 'includeBlankOption' => true, + ), + 'sql' => "varchar(64) NOT NULL default ''", +); +$GLOBALS['TL_DCA']['tl_module']['fields']['rsts_thumbs_imagePosition'] = array( + 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_imagePosition'], + 'exclude' => true, + 'inputType' => 'select', + 'options' => array('center', 'top', 'right', 'bottom', 'left', 'top-left', 'top-right', 'bottom-left', 'bottom-right'), + 'reference' => &$GLOBALS['TL_LANG']['tl_module']['rsts_imagePositions'], + 'eval' => array( + 'tl_class' => 'w50', + 'includeBlankOption' => true, + ), + 'sql' => "varchar(64) NOT NULL default ''", +); +$GLOBALS['TL_DCA']['tl_module']['fields']['rsts_thumbs_controls'] = array( + 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_controls'], + 'exclude' => true, + 'inputType' => 'checkbox', + 'eval' => array('tl_class' => 'w50'), + 'sql' => "char(1) NOT NULL default '1'", +); +$GLOBALS['TL_DCA']['tl_module']['fields']['rsts_thumbs_imgSize'] = array( + 'label' => &$GLOBALS['TL_LANG']['tl_module']['imgSize'], + 'exclude' => true, + 'inputType' => 'imageSize', + 'options' => System::getImageSizes(), + 'reference' => &$GLOBALS['TL_LANG']['MSC'], + 'eval' => array( + 'rgxp' => 'natural', + 'includeBlankOption' => true, + 'nospace' => true, + 'helpwizard' => true, + 'tl_class' => 'w50', + ), + 'sql' => "varchar(64) NOT NULL default 'a:3:{i:0;s:2:\"50\";i:1;s:2:\"50\";i:2;s:4:\"crop\";}'", +); +$GLOBALS['TL_DCA']['tl_module']['fields']['rsts_thumbs_slideMaxCount'] = array( + 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_slideMaxCount'], + 'exclude' => true, + 'inputType' => 'select', + 'options' => array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20), + 'eval' => array('tl_class' => 'w50 clr', 'includeBlankOption' => true), + 'sql' => "int(10) unsigned NOT NULL default '0'", +); +$GLOBALS['TL_DCA']['tl_module']['fields']['rsts_thumbs_prevNextSteps'] = array( + 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_prevNextSteps'], + 'exclude' => true, + 'inputType' => 'select', + 'options' => array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20), + 'eval' => array('tl_class' => 'w50 clr', 'includeBlankOption' => true), + 'sql' => "int(10) unsigned NOT NULL default '0'", +); +$GLOBALS['TL_DCA']['tl_module']['fields']['rsts_thumbs_visibleArea'] = array( + 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_visibleArea'], + 'exclude' => true, + 'inputType' => 'text', + 'eval' => array('tl_class' => 'w50 clr'), + 'sql' => "double unsigned NOT NULL default '0'", +); +$GLOBALS['TL_DCA']['tl_module']['fields']['rsts_thumbs_visibleAreaMax'] = array( + 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_visibleAreaMax'], + 'exclude' => true, + 'inputType' => 'text', + 'eval' => array('tl_class' => 'w50'), + 'sql' => "double unsigned NOT NULL default '0'", +); +$GLOBALS['TL_DCA']['tl_module']['fields']['rsts_thumbs_slideMinSize'] = array( + 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_slideMinSize'], + 'exclude' => true, + 'inputType' => 'text', + 'eval' => array('tl_class' => 'clr w50'), + 'sql' => "int(10) unsigned NOT NULL default '0'", +); +$GLOBALS['TL_DCA']['tl_module']['fields']['rsts_thumbs_slideMaxSize'] = array( + 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_slideMaxSize'], + 'exclude' => true, + 'inputType' => 'text', + 'eval' => array('tl_class' => 'w50'), + 'sql' => "int(10) unsigned NOT NULL default '0'", +); +$GLOBALS['TL_DCA']['tl_module']['fields']['rsts_thumbs_rowMaxCount'] = array( + 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_rowMaxCount'], + 'exclude' => true, + 'inputType' => 'select', + 'options' => array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20), + 'eval' => array('tl_class' => 'clr w50', 'includeBlankOption' => true), + 'sql' => "int(10) unsigned NOT NULL default '0'", +); +$GLOBALS['TL_DCA']['tl_module']['fields']['rsts_thumbs_rowMinSize'] = array( + 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_rowMinSize'], + 'exclude' => true, + 'inputType' => 'text', + 'eval' => array('tl_class' => 'w50'), + 'sql' => "int(10) unsigned NOT NULL default '0'", +); +$GLOBALS['TL_DCA']['tl_module']['fields']['rsts_thumbs_rowSlideRatio'] = array( + 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_rowSlideRatio'], + 'exclude' => true, + 'inputType' => 'text', + 'eval' => array('tl_class' => 'w50'), + 'sql' => "varchar(255) NOT NULL default ''", +); // maximum number of visible slides $GLOBALS['TL_DCA']['tl_module']['fields']['rsts_slideMaxCount'] = array( 'label' => &$GLOBALS['TL_LANG']['tl_module']['rsts_slideMaxCount'], diff --git a/dca/tl_rocksolid_slide.php b/dca/tl_rocksolid_slide.php index 5a15419..57f04d7 100644 --- a/dca/tl_rocksolid_slide.php +++ b/dca/tl_rocksolid_slide.php @@ -93,7 +93,7 @@ ), 'palettes' => array( - 'default' => '{title_legend},title,videoURL,videos,singleSRC,scaleMode,imagePosition,centerContent,invertControls,autoplay,linkUrl,linkNewWindow;{background_legend},backgroundImage,backgroundVideos,backgroundImageSize,backgroundScaleMode,backgroundPosition;{expert_legend},slideClass,sliderClass;{publish_legend},published,start,stop', + 'default' => '{title_legend},title,videoURL,videos,singleSRC,thumbImage,scaleMode,imagePosition,centerContent,invertControls,autoplay,linkUrl,linkNewWindow;{background_legend},backgroundImage,backgroundVideos,backgroundImageSize,backgroundScaleMode,backgroundPosition;{expert_legend},slideClass,sliderClass;{publish_legend},published,start,stop', ), 'fields' => array( @@ -157,6 +157,18 @@ ), 'sql' => version_compare(VERSION, '3.2', '<') ? "varchar(255) NOT NULL default ''" : "binary(16) NULL", ), + 'thumbImage' => array( + 'label' => &$GLOBALS['TL_LANG']['tl_rocksolid_slide']['thumbImage'], + 'exclude' => true, + 'inputType' => 'fileTree', + 'eval' => array( + 'fieldType' => 'radio', + 'files' => true, + 'filesOnly' => true, + 'extensions' => \Config::get('validImageTypes'), + ), + 'sql' => version_compare(VERSION, '3.2', '<') ? "varchar(255) NOT NULL default ''" : "binary(16) NULL", + ), 'scaleMode' => array( 'label' => &$GLOBALS['TL_LANG']['tl_rocksolid_slide']['scaleMode'], 'exclude' => true, diff --git a/languages/de/tl_content.php b/languages/de/tl_content.php index 8b8fc0e..3238bed 100644 --- a/languages/de/tl_content.php +++ b/languages/de/tl_content.php @@ -16,3 +16,4 @@ $GLOBALS['TL_LANG']['tl_content']['rsts_carousel_legend'] = 'Karussell-Einstellungen'; $GLOBALS['TL_LANG']['tl_content']['rsts_autoplay_legend'] = 'Autoplay-Einstellungen'; $GLOBALS['TL_LANG']['tl_content']['rsts_navigation_legend'] = 'Navigations-Einstellungen'; +$GLOBALS['TL_LANG']['tl_content']['rsts_thumbs_legend'] = 'Thumbnails-Einstellungen'; diff --git a/languages/de/tl_module.php b/languages/de/tl_module.php index 59b0b67..2dd0459 100644 --- a/languages/de/tl_module.php +++ b/languages/de/tl_module.php @@ -18,6 +18,7 @@ $GLOBALS['TL_LANG']['tl_module']['rsts_carousel_legend'] = 'Karussell-Einstellungen'; $GLOBALS['TL_LANG']['tl_module']['rsts_autoplay_legend'] = 'Autoplay-Einstellungen'; $GLOBALS['TL_LANG']['tl_module']['rsts_navigation_legend'] = 'Navigations-Einstellungen'; +$GLOBALS['TL_LANG']['tl_module']['rsts_thumbs_legend'] = 'Thumbnails-Einstellungen'; $GLOBALS['TL_LANG']['tl_module']['rsts_content_type'][0] = 'Slider-Inhaltstyp'; $GLOBALS['TL_LANG']['tl_module']['rsts_content_type'][1] = 'Wählen Sie die Quelle des Slider-Inhaltes aus.'; $GLOBALS['TL_LANG']['tl_module']['rsts_content_types']['rsts_default'] = 'Slider'; @@ -75,11 +76,14 @@ $GLOBALS['TL_LANG']['tl_module']['rsts_navType_bullets'] = 'Punkte'; $GLOBALS['TL_LANG']['tl_module']['rsts_navType_numbers'] = 'Nummeriert'; $GLOBALS['TL_LANG']['tl_module']['rsts_navType_tabs'] = 'Tabs'; +$GLOBALS['TL_LANG']['tl_module']['rsts_navType_thumbs'] = 'Thumbnails'; $GLOBALS['TL_LANG']['tl_module']['rsts_navType_none'] = 'Navigation ausblenden'; $GLOBALS['TL_LANG']['tl_module']['rsts_controls'][0] = 'Weiter und Zurück anzeigen'; $GLOBALS['TL_LANG']['tl_module']['rsts_controls'][1] = 'Aktiviert die Navigationspfeile.'; $GLOBALS['TL_LANG']['tl_module']['rsts_invertControls'][0] = 'Navigation invertieren'; $GLOBALS['TL_LANG']['tl_module']['rsts_invertControls'][1] = 'Invertiert die Navigation (nicht auf alle Skins anwendbar).'; +$GLOBALS['TL_LANG']['tl_module']['rsts_thumbs'][0] = 'Thumbnails-Einstellungen aktivieren'; +$GLOBALS['TL_LANG']['tl_module']['rsts_thumbs'][1] = 'Aktiviert die Einstellungen der Thumbnails-Navigation.'; $GLOBALS['TL_LANG']['tl_module']['rsts_scaleMode'][0] = 'Skalierungsmodus'; $GLOBALS['TL_LANG']['tl_module']['rsts_scaleMode'][1] = 'Achtung: Hat keine Auswirkung wenn Höhe oder Breite auf "auto" gesetzt ist.'; $GLOBALS['TL_LANG']['tl_module']['rsts_scaleMode_fit'] = 'Proportional'; diff --git a/languages/de/tl_rocksolid_slide.php b/languages/de/tl_rocksolid_slide.php index de17d91..3778a2b 100644 --- a/languages/de/tl_rocksolid_slide.php +++ b/languages/de/tl_rocksolid_slide.php @@ -42,6 +42,8 @@ $GLOBALS['TL_LANG']['tl_rocksolid_slide']['videos'][1] = 'Wählen Sie eine oder mehrere Videodateien aus um einen Video-Slide zu erstellen.'; $GLOBALS['TL_LANG']['tl_rocksolid_slide']['singleSRC'][0] = 'Bild'; $GLOBALS['TL_LANG']['tl_rocksolid_slide']['singleSRC'][1] = 'Wählen Sie hier ein Bild aus wenn Sie einen Bild- oder Video-Slide (Vorschaubild) erstellen möchten.'; +$GLOBALS['TL_LANG']['tl_rocksolid_slide']['thumbImage'][0] = 'Thumbnail-Bild'; +$GLOBALS['TL_LANG']['tl_rocksolid_slide']['thumbImage'][1] = 'Wählen Sie hier ein Vorschaubild für die Thumbnail-Navigation aus.'; $GLOBALS['TL_LANG']['tl_rocksolid_slide']['scaleMode'][0] = 'Skalierungsmodus'; $GLOBALS['TL_LANG']['tl_rocksolid_slide']['scaleMode'][1] = 'Skalierungsmodus des Bildes. Diese Einstellung überschreibt die Moduleinstellungen.'; $GLOBALS['TL_LANG']['tl_rocksolid_slide']['scaleModes']['fit'] = 'Proportional'; diff --git a/languages/en/tl_content.php b/languages/en/tl_content.php index 9edf982..cbdbe71 100644 --- a/languages/en/tl_content.php +++ b/languages/en/tl_content.php @@ -16,3 +16,4 @@ $GLOBALS['TL_LANG']['tl_content']['rsts_carousel_legend'] = 'Carousel Settings'; $GLOBALS['TL_LANG']['tl_content']['rsts_autoplay_legend'] = 'Autoplay Settings'; $GLOBALS['TL_LANG']['tl_content']['rsts_navigation_legend'] = 'Navigation Settings'; +$GLOBALS['TL_LANG']['tl_content']['rsts_thumbs_legend'] = 'Thumbnail Settings'; diff --git a/languages/en/tl_module.php b/languages/en/tl_module.php index 13045d2..04e81d2 100644 --- a/languages/en/tl_module.php +++ b/languages/en/tl_module.php @@ -18,6 +18,7 @@ $GLOBALS['TL_LANG']['tl_module']['rsts_carousel_legend'] = 'Carousel Settings'; $GLOBALS['TL_LANG']['tl_module']['rsts_autoplay_legend'] = 'Autoplay Settings'; $GLOBALS['TL_LANG']['tl_module']['rsts_navigation_legend'] = 'Navigation Settings'; +$GLOBALS['TL_LANG']['tl_module']['rsts_thumbs_legend'] = 'Thumbnail Settings'; $GLOBALS['TL_LANG']['tl_module']['rsts_content_type'][0] = 'Slider content type'; $GLOBALS['TL_LANG']['tl_module']['rsts_content_type'][1] = 'Select the type of the contents source.'; $GLOBALS['TL_LANG']['tl_module']['rsts_content_types']['rsts_default'] = 'Slider'; @@ -75,11 +76,14 @@ $GLOBALS['TL_LANG']['tl_module']['rsts_navType_bullets'] = 'Bullets'; $GLOBALS['TL_LANG']['tl_module']['rsts_navType_numbers'] = 'Numbers'; $GLOBALS['TL_LANG']['tl_module']['rsts_navType_tabs'] = 'Tabs'; +$GLOBALS['TL_LANG']['tl_module']['rsts_navType_thumbs'] = 'Thumbnails'; $GLOBALS['TL_LANG']['tl_module']['rsts_navType_none'] = 'Hide navigation'; $GLOBALS['TL_LANG']['tl_module']['rsts_controls'][0] = 'Show next and previous arrows'; $GLOBALS['TL_LANG']['tl_module']['rsts_controls'][1] = 'Activates the next and previous controls.'; $GLOBALS['TL_LANG']['tl_module']['rsts_invertControls'][0] = 'Invert controls'; $GLOBALS['TL_LANG']['tl_module']['rsts_invertControls'][1] = 'Inverts the controls (not applicable for all skins).'; +$GLOBALS['TL_LANG']['tl_module']['rsts_thumbs'][0] = 'Activate Thumbnail Settings'; +$GLOBALS['TL_LANG']['tl_module']['rsts_thumbs'][1] = 'Activate the settings for the thumbnail navigation.'; $GLOBALS['TL_LANG']['tl_module']['rsts_scaleMode'][0] = 'Scale mode'; $GLOBALS['TL_LANG']['tl_module']['rsts_scaleMode'][1] = 'Note: Has no effect if either width or height are set to "auto".'; $GLOBALS['TL_LANG']['tl_module']['rsts_scaleMode_fit'] = 'Proportional'; diff --git a/languages/en/tl_rocksolid_slide.php b/languages/en/tl_rocksolid_slide.php index f7227e5..8ceac2d 100644 --- a/languages/en/tl_rocksolid_slide.php +++ b/languages/en/tl_rocksolid_slide.php @@ -42,6 +42,8 @@ $GLOBALS['TL_LANG']['tl_rocksolid_slide']['videos'][1] = 'Choose one or more video files to create a video slide.'; $GLOBALS['TL_LANG']['tl_rocksolid_slide']['singleSRC'][0] = 'Image'; $GLOBALS['TL_LANG']['tl_rocksolid_slide']['singleSRC'][1] = 'Choose an image if you want to create an image slide or a video slide (preview image).'; +$GLOBALS['TL_LANG']['tl_rocksolid_slide']['thumbImage'][0] = 'Thumbnail Image'; +$GLOBALS['TL_LANG']['tl_rocksolid_slide']['thumbImage'][1] = 'Choose a preview image for the thumbnail navigation.'; $GLOBALS['TL_LANG']['tl_rocksolid_slide']['scaleMode'][0] = 'Scale mode'; $GLOBALS['TL_LANG']['tl_rocksolid_slide']['scaleMode'][1] = 'Scale mode of the image. This setting overwrites the module settings.'; $GLOBALS['TL_LANG']['tl_rocksolid_slide']['scaleModes']['fit'] = 'Proportional'; diff --git a/src/MadeYourDay/Contao/Module/Slider.php b/src/MadeYourDay/Contao/Module/Slider.php index a38fc7c..60637e5 100644 --- a/src/MadeYourDay/Contao/Module/Slider.php +++ b/src/MadeYourDay/Contao/Module/Slider.php @@ -175,6 +175,11 @@ protected function compile() $newImage = new \stdClass(); $image['size'] = isset($this->imgSize) ? $this->imgSize : $this->size; $this->addImageToTemplate($newImage, $image); + if ($this->rsts_navType === 'thumbs') { + $newImage->thumb = new \stdClass; + $image['size'] = $this->rsts_thumbs_imgSize; + $this->addImageToTemplate($newImage->thumb, $image); + } $images[$key] = $newImage; } @@ -210,7 +215,22 @@ protected function compile() $options = array(); // strings - foreach (array('type', 'direction', 'cssPrefix', 'skin', 'width', 'height', 'navType', 'scaleMode', 'imagePosition', 'deepLinkPrefix') as $key) { + foreach (array( + 'type', + 'direction', + 'cssPrefix', + 'skin', + 'width', + 'height', + 'navType', + 'scaleMode', + 'imagePosition', + 'deepLinkPrefix', + 'thumbs_width', + 'thumbs_height', + 'thumbs_scaleMode', + 'thumbs_imagePosition', + ) as $key) { if (! empty($this->arrData['rsts_' . $key])) { $options[$key] = $this->arrData['rsts_' . $key]; } @@ -230,26 +250,57 @@ protected function compile() } // boolean - foreach (array('random', 'loop', 'videoAutoplay', 'autoplayProgress', 'pauseAutoplayOnHover', 'keyboard', 'captions', 'controls', 'combineNavItems') as $key) { + foreach (array( + 'random', + 'loop', + 'videoAutoplay', + 'autoplayProgress', + 'pauseAutoplayOnHover', + 'keyboard', + 'captions', + 'controls', + 'combineNavItems', + 'thumbs_controls', + ) as $key) { $options[$key] = (bool) $this->arrData['rsts_' . $key]; } // positive numbers - foreach (array('preloadSlides', 'duration', 'autoplay', 'autoplayRestart', 'slideMaxCount', 'slideMinSize', 'slideMaxSize', 'rowMaxCount', 'rowMinSize', 'prevNextSteps', 'visibleAreaMax') as $key) { + foreach (array( + 'preloadSlides', + 'duration', + 'autoplay', + 'autoplayRestart', + 'slideMaxCount', + 'slideMinSize', + 'slideMaxSize', + 'rowMaxCount', + 'rowMinSize', + 'prevNextSteps', + 'visibleAreaMax', + 'thumbs_duration', + 'thumbs_slideMaxCount', + 'thumbs_slideMinSize', + 'thumbs_slideMaxSize', + 'thumbs_rowMaxCount', + 'thumbs_rowMinSize', + 'thumbs_prevNextSteps', + 'thumbs_visibleAreaMax', + ) as $key) { if (! empty($this->arrData['rsts_' . $key]) && $this->arrData['rsts_' . $key] > 0) { $options[$key] = $this->arrData['rsts_' . $key] * 1; } } // percentages - foreach (array('visibleArea') as $key) { + foreach (array('visibleArea', 'thumbs_visibleArea') as $key) { if (!empty($this->arrData['rsts_' . $key])) { $options[$key] = $this->arrData['rsts_' . $key] / 100; } } // ratios - foreach (array('rowSlideRatio') as $key) { + foreach (array('rowSlideRatio', 'thumbs_rowSlideRatio') as $key) { if (!empty($this->arrData['rsts_' . $key])) { $ratio = explode('x', $this->arrData['rsts_' . $key], 2); if (empty($ratio[1])) { @@ -263,15 +314,28 @@ protected function compile() } // gap size - if (isset($this->arrData['rsts_gapSize']) && $this->arrData['rsts_gapSize'] !== '') { - if (substr($this->arrData['rsts_gapSize'], -1) === '%') { - $options['gapSize'] = $this->arrData['rsts_gapSize']; + foreach (array('gapSize', 'thumbs_gapSize') as $key) { + if (isset($this->arrData['rsts_' . $key]) && $this->arrData['rsts_' . $key] !== '') { + if (substr($this->arrData['rsts_' . $key], -1) === '%') { + $options[$key] = $this->arrData['rsts_' . $key]; + } + else { + $options[$key] = $this->arrData['rsts_' . $key] * 1; + } } - else { - $options['gapSize'] = $this->arrData['rsts_gapSize'] * 1; + } + + foreach ($options as $key => $value) { + if (substr($key, 0, 7) === 'thumbs_') { + $options['thumbs'][substr($key, 7)] = $value; + unset($options[$key]); } } + if (empty($this->arrData['rsts_thumbs']) && isset($options['thumbs'])) { + unset($options['thumbs']); + } + $this->Template->options = $options; $GLOBALS['TL_JAVASCRIPT'][] = 'system/modules/rocksolid-slider/assets/js/rocksolid-slider.min.js|static'; @@ -415,6 +479,48 @@ protected function parseSlides($objSlides) $slide['backgroundVideos'] = $videos; } + if ($this->rsts_navType === 'thumbs') { + $slide['thumb'] = new \stdClass; + if ( + trim($slide['thumbImage']) && + ($file = version_compare(VERSION, '3.2', '<') + ? \FilesModel::findByPk($slide['thumbImage']) + : \FilesModel::findByUuid($slide['thumbImage']) + ) && + ($fileObject = new \File($file->path, true)) && + ($fileObject->isGdImage || $fileObject->isImage) + ) { + $this->addImageToTemplate($slide['thumb'], array( + 'id' => $file->id, + 'name' => $fileObject->basename, + 'singleSRC' => $file->path, + 'size' => $this->rsts_thumbs_imgSize, + )); + } + elseif ( + trim($slide['singleSRC']) && + ($file = version_compare(VERSION, '3.2', '<') + ? \FilesModel::findByPk($slide['singleSRC']) + : \FilesModel::findByUuid($slide['singleSRC']) + ) && + ($fileObject = new \File($file->path, true)) && + ($fileObject->isGdImage || $fileObject->isImage) + ) { + $this->addImageToTemplate($slide['thumb'], array( + 'id' => $file->id, + 'name' => $fileObject->basename, + 'singleSRC' => $file->path, + 'size' => $this->rsts_thumbs_imgSize, + )); + } + elseif (!empty($slide['image']->src)) { + $slide['thumb'] = clone $slide['image']; + } + elseif (!empty($slide['backgroundImage']->src)) { + $slide['thumb'] = clone $slide['backgroundImage']; + } + } + $slides[] = $slide; } diff --git a/templates/rsts_default.html5 b/templates/rsts_default.html5 index 0277487..ee354bc 100644 --- a/templates/rsts_default.html5 +++ b/templates/rsts_default.html5 @@ -13,14 +13,14 @@ images as $key => $image): ?> options['preloadSlides']) && $key > $this->options['preloadSlides']): ?> -