]> _ Git - fluidbook_tools.git/commitdiff
wip #7913 @3:00
authorsoufiane <soufiane@cubedesigners.com>
Thu, 19 Feb 2026 16:06:42 +0000 (17:06 +0100)
committersoufiane <soufiane@cubedesigners.com>
Thu, 19 Feb 2026 16:06:42 +0000 (17:06 +0100)
src/Links/AltTextImageLink.php

index 13b3166896e523d3ef0048c9d95f55721d2260f6..b0948060c5f71503b7b17921216f44ef53d823c0 100644 (file)
@@ -2,12 +2,27 @@
 
 namespace Fluidbook\Tools\Links;
 
-class AltTextImageLink extends NormalLink {
+class AltTextImageLink extends Link {
     protected $role = '';
 
-    public function getHTMLContent()
+    public function getAdditionnalContent() : string {
+        $res = parent::getAdditionnalContent();
+        $res .= ' data-text="' . htmlspecialchars($this->to, ENT_QUOTES) . '" ';
+        return $res;
+    }
+
+    public function getInnerContent() : string {
+        $class = $this->getClasses();
+        $attrs = '';
+        if (count($class)) {
+            $attrs .= ' class="' . implode(' ', $class) . '"';
+        }
+        $attrs .= $this->getTooltipAttribute($this->to);
+        return '<a href="#" data-type="' . $this->type . '"' . $attrs . $this->getAdditionnalContent() . '></a>';
+    }
+
+    public function getHTMLContent() : string
     {
-        $attrs = $this->getTooltipAttribute($this->to);
-        return '<div id="ok" '.$attrs.'>'.$this->to.'</div>';
+        return '<div class="image"></div>'.$this->getInnerContent();
     }
 }