]> _ Git - cubeextranet.git/commitdiff
wait #4375 @1
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Mon, 29 Mar 2021 17:14:26 +0000 (17:14 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Mon, 29 Mar 2021 17:14:26 +0000 (17:14 +0000)
inc/ws/Util/html5/master/class.ws.html5.compiler.php
inc/ws/Util/html5/master/class.ws.html5.links.php

index 67c2d49772c5772ef6c0f805f3bfed0cd9928ccf..23e4fb411ee48d157a05091fc124b29b371c86a6 100644 (file)
@@ -1561,15 +1561,20 @@ class wsHTML5Compiler
     {
         global $core;
 
-        if ($this->book->parametres->customLinkClass == 'WescoSalesLink') {
-            $this->specialJsFiles[] = 'js/libs/interact.min.js';
-            $this->specialJsFiles[] = 'js/libs/fluidbook/special/wescosales.js';
-            $this->specialCSS[] = 'wescosales';
-        }
-
-        if ($this->book->parametres->customLinkClass == 'AtlanticDownloadLink') {
-            $this->specialJsFiles[] = 'js/libs/fluidbook/special/atlanticdownload.js';
-            $this->specialCSS[] = 'atlanticdownload';
+        switch ($this->book->parametres->customLinkClass) {
+            case 'WescoSalesLink':
+                $this->specialJsFiles[] = 'js/libs/interact.min.js';
+                $this->specialJsFiles[] = 'js/libs/fluidbook/special/wescosales.js';
+                $this->specialCSS[] = 'wescosales';
+                break;
+            case 'AtlanticDownloadLink':
+                $this->specialJsFiles[] = 'js/libs/fluidbook/special/atlanticdownload.js';
+                $this->specialCSS[] = 'atlanticdownload';
+                break;
+            case 'MiraklEaster2021':
+                $this->specialJsFiles[] = 'js/libs/fluidbook/special/mirakleaster2021.js';
+                $this->specialCSS[] = 'mirakleaster2021';
+                break;
         }
 
         $this->config->links = array();
@@ -2034,7 +2039,7 @@ class wsHTML5Compiler
 
     public function writeTexts()
     {
-        $cache = sha1($this->book->parametres->highlightResults . '/--/' . $this->book->parametres->searchWordSelectionAlgorithm . '///' . $this->book->parametres->textExtraction . '|--|' . $this->book->parametres->ignoreSearchSeparators . '|||' . max($this->book->composition_update, filemtime(WS_TOOLS . '/fwstk/out/artifacts/fwstk_jar/fwstk.jar')));
+        $cache = sha1($this->book->parametres->highlightResults . '/--/' . $this->book->parametres->searchWordSelectionAlgorithm . '///' . $this->book->parametres->textExtraction . '|--|' . $this->book->parametres->ignoreSearchSeparators . '|||' . $this->book->composition_update . '()()()' . filemtime(WS_TOOLS . '/fwstk/out/artifacts/fwstk_jar/fwstk.jar'));
         $cacheDir = WS_BOOKS . '/index/' . $this->book_id . '/' . $cache . '/';
         if (!file_exists($cacheDir)) {
             mkdir($cacheDir, 0777, true);
index 93a02c80dbf5b150057425331886d8f1262e4f53..b042cd6083601b432835895c414344f9462aa97d 100644 (file)
@@ -112,6 +112,8 @@ class wsHTML5Link
                         return new wescoSalesLink($id, $init, $compiler);
                     case 'AtlanticDownloadLink':
                         return new atlanticDownloadLink($id, $init, $compiler);
+                    case 'MiraklEaster2021':
+                        return new miraklEaster2021Link($id, $init, $compiler);
                     default :
                         return customLink::getCustomInstance($id, $init, $compiler);
                 }
@@ -1089,7 +1091,7 @@ class videoBackgroundLink extends videoLink
 class videoLink extends wsHTML5Link
 {
     public $defaultZIndex = 50;
-    public $backgroundColor='#000000';
+    public $backgroundColor = '#000000';
 
 
     public static function addVideoJS($compiler)
@@ -1104,8 +1106,8 @@ class videoLink extends wsHTML5Link
 
     public function getCSS()
     {
-        $res= parent::getCSS();
-        $res.='background-color:'.$this->backgroundColor.';';
+        $res = parent::getCSS();
+        $res .= 'background-color:' . $this->backgroundColor . ';';
         return $res;
     }
 
@@ -1130,7 +1132,7 @@ class videoLink extends wsHTML5Link
         static::addVideoJS($compiler);
 
         $attributes = static::getVideoAttributes($linkDatas, $w, $h, $compiler);
-        $linkDatas->backgroundColor=$attributes['backgroundcolor'];
+        $linkDatas->backgroundColor = $attributes['backgroundcolor'];
 
         $res = '<div class="videoContainer integration-' . $linkDatas->inline . '"';
         foreach ($attributes as $name => $value) {
@@ -2105,6 +2107,19 @@ class atlanticDownloadLink extends normalLink
     }
 }
 
+class miraklEaster2021Link extends normalLink
+{
+    public function getURL()
+    {
+        return '#';
+    }
+
+    public function getAdditionnalContent()
+    {
+        return parent::getAdditionnalContent() . ' data-answers="' . $this->to . '" ';
+    }
+}
+
 class inpesPopinLink extends htmlMultimediaLink
 {
 
@@ -2689,7 +2704,7 @@ class iframeLink extends wsHTML5Link
      */
     public static function _handleFile($link)
     {
-        $to=preg_replace('/^data\/links\//','',$link->to);
+        $to = preg_replace('/^data\/links\//', '', $link->to);
         if (!CubeIT_Util_Url::isDistant($to)) {
             $e = explode('.', $to);
             $ext = array_pop($e);