From: Vincent Vanwaelscappel Date: Fri, 17 Nov 2023 07:25:02 +0000 (+0100) Subject: wip #6475 @0.25 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=ac6a50b6a6440814a5f23e490d2e35eff4216a90;p=fluidbook_tools.git wip #6475 @0.25 --- diff --git a/src/Compiler/Compiler.php b/src/Compiler/Compiler.php index d83f540..b716407 100644 --- a/src/Compiler/Compiler.php +++ b/src/Compiler/Compiler.php @@ -388,4 +388,9 @@ class Compiler implements ShouldQueue, ShouldBeUnique, CompilerInterface { public function getQuality(): int { return 85; } + + public function addIssue($type, $data = []) + { + // TODO: Implement addIssue() method. + } } diff --git a/src/Compiler/CompilerInterface.php b/src/Compiler/CompilerInterface.php index 7a3f2ba..6f13d20 100644 --- a/src/Compiler/CompilerInterface.php +++ b/src/Compiler/CompilerInterface.php @@ -4,7 +4,8 @@ namespace Fluidbook\Tools\Compiler; use Cubist\Util\Files\VirtualDirectory; -interface CompilerInterface { +interface CompilerInterface +{ public function addContentLock($page, $unlockConditions = ''); public function addTriggersLink($page, $link, $delay = 0); @@ -69,4 +70,6 @@ interface CompilerInterface { public function getPageNumber(): int; public function getQuality(): int; + + public function addIssue($type, $data = []); } diff --git a/src/Compiler/DummyCompiler.php b/src/Compiler/DummyCompiler.php index 935a73f..712ccaf 100644 --- a/src/Compiler/DummyCompiler.php +++ b/src/Compiler/DummyCompiler.php @@ -144,4 +144,9 @@ class DummyCompiler implements CompilerInterface { { // TODO: Implement pushSetting() method. } + + public function addIssue($type, $data = []) + { + // TODO: Implement addIssue() method. + } } diff --git a/src/Links/Link.php b/src/Links/Link.php index 94f33d0..f23469e 100644 --- a/src/Links/Link.php +++ b/src/Links/Link.php @@ -151,6 +151,7 @@ class Link * @param stdClass|array $init * @param CompilerInterface $compiler * @return Link + * @throws \Exception */ public static function getInstance($id, $init, &$compiler) { @@ -158,11 +159,11 @@ class Link static::normalizeDimensions($init); - $init['scorm'] = self::isScorm($init); - $init['to'] = self::replaceCustomURL($init['to']); + $init['scorm'] = static::isScorm($init); + $init['to'] = static::replaceCustomURL($init['to']); if ($init['to'] === 'auto:qrcode') { - $init['to'] = self::scanQRCode($init, $compiler); + $init['to'] = static::scanQRCode($init, $compiler); } switch ($init['type']) { @@ -952,6 +953,7 @@ class Link 'y' => round($link['top']), 'border' => 0, 'borderColor' => '', + 'prefixUid' => true, ], $compiler, 'qrcodereader', 'qrcode', false, false); @@ -980,7 +982,7 @@ class Link } } - Log::warning('QRcode not found ' . $link['uid']); + $compiler->addIssue(2, ['page' => $link['page'], 'uid' => $link['uid']]); return ''; } }