From 78b69c114dd9a65208e622568b1cfeb6ad9b5230 Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Mon, 29 Mar 2021 17:14:26 +0000 Subject: [PATCH] wait #4375 @1 --- .../html5/master/class.ws.html5.compiler.php | 25 +++++++++++-------- .../html5/master/class.ws.html5.links.php | 25 +++++++++++++++---- 2 files changed, 35 insertions(+), 15 deletions(-) diff --git a/inc/ws/Util/html5/master/class.ws.html5.compiler.php b/inc/ws/Util/html5/master/class.ws.html5.compiler.php index 67c2d4977..23e4fb411 100644 --- a/inc/ws/Util/html5/master/class.ws.html5.compiler.php +++ b/inc/ws/Util/html5/master/class.ws.html5.compiler.php @@ -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); diff --git a/inc/ws/Util/html5/master/class.ws.html5.links.php b/inc/ws/Util/html5/master/class.ws.html5.links.php index 93a02c80d..b042cd608 100644 --- a/inc/ws/Util/html5/master/class.ws.html5.links.php +++ b/inc/ws/Util/html5/master/class.ws.html5.links.php @@ -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 = '
$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); -- 2.39.5