]> _ Git - fluidbook_tools.git/commitdiff
#7459
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 15 Apr 2025 15:32:34 +0000 (17:32 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 15 Apr 2025 15:32:34 +0000 (17:32 +0200)
src/Links/Link.php

index 70fda3943a37cbb4571f29fdf51d474c19084e50..0a4773a16356ef0fad328c84ea90dd3c3598b577 100644 (file)
@@ -135,6 +135,7 @@ class Link
     public $cursor = '';
     public $blinkdelay = 0;
     public $stats = [];
+    public $visibility_os = 'all';
     protected $role = 'button';
 
 
@@ -223,7 +224,7 @@ class Link
                 $init['inline'] = self::normalizeInlineIntegration($init['inline'] ?? '');
                 if ($init['inline'] === 'popup') {
                     return new Object3DPopupLink($id, $init, $compiler);
-                }else{
+                } else {
                     return new Object3DLink($id, $init, $compiler);
                 }
             case static::ACTION:
@@ -342,7 +343,7 @@ class Link
             case static::COPY_TO_CLIPBOARD:
                 return new CopyToClipboardLink($id, $init, $compiler);
             case static::PAGE_BACKGROUND_COLOR:
-                $compiler->addPageBackground($init['page'], $init['to'] ?? '', $init['extra'] ?? '',$init['alternative']??'');
+                $compiler->addPageBackground($init['page'], $init['to'] ?? '', $init['extra'] ?? '', $init['alternative'] ?? '');
                 break;
             default:
                 return null;
@@ -541,6 +542,11 @@ class Link
             $this->$k = $v;
         }
 
+        if (!$this->visibility_os) {
+            $this->visibility_os = 'all';
+        }
+
+
         if ($this->target == '') {
             $this->target = '_blank';
         }
@@ -657,6 +663,9 @@ class Link
         if ($this->relatedAnimation) {
             $addContent .= ' data-related-animation="' . $this->relatedAnimation . '"';
         }
+        if ($this->visibility_os !== 'all') {
+            $addContent .= ' data-visibility-os="' . $this->visibility_os . '"';
+        }
 
         $attached = $this->attached ? ' data-attached="' . $this->attached . '" ' : '';
         return '<div class="' . $this->getHTMLContainerClass() . '" style="mix-blend-mode:' . $this->blendmode . ';' . $this->inlineStyles . '" data-blendmode="' . $this->blendmode . '" ' . $attached . ' data-hidden="' . $this->hidden . '" data-scorm="' . $this->scorm . '" data-id="' . $this->uid . '" id="l_' . $this->id . '"' . $addContent . '>' . $this->getHTMLContent() . '</div>';