From: Vincent Vanwaelscappel Date: Sat, 24 Jun 2023 10:47:54 +0000 (+0200) Subject: wait #6076 @1.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=b055a98a105da6390a666a1919119721b544bf4b;p=fluidbook-toolbox.git wait #6076 @1.5 --- diff --git a/app/Fields/FluidbookLinkEditor/Layer.php b/app/Fields/FluidbookLinkEditor/Layer.php index c4c1ecf2b..1b142a686 100644 --- a/app/Fields/FluidbookLinkEditor/Layer.php +++ b/app/Fields/FluidbookLinkEditor/Layer.php @@ -14,7 +14,7 @@ class Layer extends SelectFromArray { return [ 'both' => __('Texte et image'), -// 'text' => __('Texte'), + 'text' => __('Texte'), 'image' => __('Image'), ]; } diff --git a/app/Fluidbook/Compiler/Links.php b/app/Fluidbook/Compiler/Links.php index 91577746a..8bf55b8f1 100644 --- a/app/Fluidbook/Compiler/Links.php +++ b/app/Fluidbook/Compiler/Links.php @@ -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'; diff --git a/app/SubForms/Link/Base.php b/app/SubForms/Link/Base.php index 721733a64..610950ddd 100644 --- a/app/SubForms/Link/Base.php +++ b/app/SubForms/Link/Base.php @@ -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;