]> _ Git - fluidbook-toolbox.git/commitdiff
wait #5932 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 15 May 2023 16:52:02 +0000 (18:52 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 15 May 2023 16:52:02 +0000 (18:52 +0200)
app/Fluidbook/Compiler/Links.php
app/Fluidbook/Link/LinksData.php
app/Http/Controllers/Admin/Operations/FluidbookPublication/LinksOperation.php

index bca5aeb994135c142afa387f54e9025c22c81524..e1f539efe2a920cee77864961a5a6cadc64eec15 100644 (file)
@@ -64,7 +64,7 @@ trait Links
         if ($this->fluidbookSettings->basketManager === 'Puma') {
             foreach ($links as $k => $init) {
                 if ($init['type'] == Link::CART && isset($this->config->product_zoom_references[$init['to']]) && count($this->config->product_zoom_references[$init['to']]) > 0 && implode('', $this->config->product_zoom_references[$init['to']]) != '') {
-                    $init['infobulle'] = 'Digital information';
+                    $init['tooltip'] = 'Digital information';
                     $init['animation'] = 'reflet-anim.html';
                     $links[$k] = $init;
                 }
@@ -349,7 +349,7 @@ trait Links
             // Make old "aftersearch" link compatible with new "extra" menu option by extracting link URL
             if ($link->page == 'aftersearch') {
                 $this->config->afterSearchLink = $link->to;
-                $this->config->afterSearchTooltip = $link->infobulle;
+                $this->config->afterSearchTooltip = $link->tooltip;
             }
 
             if (strpos($link->page, 'link_') === 0) {
index 515848847d17263725b2acabfc4c87882f9c7ddc..dfb1e96dba0355f02011f23d4a152139fcf482c9 100644 (file)
@@ -33,7 +33,7 @@ class LinksData
             'uid' => __('Identifiant unique'),
             'page' => __('Page de la publication'), 'left' => __('x'), 'top' => __('y'), 'width' => __('Largeur'), 'height' => __('Hauteur'), 'rot' => __('Rotation'),
             'type' => __('Type'), 'to' => __('Destination'), 'target' => __('Cible'),
-            'infobulle' => __('Infobulle'), 'numerotation' => __('Numérotation'),
+            'tooltip' => __('Infobulle'), 'numerotation' => __('Numérotation'),
             'display_area' => __('Activer la surbrillance'),
             'video_loop' => __('Video : boucle'), 'video_auto_start' => __('Video : démarrage automatique'), 'video_controls' => __('Vidéo : afficher les contrôles'), 'video_sound_on' => __('Vidéo : activer le son'),
             'inline' => __('Vidéo : afficher dans la page'), 'video_width' => __('Vidéo : Largeur du popup'), 'video_height' => __('Vidéo : Hauteur du popup'),
@@ -248,11 +248,23 @@ class LinksData
 
     protected static function _fixLinks(&$links)
     {
+        self::_fixTooltips($links);
         self::_correctImageSpecialLinks($links);
         self::_fixWebVideoServices($links);
         self::_fixMultimedia($links);
     }
 
+    protected static function _fixTooltips(&$links)
+    {
+        foreach ($links as $k => $link) {
+            if (isset($link['infobulle'])) {
+                $links[$k]['tooltip'] = $link['infobulle'];
+                unset($links[$k]['infobulle']);
+            }
+        }
+    }
+
+
     protected static function _correctImageSpecialLinks(&$links)
     {
         foreach ($links as $k => $link) {
@@ -338,8 +350,8 @@ class LinksData
                 if ($link['display_area'] == '' || !$link['display_area']) {
                     $link['display_area'] = '0';
                 }
-                if (trim($link['infobulle']) == '') {
-                    $link['infobulle'] = '';
+                if (trim($link['tooltip']) == '') {
+                    $link['tooltip'] = '';
                 }
                 $links[] = $link;
             }
@@ -407,7 +419,7 @@ class LinksData
                 'page' => $page,
                 'left' => $left, 'top' => $top, 'width' => $width, 'height' => $height, 'rot' => '',
                 'type' => $type, 'to' => $to, 'target' => $target,
-                'infobulle' => '', 'numerotation' => $numerotation, 'display_area' => '1');
+                'tooltip' => '', 'numerotation' => $numerotation, 'display_area' => '1');
         }
 
         self::_fixLinks($links);
@@ -419,6 +431,7 @@ class LinksData
         $fluidbook = FluidbookPublication::find($book_id);
 
         $lr = self::mergeLinksAndRulers($links, $rulers, $specialLinks, $specialRulers);
+
         $meta = ['links' => count($lr['links']), 'rulers' => count($lr['rulers']), 'comments' => $comments, 'user' => $user_id, 'version' => 3, 'onepage' => $fluidbook->isOnePage()];
         $base = self::getLinksDir($book_id) . '/' . time();
         $latestLinks = self::getLinksDir($book_id) . '/latest.links3.gz';
@@ -530,7 +543,7 @@ class LinksData
                 }
 
                 $link = [];
-                $cols = array('page' => '', 'left' => '', 'top' => '', 'width' => '', 'height' => '', 'type' => '', 'to' => '', 'target' => '_blank', 'video_loop' => true, 'video_auto_start' => true, 'video_controls' => true, 'video_sound_on' => true, 'infobulle' => '', 'numerotation' => 'physical', "inline" => true, 'pdfjs' => 'normal');
+                $cols = array('page' => '', 'left' => '', 'top' => '', 'width' => '', 'height' => '', 'type' => '', 'to' => '', 'target' => '_blank', 'video_loop' => true, 'video_auto_start' => true, 'video_controls' => true, 'video_sound_on' => true, 'tooltip' => '', 'numerotation' => 'physical', "inline" => true, 'pdfjs' => 'normal');
                 $k = 0;
                 foreach ($cols as $col => $default) {
                     if (isset($line[$k])) {
@@ -548,7 +561,7 @@ class LinksData
                 }
 
                 if ($link['type'] == 18) {
-                    $link['infobulle'] = $link['to'];
+                    $link['tooltip'] = $link['to'];
                     $link['to'] = '';
                 }
 
index f496b80ed4f7ef210881279758c3030d6a93631f..c5fd751b754038f9b655de0bda16ef2a3a9da28d 100644 (file)
@@ -63,8 +63,6 @@ trait LinksOperation
         );
 
         $fb = FluidbookPublication::find($fluidbook_id);
-        //Compiler::compile($fb);
-
         return response()->json(['assets' => $fb->getLinksAssetsDimensions(), 'versions' => LinksData::getLinksVersions($fluidbook_id)]);
     }