]> _ Git - fluidbook_tools.git/commitdiff
wait #8079 @2
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 20 Mar 2026 13:00:11 +0000 (14:00 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 20 Mar 2026 13:00:11 +0000 (14:00 +0100)
29 files changed:
src/Links/ActionLink.php
src/Links/AltTextImageLink.php
src/Links/AudioPopupLink.php
src/Links/CartLink.php
src/Links/ColorLink.php
src/Links/ContentLink.php
src/Links/CopyToClipboardLink.php
src/Links/DownloadPortionLink.php
src/Links/FlipcardLink.php
src/Links/HTMLMultimediaImage.php
src/Links/HTMLMultimediaPopupImage.php
src/Links/HTMLMultimediaPopupLink.php
src/Links/IFramePopupLink.php
src/Links/ImageLink.php
src/Links/InternalLink.php
src/Links/LayerLink.php
src/Links/Link.php
src/Links/NormalLink.php
src/Links/Object3DPopupLink.php
src/Links/ShowLinkLink.php
src/Links/SlideshowLink.php
src/Links/TextPopupLink.php
src/Links/TooltipLink.php
src/Links/TriggerLink.php
src/Links/VideoLink.php
src/Links/VideoPopupLink.php
src/Links/WebVideoPopupLink.php
src/Links/ZoomHDLink.php
src/Links/ZoomLink.php

index 71c54f025ee4b5b498fec9668646c69e3d0fa0a7..aaf1953ca54e3a731682bb0a2b967f9a4cce74d1 100644 (file)
@@ -20,9 +20,9 @@ class ActionLink extends InternalLink
         }
     }
 
-    public function getAdditionnalContent()
+    public function getAdditionnalContent($content=false)
     {
-        $res = parent::getAdditionnalContent();
+        $res = parent::getAdditionnalContent($content);
         if (is_object($this->extra) || is_array($this->extra)) {
             $extra = json_encode($this->extra);
         } else {
index e5509ddfe9978e86982ce9df726306733bdc0fbf..2a3a4e71060593c9e2d6881e70a9d55e4ab5d1f4 100644 (file)
@@ -5,8 +5,8 @@ namespace Fluidbook\Tools\Links;
 class AltTextImageLink extends Link {
     protected $role = '';
 
-    public function getAdditionnalContent() : string {
-        $res = parent::getAdditionnalContent();
+    public function getAdditionnalContent($content = false) : string {
+        $res = parent::getAdditionnalContent($content);
 
         $res .= ' data-text="' . htmlspecialchars($this->to, ENT_QUOTES) . '" ';
         $res .= ' data-icon-x="' . $this->icon_x . '" data-icon-y="' . $this->icon_y . '"';
@@ -28,6 +28,6 @@ class AltTextImageLink extends Link {
             $attrs .= ' class="' . implode(' ', $class) . '"';
         }
 
-        return '<a href="#" data-type="' . $this->type . '"' . $attrs . $this->getAdditionnalContent() . '>' . $this->getInnerContent() . '</a>';
+        return '<a href="#" data-type="' . $this->type . '"' . $attrs . $this->getAdditionnalContent(true) . '>' . $this->getInnerContent() . '</a>';
     }
 }
index 1f4c218bd2378f06820a472b2ef3a924a0904d08..fa389da6b2ae0d7ae53a5872f304e280c41058b6 100644 (file)
@@ -16,7 +16,7 @@ class AudioPopupLink extends NormalLink
         return '#/audio/' . $basename;
     }
 
-    public function getAdditionnalContent()
+    public function getAdditionnalContent($content=false)
     {
         return ' data-audio="' . rawurlencode(AudioLink::makeAudioTag($this, null, null, $this->compiler, $this->compiler->getSetting('audioPlayerThemePopup', 'native'))) . '" ';
     }
index 378ab51c3eb8b06367c209ba7d36f00d36dcb236..a1d8c823bf104237b14497778b503cec2d85497f 100644 (file)
@@ -18,9 +18,9 @@ class CartLink extends NormalLink
         return 'add to cart';
     }
 
-    public function getAdditionnalContent()
+    public function getAdditionnalContent($content = false)
     {
-        $res = parent::getAdditionnalContent();
+        $res = parent::getAdditionnalContent($content);
         $e = explode("|", $this->to);
         $ref = $e[0];
         $qty = isset($e[1]) ? $e[1] : '1';
index 0b9bec93b188dbf58ba9626a398d0c91e7a28ba9..2cc7b3762d19259be95a5b0e7ccbc5c157308472 100644 (file)
@@ -25,9 +25,9 @@ class ColorLink extends ContentLink
         return $res;
     }
 
-    public function getAdditionnalContent()
+    public function getAdditionnalContent($content=false)
     {
-        $res = parent::getAdditionnalContent();
+        $res = parent::getAdditionnalContent($content);
         $res .= ' data-color="' . Color::colorToCSS($this->to) . '"';
         return $res;
     }
index 0f1be6bb47c104a14f94d7d75ff19baabd145208..747abf1fd01c8de28c94263bbc3afd609eb9d4ae 100644 (file)
@@ -21,9 +21,9 @@ class ContentLink extends Link
         return $res;
     }
 
