]> _ Git - fluidbook_tools.git/commitdiff
wip #5817
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 22 Mar 2023 17:17:02 +0000 (18:17 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 22 Mar 2023 17:17:02 +0000 (18:17 +0100)
src/Links/Link.php
src/Links/SlideshowLink.php

index 344f055dbd0ff047b9ce0bacd24d6d5d69550ac7..1e926939ffb33475bd4fd3e6c5f89370fee0f905 100644 (file)
@@ -6,6 +6,7 @@ use Cubist\Util\ArrayUtil;
 use Cubist\Util\Crypt;
 use Cubist\Util\CSS;
 use Cubist\Util\Files\Files;
+use Cubist\Util\Files\RecursiveDirectoryIterator;
 use Cubist\Util\Json;
 use Cubist\Util\ObjectUtil;
 use Cubist\Util\Text;
@@ -170,8 +171,19 @@ class Link {
                 return new FacebookLikeLink($id, $init, $compiler);
             case 30:
                 if (stristr($init['to'], '.zip')) {
+                    $d = $compiler->unzipFile($init['to'], false, null, true);
+                    if (Files::count($d['dir']) === 1) {
+                        $it = new RecursiveDirectoryIterator($d['dir']);
+                        foreach ($it as $item) {
+                            /** @var $item \SplFileInfo */
+                            copy($item->getPathname(), $compiler->getWorkingDir() . '/' . $item->getFilename());
+                            $init['to'] = $item->getFilename();
+                            return new HTMLMultimediaPopupImage($id, $init, $compiler);
+                        }
+
+                    }
                     return new SlideshowLink($id, $init, $compiler);
-                }else{
+                } else {
                     return new HTMLMultimediaPopupImage($id, $init, $compiler);
                 }
             case 31:
index 58886d27633d1c9b93ed4762bacc0399f28e6696..cf13da99af14630f5ec3bf530ec1ffb348cca880 100644 (file)
@@ -137,6 +137,8 @@ class SlideshowLink extends NormalLink {
         return $slides;
     }
 
+
+
     protected function _slides($slides, $options = []) {
         $default_options = [
             'show_captions' => true,