From: stephen@cubedesigners.com Date: Wed, 30 Sep 2020 17:07:41 +0000 (+0000) Subject: WIP #3917 @1 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=839e296a3e3c88f23e49f6c9cc12d1fa2cc3b965;p=cubeextranet.git WIP #3917 @1 --- diff --git a/inc/ws/Metier/class.ws.book.parametres.php b/inc/ws/Metier/class.ws.book.parametres.php index a0739a372..9da3ec260 100644 --- a/inc/ws/Metier/class.ws.book.parametres.php +++ b/inc/ws/Metier/class.ws.book.parametres.php @@ -436,6 +436,7 @@ class wsBookParametres extends wsParametres $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]; @@ -444,7 +445,7 @@ class wsBookParametres extends wsParametres $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')]; diff --git a/inc/ws/Util/html5/master/class.ws.html5.compiler.php b/inc/ws/Util/html5/master/class.ws.html5.compiler.php index 335ef58cd..27289ee2a 100644 --- a/inc/ws/Util/html5/master/class.ws.html5.compiler.php +++ b/inc/ws/Util/html5/master/class.ws.html5.compiler.php @@ -2091,6 +2091,8 @@ class wsHTML5Compiler // Links Styles $this->lessVariables['links-color'] = wsHTML5::colorToCSS($this->theme->parametres->linksColor); $this->lessVariables['inlineslideshow-transition-time'] = (floatval($this->book->parametres->inlineSlideshowTransitionDuration) * 1000) . 'ms'; + $this->lessVariables['slideshow-caption-size'] = $this->book->parametres->slideshowCaptionSize ?: '16px'; + $res = array_merge($res, $links); // Bookmarks diff --git a/inc/ws/Util/html5/master/class.ws.html5.links.php b/inc/ws/Util/html5/master/class.ws.html5.links.php index 2fe024cfb..517878b61 100644 --- a/inc/ws/Util/html5/master/class.ws.html5.links.php +++ b/inc/ws/Util/html5/master/class.ws.html5.links.php @@ -2277,6 +2277,7 @@ class slideshowLink extends normalLink $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)) { @@ -2289,10 +2290,16 @@ class slideshowLink extends normalLink $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)) { @@ -2321,11 +2328,11 @@ class slideshowLink extends normalLink } // Main slider - $res = '
' . $this->_slides($slides) . '
'; + $res = '
' . $this->_slides($slides, $slides_options) . '
'; // Thumbnails slider if ($thumbnails) { - $res .= '
' . $this->_slides($slides, false, $this->thumbnail_height) . '
'; + $res .= '
' . $this->_slides($slides, ['show_captions' => false, 'max_height' => $this->thumbnail_height]) . '
'; } $res = '
' . $res . '
'; @@ -2358,8 +2365,15 @@ class slideshowLink extends normalLink 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 = '
'; $res .= '
'; // .splide__slide__container - if ($show_captions && null !== $slide['caption']) { - $res .= '

' . $slide['caption'] . '

'; + 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 .= '

' . $slide['caption'] . '

'; } $res .= ''; // .fb-slideshow-slide