$this->fields['videoBigPlay'] = array('type' => 'boolean', 'default' => true, 'editable' => true, 'label' => __('Afficher le gros bouton Play'), 'grade' => 3);
$this->fields['brightcovePlayerId'] = array('type' => 'text', 'default' => '', 'editable' => true, 'label' => __('Brightcove Player Id'), 'grade' => 3);
$this->fields['brightcovePlayerSecret'] = array('type' => 'text', 'default' => '', 'editable' => true, 'label' => __('Brightcove Player Secret'), 'grade' => 3);
+ $this->fields['slideshowCaptionSize'] = array('type' => 'text', 'default' => '', 'editable' => true, 'label' => __('Taille de police de la légende du diaporama'), 'hint' => __('Laisser vide pour utiliser la valeur par défaut'));
$this->fields['inlineSlideshowTransitionDuration'] = array('type' => 'float', 'default' => 0.75, 'editable' => true, 'label' => __('Durée de la transition des diaporamas intégrés aux pages(s)'));
$this->fields['inlineSlideshowDuration'] = array('type' => 'float', 'default' => 7, 'editable' => true, 'label' => __('Temps d\'attente des diaporamas intégrés aux pages (s)'));
$this->fields['textPopupStylesheet'] = ['type' => 'freefile', 'default' => '', 'editable' => true, 'label' => __('Feuille de style des popups de texte'), 'fileFilter' => $cssFilter];
$this->fields['OAMChromeFactor'] = ['type' => 'float', 'default' => '1', 'editable' => true, 'label' => __('Facteur OAM Chrome')];
$this->fields['OAMIEFactor'] = ['type' => 'float', 'default' => '1', 'editable' => true, 'label' => __('Facteur OAM IE11')];
$this->forms['multimedia'] = array('label' => __('Liens et multimédia'),
- 'fieldsnames' => array('permanentLinks', 'linkBlinkTime', 'linkBlinkRepetition', '|', 'customLinkClass', 'ignoreLinksTypes', 'linkTooltipManager', 'linkCornerSize', 'linkTooltipMaxWidth', '|', 'linkTracker', 'linkTrackerRegexp', '|', 'linkFilePrefix', '|', 'linkMultimediaPerformanceMode', 'linkMultimediaQuality', '|', 'inlineSlideshowTransitionDuration', 'inlineSlideshowDuration', '|', 'videoReset', 'videoBigPlay', '|', 'brightcovePlayerId', 'brightcovePlayerSecret', '|', 'textPopupStylesheet', 'textPopupWidth', '|', 'iframePopupMaxWidth', '|', 'OAMChromeFactor', 'OAMIEFactor'));
+ 'fieldsnames' => array('permanentLinks', 'linkBlinkTime', 'linkBlinkRepetition', '|', 'customLinkClass', 'ignoreLinksTypes', 'linkTooltipManager', 'linkCornerSize', 'linkTooltipMaxWidth', '|', 'linkTracker', 'linkTrackerRegexp', '|', 'linkFilePrefix', '|', 'linkMultimediaPerformanceMode', 'linkMultimediaQuality', '|', 'slideshowCaptionSize', 'inlineSlideshowTransitionDuration', 'inlineSlideshowDuration', '|', 'videoReset', 'videoBigPlay', '|', 'brightcovePlayerId', 'brightcovePlayerSecret', '|', 'textPopupStylesheet', 'textPopupWidth', '|', 'iframePopupMaxWidth', '|', 'OAMChromeFactor', 'OAMIEFactor'));
//.
$this->fields['downloadPortionPDF'] = ['type' => 'freefile', 'default' => '', 'editable' => true, 'label' => 'PDF utilisé pour le téléchargement des extraits'];
$this->fields['downloadPortionZoom'] = ['type' => 'integer', 'default' => 8, 'editable' => false, 'editable' => true, 'label' => __('Zoom des images extraites')];
$this->getURL();
$slides = [];
+ $slides_options = [];
// If the zip file contained a slideshow.xml file, use that for fetching images and their captions
if (file_exists($XML_path)) {
$slideshow_settings['type'] = 'fade';
$slideshow_settings['rewind'] = true; // Loop infinitely
}
+
+ // Autoplay
if (isset($slideshowData->_autoplay) && $slideshowData->_autoplay == 'true') {
$slideshow_settings['autoplay'] = true;
}
+ // Allow caption font-size to be overridden from XML file
+ $slides_options['caption_size'] = $slideshowData->_captionsize ?? null;
+
+
if (isset($slideshowData->image)) {
$images = [];
if (is_array($slideshowData->image)) {
}
// Main slider
- $res = '<div class="fb-slideshow splide" id="' . $slideshowID . '" data-open-index="' . $this->extra . '" data-thumbnails="' . ($thumbnails ? '1' : '0') . '" data-splide=\'' . json_encode($slideshow_settings) . '\'>' . $this->_slides($slides) . '</div>';
+ $res = '<div class="fb-slideshow splide" id="' . $slideshowID . '" data-open-index="' . $this->extra . '" data-thumbnails="' . ($thumbnails ? '1' : '0') . '" data-splide=\'' . json_encode($slideshow_settings) . '\'>' . $this->_slides($slides, $slides_options) . '</div>';
// Thumbnails slider
if ($thumbnails) {
- $res .= '<div class="fb-slideshow-thumbnails splide" id="' . $slideshowID . '_thumbnails">' . $this->_slides($slides, false, $this->thumbnail_height) . '</div>';
+ $res .= '<div class="fb-slideshow-thumbnails splide" id="' . $slideshowID . '_thumbnails">' . $this->_slides($slides, ['show_captions' => false, 'max_height' => $this->thumbnail_height]) . '</div>';
}
$res = '<div class="fb-slideshow-wrapper">' . $res . '</div>';
return $slides;
}
- protected function _slides($slides, $show_captions = true, $max_height = null)
+ protected function _slides($slides, $options = [])
{
+ $default_options = [
+ 'show_captions' => true,
+ 'caption_size' => null,
+ 'max_height' => null,
+ ];
+
+ $options = array_merge($default_options, $options);
$res = '<div class="splide__track">';
$res .= '<ul class="splide__list">';
// When displaying thumbnails, they are a fixed size, based on height
// We set dimensions here to avoid extra work on the client side
- if ($max_height && $image_info) {
- $thumb_width = round($max_height / $image_info[1] * $image_info[0]); // max_height / image_height * image_width
- $image_dimensions = 'style="width:' . $thumb_width . 'px; height:' . $max_height . 'px"';
+ if ($options['max_height'] && $image_info) {
+ $thumb_width = round($options['max_height'] / $image_info[1] * $image_info[0]); // max_height / image_height * image_width
+ $image_dimensions = 'style="width:' . $thumb_width . 'px; height:' . $options['max_height'] . 'px"';
}
$res .= '<li class="fb-slideshow-slide splide__slide">';
$res .= '<img class="fb-slideshow-slide-image" src="' . $image_path_relative . '" data-meta="' . htmlspecialchars($image_info_json, ENT_QUOTES) . '" ' . $image_dimensions . '>';
//$res .= '</div>'; // .splide__slide__container
- if ($show_captions && null !== $slide['caption']) {
- $res .= '<p class="fb-slideshow-slide-caption">' . $slide['caption'] . '</p>';
+ if ($options['show_captions'] && null !== $slide['caption']) {
+
+ // Caption font size can be overridden if specified in XML
+ $caption_style = $options['caption_size'] ? ' style="font-size:'. $options['caption_size'] .'"' : '';
+
+ $res .= '<p class="fb-slideshow-slide-caption"'. $caption_style .'>' . $slide['caption'] . '</p>';
}
$res .= '</li>'; // .fb-slideshow-slide