]> _ Git - fluidbook_tools.git/commitdiff
wip #7894 @1
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 15 Jan 2026 16:03:49 +0000 (17:03 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 15 Jan 2026 16:03:49 +0000 (17:03 +0100)
src/Compiler/Compiler.php
src/Links/FileLink.php
src/Links/FlipcardLink.php
src/Links/HTMLMultimediaImage.php
src/Links/HTMLMultimediaPopupImage.php
src/Links/ImageLink.php
src/Links/Link.php

index 6ab10adeec2931fb027a67a82748f6f5db0c5df8..edc887be6886e2758f1a871c528a32cced01b2a8 100644 (file)
@@ -418,4 +418,9 @@ class Compiler implements ShouldQueue, ShouldBeUnique, CompilerInterface {
     {
         // TODO: Implement addMask() method.
     }
+
+    public function getLinkAlternativeText($link)
+    {
+        // TODO: Implement getLinkAlternativeText() method.
+    }
 }
index d113af632341627212b01f03ee49b94e14c996ed..9d595f516f8746a7f71263f7714ca895003b6e7e 100644 (file)
@@ -8,6 +8,7 @@ class FileLink extends NormalLink
 {
     protected $role = 'link';
     protected $pdfpage = 1;
+    public $_ocr = ['to'];
 
     public function getURL()
     {
index 8956735d986fe5c30ee5c824e6a818db7e68351b..4dd4717516946fb7d51614edf570a3fff252485f 100644 (file)
@@ -7,6 +7,7 @@ class FlipcardLink extends ImageLink
     public $interactive = true;
     public $defaultZIndex = 70;
     public $forceTexture = true;
+    public $_ocr = ['to', 'alternative'];
 
     public function getHTMLContent()
     {
index 411b79f73b25330f75e8f7b4abea0290c61c60a1..a3ff75e1b25f97a2c4c01a5c2d22fff8a4557500 100644 (file)
@@ -6,6 +6,8 @@ class HTMLMultimediaImage extends Link
 {
     public $defaultZIndex = 50;
 
+    protected $_ocr= ['to'];
+
     public function getHTMLContainerClass()
     {
         return parent::getHTMLContainerClass() . ' multimedia notinteractive';
index d82e9f67b9aede09768e0fdf8396f6a6e5f31578..29d9e524457ad9d47cde255774c0ccd4c8e8a47f 100644 (file)
@@ -8,6 +8,7 @@ use Cubist\Util\Graphics\Resizer;
 class HTMLMultimediaPopupImage extends NormalLink
 {
     public $clickToClose = 0;
+    protected $_ocr = ["to"];
 
     public function getURL()
     {
index 9a96708c0dc6f646b68c731e851a6e0a820483a2..de4670c6bcd5159a8edaadd983fa0f178f104be1 100644 (file)
@@ -4,7 +4,7 @@ namespace Fluidbook\Tools\Links;
 
 class ImageLink extends ContentLink
 {
-
+    public $_ocr = ['to'];
     public function getImageUrl()
     {
         return Link::getUniversalLocation($this->to, false);
index 4c9dab471768f195b5763ddc3a28bd607d1335c9..9e7ee092fe22747ed68945a556956ba2038814b8 100644 (file)
@@ -149,6 +149,9 @@ class Link
     public $alt = '';
 
 
+    protected $_ocr = false;
+
+
     /** @var float */
     public $delay = 0;
     /**
@@ -1196,6 +1199,21 @@ class Link
         return $this->animation_type == '1' || $this->display_area === 'default' ? $this->compiler->getSetting('linksDisplayArea', 'fill') : $this->display_area;
     }
 
+    /**
+     * @return array|false
+     */
+    public function getOCR()
+    {
+        if (!$this->_ocr) {
+            return false;
+        }
+        if (is_array($this->_ocr)) {
+            return $this->_ocr;
+        } else {
+            return [$this->_ocr];
+        }
+    }
+
     public function getAlternativeText()
     {
         return $this->alt ?: $this->compiler->getLinkAlternativeText($this);