]> _ Git - cubeextranet.git/commitdiff
wait #5054 @2.5
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Thu, 17 Mar 2022 17:50:26 +0000 (17:50 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Thu, 17 Mar 2022 17:50:26 +0000 (17:50 +0000)
inc/ws/Util/html5/master/class.ws.html5.compiler.php
inc/ws/Util/html5/master/class.ws.html5.links.php

index fb5f6c473fa7030fcb773c9f3f79b26d4ad366f8..fbbc3f692030b3ea72895965f5c3debdb82c51c5 100644 (file)
@@ -3150,12 +3150,8 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
         $this->vdir->copyDirectory($source, $dest);
     }
 
-    public function simpleCopyLinkFile($source, $dest, $addVdir = true)
+    public function simpleCopyLinkFile($source, $dest)
     {
-        if ($addVdir) {
-            $dest = $dest;
-        }
-
         if (stripos($source, '.svg') !== false) {
             $source = $this->_fixSVG($source);
         }
index a46a704bac8f456cb4c744ebeb808dbb285247c0..5c7ff4661c87d06f886161bc53202a9ac13c65e3 100644 (file)
@@ -2964,7 +2964,9 @@ class slideshowLink extends normalLink
         $this->copyExternalDir($d['dir'], $d['fdir']);
 
         $this->path = $d['fdir'];
-        $this->path_absolute = $this->compiler->vdir->path($d['fdir']);
+
+        // Do not use path from vdir. It can not be in sync with the source files
+        $this->path_absolute = $d['dir'];
 
         return '#/slideshow/' . $this->uid;
     }
@@ -2989,6 +2991,8 @@ class slideshowLink extends normalLink
 
         $this->allowed_extensions = ['jpg', 'png', 'jpeg', 'gif', 'svg'];
 
+        $this->getURL();
+
         $slideshowID = 'slideshow_' . $this->uid;
         $XML_path = $this->path_absolute . '/slideshow.xml'; // Optional file so it may not exist
 
@@ -2998,7 +3002,7 @@ class slideshowLink extends normalLink
             'fade' => false,
         ];
 
-        $this->getURL();
+
 
         $slides = [];
         $slides_options = [];
@@ -3041,14 +3045,13 @@ class slideshowLink extends normalLink
             if (empty($slides)) {
                 $slides = $this->_getSlidesFromDirectory($this->path_absolute);
             }
-
         } else {
             // Or by default, just get all the images that were in the zip file...
             $slides = $this->_getSlidesFromDirectory($this->path_absolute);
-
             $thumbnails = (count($slides) > 1);
         }
 
+
         // 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, $slides_options) . '</div>';
 
@@ -3058,9 +3061,7 @@ class slideshowLink extends normalLink
         }
 
         $lib = $context === 'popup' ? $this->compiler->book->parametres->popupSlideshowLibrary : $this->compiler->book->parametres->inlineSlideshowLibrary;
-        $res = '<div class="fb-slideshow-wrapper ' . $lib . ' fb-slideshow-' . $context . '">' . $res . '</div>';
-
-        return $res;
+        return '<div class="fb-slideshow-wrapper ' . $lib . ' fb-slideshow-' . $context . '">' . $res . '</div>';
     }
 
     protected function _getSlidesFromDirectory($path)
@@ -3102,7 +3103,7 @@ class slideshowLink extends normalLink
         $res .= '<ul class="splide__list">';
 
         foreach ($slides as $slide) {
-            $image_path_relative = $this->compiler->vdir->relativePath($slide['path']);
+            $image_path_relative = preg_replace('/^\/(.*)data\/links\/(.*)$/U','data/links/$2',$slide['path']);
             $image_info = CubeIT_Image::getimagesize($slide['path']);
             $image_info_json = ($image_info) ? json_encode(['width' => $image_info[0], 'height' => $image_info[1], 'ratio' => round($image_info[0] / $image_info[1], 4)]) : '';
             $image_dimensions = ($image_info && isset($image_info[3])) ? $image_info[3] : '';