]> _ Git - fluidbook-toolbox.git/commitdiff
wait #6076 @1.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Sat, 24 Jun 2023 10:47:54 +0000 (12:47 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Sat, 24 Jun 2023 10:47:54 +0000 (12:47 +0200)
app/Fields/FluidbookLinkEditor/Layer.php
app/Fluidbook/Compiler/Links.php
app/SubForms/Link/Base.php

index c4c1ecf2b1af13fb71bf4056150a93a9c7ced748..1b142a6867dfed3d1d953a17ff9322623a7bd7c9 100644 (file)
@@ -14,7 +14,7 @@ class Layer extends SelectFromArray
     {
         return [
             'both' => __('Texte et image'),
-//            'text' => __('Texte'),
+            'text' => __('Texte'),
             'image' => __('Image'),
         ];
     }
index 91577746ab7ff69e4ed8691d4933cccbb087e0ea..8bf55b8f1139479c64e2cf6422e8d0818184e8a6 100644 (file)
@@ -150,6 +150,17 @@ trait Links
 
 
         foreach ($linksCopy as $k => $linkData) {
+            if ($linkData['type'] == Link::LAYER && $linkData['to'] == 'text') {
+                $dupData = $linkData;
+                $dupData['type'] = Link::LAYER;
+                $dupData['to'] = 'image';
+                $dupData['uid'] = 'li_' . $linkData['uid'];
+                $dupData['addzindex'] = -1;
+                $dupData['image_rollover'] = '';
+                array_push($links, $dupData);
+                array_push($links, $linkData);
+                unset($links[$k]);
+            }
             if ($this->fluidbookSettings->PDFRendererIframe === 'svg' && (($linkData['type'] == Link::IFRAME && stristr($linkData['to'], '.pdf')) || ($linkData['type'] == Link::MULTIMEDIA && stristr($linkData['to'], '.pdf')))) {
                 $ofile = $this->wdir . '/' . $linkData['to'];
                 $dfile = $this->wdir . '/' . $linkData['to'] . '.svg';
index 721733a64ff585ec84ce084659af966d76ffc392..610950ddd680702bb3d28de579265c0087520b15 100644 (file)
@@ -314,8 +314,10 @@ class Base extends Form
 
                 }
             }
-            if ($type['type'] === 6) {
+            if ($type['type'] === Link::MULTIMEDIA) {
                 $optionsChoices['to'] = ['file.jpg', 'file.zip'];
+            } else if ($type['type'] === Link::LAYER) {
+                $optionsChoices['to'] = ['', 'both', 'image', 'text'];
             }
 
             $configs[$type['type']] = $optionsChoices;