]> _ Git - fluidbook_tools.git/commitdiff
wip #5940
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 23 May 2023 17:58:08 +0000 (19:58 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 23 May 2023 17:58:08 +0000 (19:58 +0200)
src/Links/Link.php

index 8d224e25155844d7098bcb6841f0d016b14a22e2..c9ff149ed016e10453be8fa6322bc4434cc1846b 100644 (file)
@@ -63,7 +63,7 @@ class Link {
     const LAYER = 39;
     const ANCHOR = 40;
     const FLIPCARD = 41;
-    const PDF=42;
+    const PDF = 42;
 
 
     protected static string|false|null $_linksKey = null;
@@ -123,6 +123,8 @@ class Link {
 
     public $allowsAnimation = true;
 
+    public $attached = false;
+
     protected static $_encryptedTypes = [14, 15, 35, 39];
     protected static $_encryptedAttributes = ['image_rollover'];
 
@@ -264,7 +266,8 @@ class Link {
                 return new DownloadPortionLink($id, $init, $compiler);
             case 38:
                 if ($init['target'] != 'click') {
-                    $extras = self::parseExtras($init['extra']);
+
+                    $extras = isset($init['extra']) ? self::parseExtras($init['extra']) : [];
                     $delay = $extras['delay'] ?? 0;
                     $compiler->addTriggersLink($init['page'], $init['to'], $delay);
                 } else {
@@ -529,7 +532,9 @@ class Link {
 
     protected function _getHTMLContainer() {
         $addContent = $this->getAdditionnalContent();
-        return '<div class="' . $this->getHTMLContainerClass() . '" data-blendmode="' . $this->blendmode . '" data-hidden="' . $this->hidden . '" data-scorm="' . $this->scorm . '" data-id="' . $this->uid . '" id="l_' . $this->id . '"' . $addContent . '>' . $this->getHTMLContent() . '</div>';
+
+        $attached = $this->attached ? ' data-attached="' . $this->attached . '" ' : '';
+        return '<div class="' . $this->getHTMLContainerClass() . '" 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>';
     }
 
     public function getHTMLContainerClass() {