From: Vincent Vanwaelscappel Date: Wed, 14 Jan 2026 16:56:21 +0000 (+0100) Subject: wip #7894 @1 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=87006bd32ce4299a18924401eaa6c4b7a6bb26fa;p=fluidbook_tools.git wip #7894 @1 --- diff --git a/src/Compiler/CompilerInterface.php b/src/Compiler/CompilerInterface.php index 3a081f5..60059d1 100644 --- a/src/Compiler/CompilerInterface.php +++ b/src/Compiler/CompilerInterface.php @@ -82,4 +82,6 @@ interface CompilerInterface public function extractPDFArea($file, $page, $rect, $to=null, $options = array(), $cache = null); public function addMask($layer, $page, $area); + + public function getLinkAlternativeText($link); } diff --git a/src/Compiler/DummyCompiler.php b/src/Compiler/DummyCompiler.php index 4e469ac..b43e73c 100644 --- a/src/Compiler/DummyCompiler.php +++ b/src/Compiler/DummyCompiler.php @@ -174,4 +174,9 @@ class DummyCompiler implements CompilerInterface { { // TODO: Implement addMask() method. } + + public function getLinkAlternativeText($link) + { + // TODO: Implement getLinkAlternativeText() method. + } } diff --git a/src/Links/HTMLMultimediaImage.php b/src/Links/HTMLMultimediaImage.php index 4566630..7033578 100644 --- a/src/Links/HTMLMultimediaImage.php +++ b/src/Links/HTMLMultimediaImage.php @@ -16,13 +16,16 @@ class HTMLMultimediaImage extends Link $w = $this->width; $h = $this->height; $this->copyExternalFile($this->to); - $alt = ''; - return $alt; + $res = ''; + $alt=$this->getAlternativeText(); + if($alt) { + $res .= '
' . $alt . '
'; + } + return $res; } public function getAdditionnalContent() { return parent::getAdditionnalContent() . ' aria-hidden="true" data-scroll="' . $this->scroll . '" '; } - } diff --git a/src/Links/Link.php b/src/Links/Link.php index f68b3ed..4c9dab4 100644 --- a/src/Links/Link.php +++ b/src/Links/Link.php @@ -1195,4 +1195,9 @@ class Link { return $this->animation_type == '1' || $this->display_area === 'default' ? $this->compiler->getSetting('linksDisplayArea', 'fill') : $this->display_area; } + + public function getAlternativeText() + { + return $this->alt ?: $this->compiler->getLinkAlternativeText($this); + } }