]> _ Git - cubeextranet.git/commitdiff
wip #5250 @0.5
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Wed, 4 May 2022 10:23:27 +0000 (10:23 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Wed, 4 May 2022 10:23:27 +0000 (10:23 +0000)
inc/ws/Util/html5/master/class.ws.html5.compiler.php
inc/ws/Util/html5/master/class.ws.html5.links.php

index 35159e8f808f34d319b129c2df06a08c53bb220e..a260406577ca6c80fd739b8bcb06567fc9f89c12 100644 (file)
@@ -2093,11 +2093,12 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
                 $dupData['interactive'] = false;
                 $dupData['alternative'] = $linkData['animation'];
                 $dupData['type'] = 6;
-                $dupData['uid'] = 'a_' . $linkData['uid'];
+                $linkData['relatedAnimation'] = $dupData['uid'] = 'a_' . $linkData['uid'];
                 $dupData['video_width'] = $dupData['video_height'] = 0;
                 if (wsHTML5Link::isScorm($linkData)) {
                     $dupData['scorm'] = true;
                 }
+                $links[$k] = $linkData;
                 array_push($links, $dupData);
             }
             if ($linkData['type'] == 7) {
index eacba54a800f1da57cbb402fbda2efb4a18fe1e7..ccfb40e9064bc3e557986a03d1a52938b9e2d9ee 100644 (file)
@@ -54,9 +54,10 @@ class wsHTML5Link
     public $parallax = 0;
     public $attachLeft = false;
     public $allowsAnimation = true;
+    public $relatedAnimation = '';
     public $forceTexture = false;
     public $letterspacing = 0;
-    public $backgroundColor=null;
+    public $backgroundColor = null;
 
     protected $role = 'button';
 
@@ -586,6 +587,9 @@ class wsHTML5Link
     public function getHTMLContainer()
     {
         $addContent = $this->getAdditionnalContent();
+        if ($this->relatedAnimation) {
+            $addContent .= ' data-related-animation="' . $this->relatedAnimation . '"';
+        }
         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>';
     }
 
@@ -1147,9 +1151,9 @@ class htmlMultimediaPopupImage extends normalLink
         $res = parent::getAdditionnalContent();
         $dim = CubeIT_Image::getimagesize($this->wdir . '/' . $this->alternative);
 
-        $bg=null===$this->backgroundColor?'':' style="background-color:'.$this->backgroundColor.';"';
+        $bg = null === $this->backgroundColor ? '' : ' style="background-color:' . $this->backgroundColor . ';"';
 
-        $markup = '<div class="multimediaContainer" data-click-to-close="' . $this->clickToClose . '"><img'.$bg.' data-width="' . $dim[0] . '" data-height="' . $dim[1] . '" src="' . wsHTML5Link::getUniversalLocation($this->alternative) . '" width="' . $dim[0] . '" height="' . $dim[1] . '" class="multimedia" /></div>';
+        $markup = '<div class="multimediaContainer" data-click-to-close="' . $this->clickToClose . '"><img' . $bg . ' data-width="' . $dim[0] . '" data-height="' . $dim[1] . '" src="' . wsHTML5Link::getUniversalLocation($this->alternative) . '" width="' . $dim[0] . '" height="' . $dim[1] . '" class="multimedia" /></div>';
         $read = '';
         if ($this->read_mode) {
             $read = ' data-readmode="1"';
@@ -2848,7 +2852,7 @@ class zoomLink extends normalLink
             $p = wsDAOBook::getDocumentPage($compiler->book_id, $attributes['page']);
             $pdfpath = wsDocument::getDir($p['document_id']) . '/pdf/p' . $p['document_page'] . '.pdf';
             $extractPage = 1;
-            if(!file_exists($pdfpath)){
+            if (!file_exists($pdfpath)) {
                 $pdfpath = wsDocument::getDir($p['document_id']) . '/crop.pdf';
                 $extractPage = $p['document_page'];
             }
@@ -2858,7 +2862,6 @@ class zoomLink extends normalLink
         }
 
 
-
         $left = CubeIT_Files::tempnam();
         $leftfile = CubeIT_CommandLine_Poppler::extractArea($pdfpath,
             $extractPage,
@@ -2870,7 +2873,7 @@ class zoomLink extends normalLink
                 $p = wsDAOBook::getDocumentPage($compiler->book_id, $attributes['page'] + 1);
                 $pdfpath = wsDocument::getDir($p['document_id']) . '/pdf/p' . $p['document_page'] . '.pdf';
                 $extractPage = 1;
-                if(!file_exists($pdfpath)){
+                if (!file_exists($pdfpath)) {
                     $pdfpath = wsDocument::getDir($p['document_id']) . '/crop.pdf';
                     $extractPage = $p['document_page'];
                 }