From: vincent@cubedesigners.com Date: Mon, 23 Apr 2018 15:10:25 +0000 (+0000) Subject: #2027 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=b731c0244939672d29481253236f6c79d4e53051;p=cubeextranet.git #2027 --- 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 96b1fc1fc..1fc964677 100644 --- a/inc/ws/Util/html5/master/class.ws.html5.compiler.php +++ b/inc/ws/Util/html5/master/class.ws.html5.compiler.php @@ -1523,6 +1523,7 @@ class wsHTML5Compiler // Links Styles $lessVariables['links-color'] = wsHTML5::colorToCSS($this->theme->parametres->linksColor); + $lessVariables['inlineslideshow-transition-time'] = (floatval($this->book->parametres->inlineSlideshowTransitionDuration) * 1000) . 'ms'; $res = array_merge($res, $links); // Bookmarks 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 209e212b2..4bda4a72a 100644 --- a/inc/ws/Util/html5/master/class.ws.html5.links.php +++ b/inc/ws/Util/html5/master/class.ws.html5.links.php @@ -107,7 +107,12 @@ class wsHTML5Link case 14: return new colorLink($id, $init, $compiler); case 15: + + if (stristr($init['to'], '.zip')) { + return new inlineSlideshowLink($id, $init, $compiler); + } else { return new imageLink($id, $init, $compiler); + } case 16: return new fileLink($id, $init, $compiler); case 17: @@ -214,7 +219,7 @@ class wsHTML5Link public function getHTMLContainer() { - return '
' . $this->getHTMLContent() . '
'; + return '
getAdditionnalContent() . '>' . $this->getHTMLContent() . '
'; } public function getHTMLContainerClass() @@ -233,6 +238,7 @@ class wsHTML5Link public function getAdditionnalContent() { + return ''; } @@ -920,6 +926,27 @@ class imageLink extends contentLink } +class inlineSlideshowLink extends contentLink +{ + 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); + + return '
'; + } +} + class fileLink extends normalLink {