]> _ Git - cubeextranet.git/commitdiff
#2027
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Mon, 23 Apr 2018 15:10:25 +0000 (15:10 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Mon, 23 Apr 2018 15:10:25 +0000 (15:10 +0000)
inc/ws/Util/html5/master/class.ws.html5.compiler.php
inc/ws/Util/html5/master/class.ws.html5.links.php

index 96b1fc1fcb23e0b85630756c3186c492b4b9c190..1fc9646771af0ddb6746f6947b20a19b59bc9ec7 100644 (file)
@@ -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
index 209e212b21c3163078222090dc5975ef4bba1703..4bda4a72a3271bba1d8f280137be2d11893cb09b 100644 (file)
@@ -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 '<div class="' . $this->getHTMLContainerClass() . '" data-id="' . $this->uid . '" id="l_' . $this->id . '">' . $this->getHTMLContent() . '</div>';
+               return '<div class="' . $this->getHTMLContainerClass() . '" data-id="' . $this->uid . '" id="l_' . $this->id . '"' . $this->getAdditionnalContent() . '>' . $this->getHTMLContent() . '</div>';
     }
 
     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 '<div class="inlineslideshow" data-dir="' . str_replace('.', '_', $this->to) . '" data-images="' . $f . '"></div>';
+       }
+}
+
 class fileLink extends normalLink
 {