From: vincent@cubedesigners.com Date: Mon, 23 Nov 2020 16:18:45 +0000 (+0000) Subject: wait #4083 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=9d8b8f00dae45b18d9edb337ed7da4b20d53d50b;p=cubeextranet.git wait #4083 --- 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 79dd5af4b..3b3f06976 100644 --- a/inc/ws/Util/html5/master/class.ws.html5.compiler.php +++ b/inc/ws/Util/html5/master/class.ws.html5.compiler.php @@ -1725,9 +1725,10 @@ class wsHTML5Compiler if ($l === 'splide') { $this->addJsLib('splide', 'js/libs/splide/splide.js'); } - $this->addLess('slideshow/' . $l); + $this->addJsLib('slideshow', ['js/libs/fluidbook/slideshow/fluidbook.slideshow.js', 'js/libs/fluidbook/slideshow/fluidbook.slideshow.' . $l . '.js']); + $this->addLess('slideshow/' . $l); } public function addSEOArticle($page, $title, $intro, $image, $id = null, $url = null, $content = '') @@ -2291,9 +2292,14 @@ class wsHTML5Compiler continue; } + $dir = dirname($destination_css); + + if (file_exists($dir) && !is_dir($dir)) { + unlink($dir); + } // LESS file might be in a subfolder, so create if it doesn't exist - if (!is_dir(dirname($destination_less))) { - mkdir(dirname($destination_less), 0777, true); + if (!file_exists($dir)) { + mkdir($dir, 0777, true); } // Less files must be copied to temporary directory so they'll @@ -2305,6 +2311,7 @@ class wsHTML5Compiler $less->execute(); $less->debug(); if (!file_exists($destination_css)) { + die($less->output); continue; } $this->vdir->copy($destination_css, 'style/' . $f . '.css'); 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 d3179e4be..f5cc634b6 100644 --- a/inc/ws/Util/html5/master/class.ws.html5.links.php +++ b/inc/ws/Util/html5/master/class.ws.html5.links.php @@ -1459,25 +1459,11 @@ class imageLink extends contentLink } -class inlineSlideshowLink extends contentLink +class inlineSlideshowLink extends slideshowLink { public function getHTMLContent() { - $d = $this->unzipFile($this->to, false); - $this->compiler->vdir->copyDirectory($d['dir'], $d['fdir']); - - $iterator = CubeIT_Files::getRecursiveDirectoryIterator($d['dir']); - - $files = array(); - foreach ($iterator as $f) { - /* @var $f SplFileInfo */ - $files[] = $f->getFilename(); - } - sort($files); - $f = htmlspecialchars(json_encode($files), ENT_QUOTES); - - $this->compiler->addSlideshowLibrary(true); - return '
'; + return $this->generateSlideshow('inline'); } } @@ -2355,7 +2341,7 @@ class slideshowLink extends normalLink public function getAdditionnalContent() { - return 'data-slideshow="' . rawurlencode($this->generateSlideshow()) . '" '; + return 'data-slideshow="' . rawurlencode($this->generateSlideshow('popup')) . '" '; } // public function keep() { @@ -2367,9 +2353,9 @@ class slideshowLink extends normalLink return 'view slideshow'; } - public function generateSlideshow() + public function generateSlideshow($context) { - $this->compiler->addSlideshowLibrary(false); + $this->compiler->addSlideshowLibrary($context==='inline'); $this->allowed_extensions = ['jpg', 'png', 'jpeg', 'gif']; @@ -2443,7 +2429,8 @@ class slideshowLink extends normalLink $res .= '
' . $this->_slides($slides, ['show_captions' => false, 'max_height' => $this->thumbnail_height]) . '
'; } - $res = '
' . $res . '
'; + $lib = $context === 'popup' ? $this->compiler->book->parametres->popupSlideshowLibrary : $this->compiler->book->parametres->inlineSlideshowLibrary; + $res = '
' . $res . '
'; return $res; }