]> _ Git - fluidbook_tools.git/commitdiff
wait #6729 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 14 Feb 2024 15:47:29 +0000 (16:47 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 14 Feb 2024 15:47:29 +0000 (16:47 +0100)
src/Links/Link.php

index 9850516076817a30ea185fe1c473e5263a898add..8e7610bad18404ae4c7a45db7c436da28747b4f6 100644 (file)
@@ -15,7 +15,6 @@ use Cubist\Util\Text;
 use Cubist\Util\Xml;
 use Fluidbook\Tools\Compiler\CompilerInterface;
 use Illuminate\Support\Facades\Cache;
-use Illuminate\Support\Facades\Log;
 use SodiumException;
 use stdClass;
 
@@ -258,11 +257,12 @@ class Link
                 if (stristr($init['to'], '.zip')) {
                     $d = $compiler->unzipFile($init['to'], false, null, true);
                     if (Files::count($d['dir']) === 1) {
+                        $zname = str_replace('.', '_', $init['to']);
                         $it = new RecursiveDirectoryIterator($d['dir']);
                         foreach ($it as $item) {
                             /** @var $item \SplFileInfo */
-                            copy($item->getPathname(), $compiler->getWorkingDir() . '/' . $item->getFilename());
-                            $init['to'] = $item->getFilename();
+                            copy($item->getPathname(), $compiler->getWorkingDir() . '/' . $zname . '_' . $item->getFilename());
+                            $init['to'] = $zname . '_' . $item->getFilename();
                             return new HTMLMultimediaPopupImage($id, $init, $compiler);
                         }
 
@@ -612,7 +612,7 @@ class Link
         }
 
         $attached = $this->attached ? ' data-attached="' . $this->attached . '" ' : '';
-        return '<div class="' . $this->getHTMLContainerClass() . '" style="mix-blend-mode:' . $this->blendmode . ';'.$this->inlineStyles.'" data-blendmode="' . $this->blendmode . '" ' . $attached . ' data-hidden="' . $this->hidden . '" data-scorm="' . $this->scorm . '" data-id="' . $this->uid . '" id="l_' . $this->id . '"' . $addContent . '>' . $this->getHTMLContent() . '</div>';
+        return '<div class="' . $this->getHTMLContainerClass() . '" style="mix-blend-mode:' . $this->blendmode . ';' . $this->inlineStyles . '" data-blendmode="' . $this->blendmode . '" ' . $attached . ' data-hidden="' . $this->hidden . '" data-scorm="' . $this->scorm . '" data-id="' . $this->uid . '" id="l_' . $this->id . '"' . $addContent . '>' . $this->getHTMLContent() . '</div>';
     }
 
     public function getHTMLContainerClass()