]> _ Git - fluidbook_tools.git/commitdiff
wip #6475 @0.25
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 17 Nov 2023 07:25:02 +0000 (08:25 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 17 Nov 2023 07:25:02 +0000 (08:25 +0100)
src/Compiler/Compiler.php
src/Compiler/CompilerInterface.php
src/Compiler/DummyCompiler.php
src/Links/Link.php

index d83f540f3e8f8e801a09e345c245069774746f0d..b71640719d99a0ab6443ad8853635a40b9c24408 100644 (file)
@@ -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.
+    }
 }
index 7a3f2ba098fff98781d3ba1f9747eda33c8f30ac..6f13d20a8bce655b4ab5bc6321d2827bb62acfbc 100644 (file)
@@ -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 = []);
 }
index 935a73fdd2fe5aeb4f8c0b34e68719c94fa00ab9..712ccaf4a861dfa30d6295e25b60b2db9158e565 100644 (file)
@@ -144,4 +144,9 @@ class DummyCompiler implements CompilerInterface {
     {
         // TODO: Implement pushSetting() method.
     }
+
+    public function addIssue($type, $data = [])
+    {
+        // TODO: Implement addIssue() method.
+    }
 }
index 94f33d071611ffc8af3f576696ee813f7d173912..f23469e6ea552bf97e10c6a396891559c72dc9c1 100644 (file)
@@ -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 '';
     }
 }