]> _ Git - fluidbook-toolbox.git/commitdiff
wait #6035 @0.25
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 15 Jun 2023 06:51:14 +0000 (08:51 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 15 Jun 2023 06:51:14 +0000 (08:51 +0200)
app/Fluidbook/Link/LinksData.php
app/SubForms/Link/Base.php

index f529730abf312cd4bfc3c77bb3bcbadad3398d10..813a40aa647a6cbfa61aa352d99a2edf384de6bc 100644 (file)
@@ -25,6 +25,8 @@ class LinksData
 
     protected static $_webvideoServicesMap = [0 => 'youtube', 1 => 'dailymotion', 2 => 'vimeo', 3 => 'brightcove', 'none' => 'youtube'];
 
+    protected static $_aliases = [Link::PAGE_LABEL => Link::ANCHOR];
+
     /**
      * @throws Exception
      */
@@ -253,6 +255,7 @@ class LinksData
 
     protected static function _fixLinks(&$links)
     {
+        self::_fixTypes($links);
         self::_fixTooltips($links);
         self::_correctImageSpecialLinks($links);
         self::_fixWebVideoServices($links);
@@ -260,6 +263,15 @@ class LinksData
         self::_fixCloseButton($links);
     }
 
+    protected static function _fixTypes(&$links)
+    {
+        foreach ($links as $k => $link) {
+            if (isset(static::$_aliases[$link['type']])) {
+                $links[$k]['type'] = static::$_aliases[$link['type']];
+            }
+        }
+    }
+
     protected static function _fixTooltips(&$links)
     {
         foreach ($links as $k => $link) {
index a5f7e769764c4e936d436e35c5f5d9c09543fa89..721733a64ff585ec84ce084659af966d76ffc392 100644 (file)
@@ -88,7 +88,7 @@ class Base extends Form
             ['type' => \Fluidbook\Tools\Links\Link::STATSTAG, 'label' => __('Tag statistique'), 'color' => '#dddddd', 'class' => StatsTag::class],
             ['type' => \Fluidbook\Tools\Links\Link::PHONE, 'label' => __('Téléphone'), 'color' => '#333333', 'class' => Phone::class],
             ['type' => \Fluidbook\Tools\Links\Link::AUDIODESCRIPTION, 'label' => __('Audiodescription'), 'color' => '#00535b', 'class' => Audiodescription::class],
-            ['type' => \Fluidbook\Tools\Links\Link::ANCHOR, 'label' => __('Ancre / Label de page'), 'color' => '#00E6D7', 'class' => Anchor::class, 'aliases' => \Fluidbook\Tools\Links\Link::PAGE_LABEL],
+            ['type' => \Fluidbook\Tools\Links\Link::ANCHOR, 'label' => __('Ancre / Label de page'), 'color' => '#00E6D7', 'class' => Anchor::class],
             ['type' => \Fluidbook\Tools\Links\Link::EVENT_OVERLAY, 'label' => __('Capter les évenements'), 'color' => '#ffcc00', 'class' => EventOverlay::class],
             ['type' => \Fluidbook\Tools\Links\Link::ARTICLE, 'label' => __('Article (définition)'), 'color' => '#ACC152', 'class' => Article::class],
             ['type' => \Fluidbook\Tools\Links\Link::LIKE, 'label' => __('Like'), 'color' => '#4267B2', 'class' => Like::class],