From: Vincent Vanwaelscappel Date: Tue, 14 Nov 2023 18:14:29 +0000 (+0100) Subject: wait #6421 @1 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=03a8610be687fcbeb9a9304e0a8b83863eded7ac;p=fluidbook-toolbox.git wait #6421 @1 --- diff --git a/app/Fields/FluidbookLinkEditor/ShowLinkMode.php b/app/Fields/FluidbookLinkEditor/ShowLinkMode.php index 910b4733b..10d157031 100644 --- a/app/Fields/FluidbookLinkEditor/ShowLinkMode.php +++ b/app/Fields/FluidbookLinkEditor/ShowLinkMode.php @@ -19,6 +19,7 @@ class ShowLinkMode extends SelectFromArray 'toggle' => __('Basculer (Afficher si masqué, masquer si affiché)'), 'exclusiveshow' => __('Afficher et masquer tous les autres'), 'showhide' => __('Afficher les liens (+) et masquer les liens (-)'), + 'toggleshowhide' => __('Basculer les liens (+ et - sont inversés)'), 'shownext' => __('Afficher le lien suivant dans la série'), 'shownextcycle' => __('Afficher le lien suivant dans la série') . ' (' . __('cycle') . ')', 'showprev' => __('Afficher le lien précédent dans la série'), diff --git a/app/Fluidbook/Compiler/Links.php b/app/Fluidbook/Compiler/Links.php index abbd89fb1..9cae18cb9 100644 --- a/app/Fluidbook/Compiler/Links.php +++ b/app/Fluidbook/Compiler/Links.php @@ -128,6 +128,7 @@ trait Links $pagesOfCustomLinks = []; $hiddenLinks = []; + $showHiddenLinks = []; $anchorExists = []; $closedLinks = []; @@ -244,10 +245,15 @@ trait Links } if ($linkData['type'] == Link::SHOWLINK && $linkData['target'] !== 'hide') { - $ids = explode(',', $linkData['to']); + $ids = explode(',', str_replace(' ', '', $linkData['to'])); $close = ($linkData['close_button'] && $linkData['close_button'] !== 'none'); foreach ($ids as $id) { + $show = (str_starts_with($id, '-')); $id = trim($id, '+- '); + if ($show) { + $showHiddenLinks[] = $id; + $showHiddenLinks[] = 'i_' . $id; + } if ($id === 'tabs') { $this->config->tabsHiddenAtStartup = true; } else { @@ -262,6 +268,7 @@ trait Links } } + if ($this->fluidbookSettings->anchorsAliases && file_exists($this->fluidbookSettings->anchorsAliases)) { $aliases = []; for ($i = 0; $i <= 2; $i++) { @@ -322,6 +329,7 @@ trait Links } $linkData['hidden'] = in_array($linkData['uid'], $hiddenLinks); + $linkData['showHidden'] = $linkData['hidden'] && in_array($linkData['uid'], $showHiddenLinks); if (isset($linkData['zindex']) && $linkData['zindex'] < 50 && in_array($linkData['uid'], $closedLinks)) { $linkData['zindex'] = 50; }