-    public function getAdditionnalContent()
+    public function getAdditionnalContent($content = false)
     {
-        $res = parent::getAdditionnalContent();
+        $res = parent::getAdditionnalContent($content);
         if ($this->rollover === 'fadein') {
             $res .= ' data-rollover-hide ';
         }
index 5db6acffefa58f66c5b1bddf6e112cfa1f119ca2..8318391f07eb0843798c1adf2b40d63907ca6045 100644 (file)
@@ -14,13 +14,15 @@ class CopyToClipboardLink extends NormalLink
         return 'copy to clipboard';
     }
 
-    public function getAdditionnalContent() {
-        $res = parent::getAdditionnalContent();
+    public function getAdditionnalContent($content = false)
+    {
+        $res = parent::getAdditionnalContent($content);
         $res .= ' data-clipboard-text="' . htmlspecialchars($this->to, ENT_QUOTES) . '" ';
         return $res;
     }
 
-    public function getURL() {
+    public function getURL()
+    {
         return '#';
     }
 }
index 40678a44d8fb9b875e5cc6aceeb5745638469b1f..dd7025253ba849b48ca8d8ec4e74d6a7d04e7638 100644 (file)
@@ -2,11 +2,13 @@
 
 namespace Fluidbook\Tools\Links;
 
-class DownloadPortionLink extends FileLink {
+class DownloadPortionLink extends FileLink
+{
     /**
      * @throws \Exception
      */
-    public function getURL() {
+    public function getURL()
+    {
         $attributes = $this->getZoomAttributes();
         if (!$this->rightClone) {
             ZoomLink::generateImage($attributes, $this->compiler, 'downloadportion', 'downloadportion', true);
@@ -14,7 +16,8 @@ class DownloadPortionLink extends FileLink {
         return 'data/links/downloadportion_' . $attributes['id'] . '.jpg';
     }
 
-    public function getZoomAttributes() {
+    public function getZoomAttributes()
+    {
         $pdf = $this->compiler->getSetting('downloadPortionPDF', '');
         if ($pdf !== '') {
             $pdf = $this->compiler->getWorkingDir() . '/' . $pdf;
@@ -73,7 +76,8 @@ class DownloadPortionLink extends FileLink {
         return $res;
     }
 
-    public function getAdditionnalContent() {
+    public function getAdditionnalContent($content = false)
+    {
         $file = $this->to;
         if (!$file) {
             $file = 'p' . $this->page;
@@ -83,10 +87,11 @@ class DownloadPortionLink extends FileLink {
         }
         $file = htmlspecialchars($file);
 
-        return parent::getAdditionnalContent() . ' download="' . $file . '" ';
+        return parent::getAdditionnalContent($content) . ' download="' . $file . '" ';
     }
 
-    public function getDefaultTooltip() {
+    public function getDefaultTooltip()
+    {
         return 'click to download the image';
     }
 }
index de4bd7c7f86fa88066b45af828005320c81cfa8e..eac6f7d1d33f4ed854f6315a85901a04c417989e 100644 (file)
@@ -28,9 +28,9 @@ class FlipcardLink extends ImageLink
         return 'click to flip';
     }
 
-    public function getAdditionnalContent()
+    public function getAdditionnalContent($content = false)
     {
-        $res = parent::getAdditionnalContent();
+        $res = parent::getAdditionnalContent($content);
         $res .= ' data-flipcard="' . ($this->width > $this->height ? 'axis-x' : 'axis-y') . '" ';
         return $res;
     }
index 46d2d4916b1dd1a95c430d85b09cdc205c64e2fb..25fca4ec34ec4706678a3331670bbcea6167f9ef 100644 (file)
@@ -6,7 +6,7 @@ class HTMLMultimediaImage extends Link
 {
     public $defaultZIndex = 50;
 
-    protected $_ocr= ['to'];
+    protected $_ocr = ['to'];
 
     public function getHTMLContainerClass()
     {
@@ -19,15 +19,15 @@ class HTMLMultimediaImage extends Link
         $h = $this->height;
         $this->copyExternalFile($this->to);
         $res = '<img class="multimediaimage" data-scroll="' . $this->scroll . '" data-width="' . $w . '" data-height="' . $h . '" src="' . $this->shortenURL(Link::getUniversalLocation($this->to)) . '" width="' . $w . '" height="' . $h . '" aria-hidden="1" />';
-        $alt=$this->getAlternativeText();
-        if($alt) {
+        $alt = $this->getAlternativeText();
+        if ($alt) {
             $res .= '<div class="visually-hidden" aria-live="polite">' . $alt . '</div>';
         }
         return $res;
     }
 
-    public function getAdditionnalContent()
+    public function getAdditionnalContent($content = false)
     {
-        return parent::getAdditionnalContent() . ' aria-hidden="true" data-scroll="' . $this->scroll . '" ';
+        return parent::getAdditionnalContent($content) . ' aria-hidden="true" data-scroll="' . $this->scroll . '" ';
     }
 }
index 4ec0ba00243aa783056623c11b40a45e9ed23963..32ade45f76b98d16d91d70adfcee04625a3bb4bc 100644 (file)
@@ -23,9 +23,9 @@ class HTMLMultimediaPopupImage extends NormalLink
     /**
      * @throws \Exception
      */
-    public function getAdditionnalContent()
+    public function getAdditionnalContent($content = false)
     {
-        $res = parent::getAdditionnalContent();
+        $res = parent::getAdditionnalContent($content);
         $path = $this->compiler->working_path($this->to);
         try {
             $dim = Image::getimagesize($path);
index 97b1e63d4dcf9b7f388dc82a3ca155a352d4f9b0..720a7abe183edeef1960d675a96669d016373059 100644 (file)
@@ -5,7 +5,7 @@ namespace Fluidbook\Tools\Links;
 class HTMLMultimediaPopupLink extends HTMLMultimediaPopupImage
 {
 
-    public function getAdditionnalContent()
+    public function getAdditionnalContent($content = false)
     {
         $i = $this->_init;
         $i['inline'] = 'inline';
index 69750be251fd43a30c6e3b31cb7d209281a12240..1634e1bc0e48b9dc4797e2ea0ad8500e316aa3be 100644 (file)
@@ -14,9 +14,9 @@ class IFramePopupLink extends NormalLink
         return ' data-track="' . $this->to . '"';
     }
 
-    public function getAdditionnalContent()
+    public function getAdditionnalContent($content = false)
     {
-        $res = parent::getAdditionnalContent();
+        $res = parent::getAdditionnalContent($content);
         $markup = '<div class="iframeContainer" data-type="' . $this->iframeType . '">';
         $markup .= '<iframe src="' . $this->shortenURL(IFrameLink::_handleFile($this)) . '" width="100%" height="100%" frameborder="0" marginwidth="0" marginheight="0" scrolling="auto" allowfullscreen mozallowfullscreen="true" webkitallowfullscreen="true" onmousewheel=""></iframe>';
         $markup .= '</div>';
index 8a824482382c8e88044f18f30eca0a116a12fab8..06c00208b618c105597e8647d1e585d378b7cf60 100644 (file)
@@ -18,9 +18,9 @@ class ImageLink extends ContentLink
         return $res;
     }
 
-    public function getAdditionnalContent()
+    public function getAdditionnalContent($content = false)
     {
-        $res = parent::getAdditionnalContent();
+        $res = parent::getAdditionnalContent($content);
         $res .= ' data-image="' . $this->getImageUrl() . '"';
         if (isset($this->rollover) && $this->rollover) {
             $res .= ' data-rollover="' . $this->rollover . '"';
index b467dd9e46c62413b330bcde0de2752374dc3256..dbb5c0cb85063bfbff187422753d9ab2c36be3a2 100644 (file)
@@ -5,6 +5,8 @@ namespace Fluidbook\Tools\Links;
 class InternalLink extends NormalLink
 {
 
+    protected $role='button';
+
     public function getURL()
     {
         return '#/page/' . $this->getPage();
@@ -31,11 +33,6 @@ class InternalLink extends NormalLink
         return $res;
     }
 
-    public function getAdditionnalContent()
-    {
-        return parent::getAdditionnalContent() . ' role="button"';
-    }
-
     public function getDefaultTooltip()
     {
         return 'go to page';
index cbc284fd46e48298ecb6ce5835b0e2075d7f2a5e..76e28df68091904edf800b38f67de497eb8198eb 100644 (file)
@@ -37,9 +37,9 @@ class LayerLink extends ImageLink
         }
     }
 
-    public function getAdditionnalContent()
+    public function getAdditionnalContent($content = false)
     {
-        $res = parent::getAdditionnalContent();
+        $res = parent::getAdditionnalContent($content);
         $res .= ' data-layer="' . $this->to . '"';
         return $res;
     }
index ded1f5a8f4d360649821cd55f2271c6af91c758e..781646622642ca57e8efab11beec167085cb388a 100644 (file)
@@ -764,10 +764,10 @@ class Link
         return '';
     }
 
-    public function getAdditionnalContent()
+    public function getAdditionnalContent($content = false)
     {
         $res = '';
-        if ($this->role !== '') {
+        if ($content && $this->role !== '') {
             $res .= ' role="' . $this->role . '"';
         }
         if ($this->maxWidth > 0) {
index 3c6567da92a032994f866f5bb2217c97d43ba738..43332ce39e11556e6e77fb76ec07b1df03167cd2 100644 (file)
@@ -30,7 +30,7 @@ class NormalLink extends Link
             $attrs .= ' data-blinkdelay="' . intval($this->blinkdelay) . '"';
         }
 
-        return '<a href="' . $this->getURL() . '" data-type="' . $this->type . '" target="' . $this->getTarget() . '"' . $attrs . $this->getAdditionnalContent() . $this->getTrack() . '>' . $this->getInnerContent() . '</a>';
+        return '<a href="' . $this->getURL() . '" data-type="' . $this->type . '" target="' . $this->getTarget() . '"' . $attrs . $this->getAdditionnalContent(true) . $this->getTrack() . '>' . $this->getInnerContent() . '</a>';
     }
 
 
index f333b895eba32b3a23a08cdb15c32eb14afe2f61..424b4be6e3f36609463f5dd21a3545b484008f1f 100644 (file)
@@ -16,7 +16,7 @@ class Object3DPopupLink extends NormalLink
         return '#/o3d/' . md5($this->to . '/' . $this->extra . '/' . $this->id . '/' . $this->background_color);
     }
 
-    public function getAdditionnalContent()
+    public function getAdditionnalContent($content=false)
     {
         return ' data-stats-type="popup_o3d" data-stats-name="' . $this->to . '" data-model="' . $this->to . '" data-background-color="' . $this->background_color . '" ';
     }
index 7a5e46fdaabb910a8fa74f7aeed8324a6bef46ee..795af625b009ef4c82cf8b9dc268e7cc598e7b87 100644 (file)
@@ -22,9 +22,9 @@ class ShowLinkLink extends NormalLink
         return $res;
     }
 
-    public function getAdditionnalContent()
+    public function getAdditionnalContent($content=false)
     {
-        $res = parent::getAdditionnalContent();
+        $res = parent::getAdditionnalContent($content);
         $this->close_button = $this->close_button ?: 'none';
         $res .= ' data-showmode="' . $this->target . '" data-showclose="' . $this->close_button . '" data-showtransition="' . ($this->transition ?: 'fadein') . '" data-showid="' . $this->to . '"';
         return $res;
index c15ffa2089faf36763d71a89b83484a7526d7095..c977ec6b85484adda933118831a6baf261d743d9 100644 (file)
@@ -36,9 +36,9 @@ class SlideshowLink extends NormalLink
         return '#/slideshow/' . $this->uid;
     }
 
-    public function getAdditionnalContent()
+    public function getAdditionnalContent($content = false)
     {
-        return parent::getAdditionnalContent() . ' data-slideshow="' . rawurlencode($this->generateSlideshow('popup')) . '" ';
+        return parent::getAdditionnalContent($content) . ' data-slideshow="' . rawurlencode($this->generateSlideshow('popup')) . '" ';
     }
 
     public function getDefaultTooltip()
index df6e594316367ad5a44d5d48f9ca154d4fea25c3..30d3c14b2f3dbb315f0488e748c3718f1c89ead8 100644 (file)
@@ -2,18 +2,22 @@
 
 namespace Fluidbook\Tools\Links;
 
-class TextPopupLink extends NormalLink {
-    public function getClasses() {
+class TextPopupLink extends NormalLink
+{
+    public function getClasses()
+    {
         return array_merge(array('lazy', 'textpopup'), parent::getClasses());
     }
 
-    public function getAdditionnalContent() {
-        $res = parent::getAdditionnalContent();
+    public function getAdditionnalContent($content = false)
+    {
+        $res = parent::getAdditionnalContent($content);
         $res .= ' data-text="' . htmlspecialchars($this->to, ENT_QUOTES) . '" ';
         return $res;
     }
 
-    public function getURL() {
+    public function getURL()
+    {
         return '#';
     }
 }
index 9641cef5e248a8bbb9eecd18523650b9e450ed63..310e9753cbdf1eb4917027444e3b557e23f65981 100644 (file)
@@ -13,9 +13,9 @@ class TooltipLink extends NormalLink
         return array_merge(array('lazy'), parent::getClasses());
     }
 
-    public function getAdditionnalContent()
+    public function getAdditionnalContent($content = false)
     {
-        $res = parent::getAdditionnalContent();
+        $res = parent::getAdditionnalContent($content);
         if ($this->backgroundColor) {
             $res .= 'data-tooltip-background="' . $this->backgroundColor . '" ';
         }
@@ -25,7 +25,7 @@ class TooltipLink extends NormalLink
         if ($this->tooltipMaxWidth) {
             $res .= ' data-tooltip-maxwidth="' . $this->tooltipMaxWidth . '" ';
         } else {
-            $res .= ' data-tooltip-maxwidth="' . $this->compiler->getSetting('linkTooltipMaxWidth',140) . '" ';
+            $res .= ' data-tooltip-maxwidth="' . $this->compiler->getSetting('linkTooltipMaxWidth', 140) . '" ';
         }
         $res .= ' data-tooltip-touch="1" ';
         return $res;
index d5442cce4c05310a6b89a1ffa3b36e5550cd3815..ee459b408ae807a5c04a69ca2739ee6170c0a6c5 100644 (file)
@@ -17,10 +17,9 @@ class TriggerLink extends NormalLink
         return $res;
     }
 
-    public function getAdditionnalContent()
+    public function getAdditionnalContent($content = false)
     {
-        $res = parent::getAdditionnalContent();
-
+        $res = parent::getAdditionnalContent($content);
         $res .= ' data-trigger-event="' . $this->target . '" data-trigger-id="' . $this->_normalizeId($this->to) . '"';
         return $res;
     }
index 1e6b4d989f934429c7a1fecad00560648eb89762..f51e77a257439628597e9386d09b9af195a0b4ec 100644 (file)
@@ -125,9 +125,9 @@ class VideoLink extends Link
         return $attr;
     }
 
-    public function getAdditionnalContent()
+    public function getAdditionnalContent($content = false)
     {
-        $res = parent::getAdditionnalContent();
+        $res = parent::getAdditionnalContent($content);
         if ($this->video_autohide) {
             $res .= ' data-autohide="' . (($data->video_autohide ?? '1') ? '1' : '0') . '"';
         }
index 43a610a6e9fef187163946df6a5ee81726a60b4a..3bde656dcb53a59abbd5686cb949abab0fe1cf2b 100644 (file)
@@ -28,7 +28,7 @@ class VideoPopupLink extends NormalLink
         return '#/video/' . self::getBasename($this->to);
     }
 
-    public function getAdditionnalContent()
+    public function getAdditionnalContent($content = false)
     {
         $this->video_auto_start = true; // Videos should always autoplay
         $this->video_sound_on = true;
index 9ceddf5e64c16ebf037195620e63cf7503f401e1..f8ac18602cafbccea56e8579cf90be770e5c773c 100644 (file)
@@ -25,7 +25,7 @@ class WebVideoPopupLink extends VideoPopupLink
         }
     }
 
-    public function getAdditionnalContent()
+    public function getAdditionnalContent($content = false)
     {
         $this->video_auto_start = true; // Videos should always autoplay
         return ' data-video="' . rawurlencode(WebVideoLink::makeVideoTag($this, 1280, 720, $this->compiler)) . '" ';
index 860032e0c4242a4e5a3e867820850a20d45f7c19..2a7d16a167dc00ca8cdf1398482fc7177cc0621e 100644 (file)
@@ -16,9 +16,9 @@ class ZoomHDLink extends NormalLink
         return '#/zoomhd/' . $this->uid;
     }
 
-    public function getAdditionnalContent()
+    public function getAdditionnalContent($content = false)
     {
-        $res = parent::getAdditionnalContent();
+        $res = parent::getAdditionnalContent($content);
         $res .= ' data-image="' . $this->to . '" ';
         return $res;
     }
index 83da35680650cdd59c8cfc2ec003d518f115f072..f70b984a7382dfc92cc25d865ee60f91a586a074 100644 (file)
@@ -60,9 +60,9 @@ class ZoomLink extends NormalLink
         return 'zoom in';
     }
 
-    public function getAdditionnalContent()
+    public function getAdditionnalContent($content = false)
     {
-        $res = parent::getAdditionnalContent();
+        $res = parent::getAdditionnalContent($content);
 
         $res .= ' id="' . $this->uid . '"';