From: Vincent Vanwaelscappel Date: Mon, 2 Sep 2024 17:47:55 +0000 (+0200) Subject: wip #6998 @1 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=129cd1acd2f4ec7c6804ba7ef4256885d4f9bbe7;p=fluidbook-toolbox.git wip #6998 @1 --- diff --git a/app/Fluidbook/Compiler/Compiler.php b/app/Fluidbook/Compiler/Compiler.php index 2b972b8b2..b9f1ae3d5 100644 --- a/app/Fluidbook/Compiler/Compiler.php +++ b/app/Fluidbook/Compiler/Compiler.php @@ -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); } } diff --git a/app/Fluidbook/Link/Link.php b/app/Fluidbook/Link/Link.php index af8420800..cbdc0b764 100644 --- a/app/Fluidbook/Link/Link.php +++ b/app/Fluidbook/Link/Link.php @@ -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'] === '-') { diff --git a/app/Models/FluidbookDocument.php b/app/Models/FluidbookDocument.php index ab19ef60b..a45a6d66b 100644 --- a/app/Models/FluidbookDocument.php +++ b/app/Models/FluidbookDocument.php @@ -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 = '')