From: Vincent Vanwaelscappel Date: Thu, 15 Jun 2023 06:51:14 +0000 (+0200) Subject: wait #6035 @0.25 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=a1eda8810622f89fe13acf26e6e8b8f587bdcbbc;p=fluidbook-toolbox.git wait #6035 @0.25 --- diff --git a/app/Fluidbook/Link/LinksData.php b/app/Fluidbook/Link/LinksData.php index f529730ab..813a40aa6 100644 --- a/app/Fluidbook/Link/LinksData.php +++ b/app/Fluidbook/Link/LinksData.php @@ -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) { diff --git a/app/SubForms/Link/Base.php b/app/SubForms/Link/Base.php index a5f7e7697..721733a64 100644 --- a/app/SubForms/Link/Base.php +++ b/app/SubForms/Link/Base.php @@ -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],