$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);
}
$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;
}
$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
'fade' => false,
];
- $this->getURL();
+
$slides = [];
$slides_options = [];
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>';
}
$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)
$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] : '';