]> _ Git - fluidbook_tools.git/commitdiff
wip #7950 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 28 Jan 2026 16:43:01 +0000 (17:43 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 28 Jan 2026 16:43:01 +0000 (17:43 +0100)
src/Compiler/Compiler.php
src/Compiler/CompilerInterface.php
src/Compiler/DummyCompiler.php
src/Links/Link.php
src/Links/SearchWordLink.php [new file with mode: 0644]

index e02bba0d19e72c7ea04df4ba237b5b8aba162b72..7c89c95c6e4abfc4008426844d90d41b9caa523c 100644 (file)
@@ -428,4 +428,9 @@ class Compiler implements ShouldQueue, ShouldBeUnique, CompilerInterface {
     {
        return $url;
     }
+
+    public function addSearchWord($to, $page, $array)
+    {
+        // TODO: Implement addSearchWord() method.
+    }
 }
index ef129ff3244bbde83b5091984d7efdfa61b500a5..8aac38a6ddae15e34c0a95c0e091d16f43691ec9 100644 (file)
@@ -86,4 +86,6 @@ interface CompilerInterface
     public function getLinkAlternativeText($link);
 
     public function shortenURL($url);
+
+    public function addSearchWord($to,$page, $array);
 }
index 41d5f5c412cd807ab5b605a454e30b417d11b3c4..5e48271b9da11b5b94d53ce60f3d879f781d6f44 100644 (file)
@@ -216,4 +216,9 @@ class DummyCompiler implements CompilerInterface
     {
         return $url;
     }
+
+    public function addSearchWord($to, $page, $array)
+    {
+        // TODO: Implement addSearchWord() method.
+    }
 }
index 94f5bd4a55128cdcc522b8e41a33bdfe4aa2e92d..4b336ca6dddf9ebdb592916fa5aac6c490a7f3c1 100644 (file)
@@ -77,6 +77,7 @@ class Link
     const LAYER_MASK = 50;
     const PDF_FORM = 51;
     const ALT_TEXT_IMAGE = 52;
+    const SEARCH_WORD = 53;
 
     protected static string|false|null $_linksKey = null;
     public $left;
@@ -151,6 +152,7 @@ class Link
     public $name = '';
     public $alt = '';
     public $pdfjs = '';
+    public $alternative;
 
 
     protected $_ocr = false;
@@ -387,6 +389,8 @@ class Link
                 break;
             case static::ALT_TEXT_IMAGE:
                 return new AltTextImageLink($id, $init, $compiler);
+            case static::SEARCH_WORD:
+                $compiler->addSearchWord($init['to'], $init['page'], ['x' => $init['left'], 'y' => $init['top'], 'width' => $init['width'], 'height' => $init['height']]);
             default:
                 return null;
         }
diff --git a/src/Links/SearchWordLink.php b/src/Links/SearchWordLink.php
new file mode 100644 (file)
index 0000000..34dfdb7
--- /dev/null
@@ -0,0 +1,20 @@
+<?php
+
+namespace Fluidbook\Tools\Links;
+
+use Cubist\Util\Text;
+
+class SearchWordLink extends Link {
+    protected $role = '';
+
+    public $defaultZIndex = 0;
+
+    protected function _getHTMLContainer() {
+        return '';
+    }
+
+    public function getHTMLContent() {
+        return '';
+    }
+
+}