]> _ Git - fluidbook-toolbox.git/commitdiff
wait #5761 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 28 Feb 2023 16:40:34 +0000 (17:40 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 28 Feb 2023 16:40:34 +0000 (17:40 +0100)
app/Jobs/FluidbookCompiler.php
app/Models/FluidbookPublication.php

index 6bb9acfef34ad7e6a92756f31d77a0c247053de8..88003237424cbb7dd9c44e9cafe402423d4f44ed 100644 (file)
@@ -2185,6 +2185,7 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
         }
 
         Links::getLinksAndRulers($this->book_id, $links, $rulers);
+        $this->_fluidbook->normalizeLinks($links);
 
         if ($this->fluidbookSettings->basketManager === 'Puma') {
             foreach ($links as $k => $init) {
@@ -2951,7 +2952,7 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
                     , 'data/contents/p' . $page . '.svg');
             }
 
-            $t=$this->getFluidbook()->getThumbFile($page, $this->imageFormat);
+            $t = $this->getFluidbook()->getThumbFile($page, $this->imageFormat);
             $this->vdir->copy($t, 'data/thumbnails/p' . $page . '.' . $this->imageFormat);
             $this->log('Made image page ' . $page);
         }
index d325cfce0d3a5435ba64e4f76037f93dfd8caaaf..68c2b3d33a211c411543b05a693c8d3aa2e18799 100644 (file)
@@ -93,7 +93,7 @@ class FluidbookPublication extends ToolboxSettingsModel
                 'read_only' => true,
                 'type' => User::class,
                 'hidden' => true,
-                'column' => true,
+                'column' => false,
                 'can' => 'fluidbook-publication:admin',
                 'column_attribute' => 'companyWithNameOnTwoLines',
                 'column_move_after' => 'owner',
@@ -569,4 +569,17 @@ class FluidbookPublication extends ToolboxSettingsModel
             }
         }
     }
+
+    public function normalizeLinks(&$links)
+    {
+        if (!$this->isOnePage()) {
+            $w = $this->getPageWidth();
+            foreach ($links as $k => $link) {
+                if ($link['left'] > $w && $link['page'] % 2 == 0) {
+                    $links[$k]['left'] -= $w;
+                    $links[$k]['page']++;
+                }
+            }
+        }
+    }
 }