]> _ Git - cubeextranet.git/commitdiff
wait #5742 @1
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Fri, 17 Feb 2023 13:42:24 +0000 (13:42 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Fri, 17 Feb 2023 13:42:24 +0000 (13:42 +0000)
inc/config.inc.php
inc/ws/Util/html5/master/class.ws.html5.compiler.php
inc/ws/Util/html5/master/class.ws.html5.links.php

index 2d104b743c57186ae1244799cc04822c4f8f0d49..fd09324c749587423a4144f3dea34d4801b02508 100644 (file)
@@ -76,3 +76,4 @@ define('TIMEZONE', 'UTC');
 define('CUBE_SEARCH_LIMIT_CHARS', 3);
 
 define('PUBLIC_PATH', realpath(dirname(__FILE__) . '/..'));
+define('FILES_PATH', PUBLIC_PATH . '/files');
index 3c84a7304cf47bbf875100249c4d1cf9d8c83316..327820c94d502b3565d73066af6265f199a036be 100644 (file)
@@ -3658,7 +3658,8 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
             }
         }
 
-        return array('dir' => $dir, 'fdir' => $fdir);
+        $res=['dir' => $dir, 'fdir' => $fdir];
+        return $res;
     }
 
     public function getConfigZIP($d)
index b237016e1c7f081c4e9b6fc93dcf9be5716a32d6..436a5fc79439bb801be4f8b619c24e20b191cbff 100644 (file)
@@ -3085,8 +3085,7 @@ class slideshowLink extends normalLink
         $this->copyExternalDir($d['dir'], $d['fdir']);
 
         $this->path = $d['fdir'];
-
-        // Do not use path from vdir. It can not be in sync with the source files
+        // Do not use path from vdir. It can be not in sync with the source files
         $this->path_absolute = $d['dir'];
 
         return '#/slideshow/' . $this->uid;
@@ -3155,8 +3154,7 @@ class slideshowLink extends normalLink
                     $images = [$slideshowData->image];
                 }
                 foreach ($images as $img) {
-                    $full_path = $this->path_absolute . '/' . $img->_name;
-                    $slides[] = ['caption' => $img->_caption, 'path' => $full_path];
+                    $slides[] = ['caption' => $img->_caption, 'path' => $this->path . '/' . $img->_name, 'absolute_path' => $this->path_absolute . '/' . $img->_name];
                 }
             }
 
@@ -3171,7 +3169,6 @@ class slideshowLink extends normalLink
             $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>';
 
@@ -3202,7 +3199,7 @@ class slideshowLink extends normalLink
             if (!in_array($ext, $this->allowed_extensions)) {
                 continue;
             }
-            $slides[] = ['path' => $file->getPathname(), 'caption' => null];
+            $slides[] = ['path' => $this->path . '/' . $file->getFilename(), 'absolute_path' =>  $file->getPathname(), 'caption' => null];
             uasort($slides, [$this, '_orderSlidesByFilename']);
         }
 
@@ -3223,8 +3220,7 @@ class slideshowLink extends normalLink
         $res .= '<ul class="splide__list">';
 
         foreach ($slides as $slide) {
-            $image_path_relative = preg_replace('/^\/(.*)data\/links\/(.*)$/U', 'data/links/$2', $slide['path']);
-            $image_info = CubeIT_Image::getimagesize($slide['path']);
+            $image_info = CubeIT_Image::getimagesize($slide['absolute_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] : '';
 
@@ -3237,7 +3233,7 @@ class slideshowLink extends normalLink
 
             $res .= '<li class="fb-slideshow-slide splide__slide">';
             //$res .= '<div class="splide__slide__container">';
-            $res .= '<img class="fb-slideshow-slide-image" src="' . $image_path_relative . '" data-meta="' . htmlspecialchars($image_info_json, ENT_QUOTES) . '" ' . $image_dimensions . '>';
+            $res .= '<img class="fb-slideshow-slide-image" src="' . $slide['path'] . '" data-meta="' . htmlspecialchars($image_info_json, ENT_QUOTES) . '" ' . $image_dimensions . '>';
             //$res .= '</div>'; // .splide__slide__container
 
             if ($options['show_captions'] && null !== $slide['caption']) {