]> _ Git - fluidbook-toolbox.git/commitdiff
wip #6998 @1
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 2 Sep 2024 17:47:55 +0000 (19:47 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 2 Sep 2024 17:47:55 +0000 (19:47 +0200)
app/Fluidbook/Compiler/Compiler.php
app/Fluidbook/Link/Link.php
app/Models/FluidbookDocument.php

index 2b972b8b2ca632f825318d4a4792828402cd42d4..b9f1ae3d53c51190032acd602219d2676146c172 100644 (file)
@@ -798,6 +798,10 @@ class Compiler extends Base implements CompilerInterface, IVirtualDirectoryError
 
     protected function _extranetToToolboxPath($path)
     {
+        if (str_starts_with($path, '/data1/extranet/www/fluidbook/books/working/')) {
+            return str_replace('/data1/extranet/www/fluidbook/books/working', '/application/protected/fluidbookpublication/working/', $path);
+        }
+
         if (str_starts_with($path, '/application/fluidbook/books/working/')) {
             return str_replace('/application/fluidbook/books/working/', '/application/protected/fluidbookpublication/working/', $path);
         }
@@ -1275,7 +1279,7 @@ class Compiler extends Base implements CompilerInterface, IVirtualDirectoryError
             return;
         }
         if (!isset($this->config->filesInfos)) {
-            $this->config->filesInfos = [];
+            $this->config->set('filesInfos', []);
         }
         $infos = array('filesize' => filesize($file));
         $dim = Image::getimagesize($file);
@@ -1283,7 +1287,7 @@ class Compiler extends Base implements CompilerInterface, IVirtualDirectoryError
             $infos['width'] = $dim[0];
             $infos['height'] = $dim[1];
         }
-        $this->config->filesInfos[$key] = $infos;
+        $this->config->set('filesInfos.' . $key, $infos);
     }
 
     protected function __($str)
@@ -1482,7 +1486,7 @@ class Compiler extends Base implements CompilerInterface, IVirtualDirectoryError
         foreach ($p as $range => $coins) {
             $pages = ArrayUtil::parseRange($range);
             foreach ($pages as $page) {
-                $this->config->gamifyCoins['visit_page_' . $page] = $coins;
+                $this->config->set('gamifyCoins.visit_page_' . $page, $coins);
             }
         }
 
index af8420800706a32ea1b860526df9430238600479..cbdc0b76492979f08dc32a41aff4ed47d10e9958 100644 (file)
@@ -35,6 +35,9 @@ class Link extends \Fluidbook\Tools\Links\Link
     {
         $init = ArrayUtil::asArray($init);
 
+        if (!isset($init['to'])) {
+            $init['to'] = '';
+        }
         $init['scorm'] = self::isScorm($init);
         $init['to'] = static::replaceCustomURL($init['to']);
         if ($init['to'] === '-') {
index ab19ef60b3acbc998fe6442115ad46f58e7c17ee..a45a6d66b2361c76e14ca8f344d84d8557836e6e 100644 (file)
@@ -434,7 +434,7 @@ class FluidbookDocument extends ToolboxModel
     protected static function _getTextFilePrefix($textExtraction)
     {
         $map = ['poppler' => 'p', 'fluidbook' => 'f', 'pdfbox' => ''];
-        return $map[$textExtraction];
+        return $map[$textExtraction ?: 'fluidbook'];
     }
 
     public function _getHightlightFilePath($page, $mode = 'standard', $ignoreSeparators = '')