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 = '')
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
$less->execute();
$less->debug();
if (!file_exists($destination_css)) {
+ die($less->output);
continue;
}
$this->vdir->copy($destination_css, 'style/' . $f . '.css');
}
-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 '<div class="inlineslideshow" data-dir="' . str_replace('.', '_', $this->to) . '" data-images="' . $f . '"></div>';
+ return $this->generateSlideshow('inline');
}
}
public function getAdditionnalContent()
{
- return 'data-slideshow="' . rawurlencode($this->generateSlideshow()) . '" ';
+ return 'data-slideshow="' . rawurlencode($this->generateSlideshow('popup')) . '" ';
}
// public function keep() {
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'];
$res .= '<div class="fb-slideshow-thumbnails splide" id="' . $slideshowID . '_thumbnails">' . $this->_slides($slides, ['show_captions' => false, 'max_height' => $this->thumbnail_height]) . '</div>';
}
- $res = '<div class="fb-slideshow-wrapper">' . $res . '</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;
}