From: vincent@cubedesigners.com Date: Fri, 21 Aug 2020 14:27:36 +0000 (+0000) Subject: wip #3785 @2 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=1916e83ef55ff4d64c424bfd4bc6f083ee58f455;p=cubeextranet.git wip #3785 @2 --- 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 26c83c1b2..4a902a009 100644 --- a/inc/ws/Util/html5/master/class.ws.html5.compiler.php +++ b/inc/ws/Util/html5/master/class.ws.html5.compiler.php @@ -1393,16 +1393,18 @@ class wsHTML5Compiler foreach ($linksCopy as $k => $linkData) { if ($linkData['type'] == 35 || $linkData['type'] == 15 || $linkData['type'] == 39) { $linkData = wsLinks::decryptLink($linkData); - $animation = contentLink::parseAnimation($linkData['image_rollover']); - if (isset($animation['backgroundColor']) && $animation['backgroundColor'] != 'transparent') { - $dupData = $linkData; - $dupData['type'] = 14; - $dupData['to'] = $animation['backgroundColor']; - $dupData['image_rollover'] = ''; - $dupData['uid'] = 'b_' . $linkData['uid']; - array_push($links, $dupData); - array_push($links, $linkData); - unset($links[$k]); + $animations = contentLink::parseAnimations($linkData['image_rollover']); + foreach ($animations as $animation) { + if (isset($animation['backgroundColor']) && $animation['backgroundColor'] != 'transparent') { + $dupData = $linkData; + $dupData['type'] = 14; + $dupData['to'] = $animation['backgroundColor']; + $dupData['image_rollover'] = ''; + $dupData['uid'] = 'b_' . $linkData['uid']; + array_push($links, $dupData); + array_push($links, $linkData); + unset($links[$k]); + } } } if (isset($linkData['image']) && $linkData['image'] && $linkData['type'] != 28 && $linkData['type'] != 35) { 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 7b213b3ca..5724591e1 100644 --- a/inc/ws/Util/html5/master/class.ws.html5.links.php +++ b/inc/ws/Util/html5/master/class.ws.html5.links.php @@ -230,22 +230,28 @@ class wsHTML5Link return $res; } - public static function parseAnimation($animation) + public static function parseAnimations($animations) { - $extras = self::parseExtras($animation); - if (count($extras) > 0) { - if (!isset($extras['direction'])) { - $extras['direction'] = 'right'; - } - if ($extras['direction'] === 'top') { - $extras['direction'] = 'up'; - } - if ($extras['direction'] === 'bottom') { - $extras['direction'] = 'down'; + $anims = explode('---', $animations); + $res = []; + + foreach ($anims as $animation) { + $animation = trim($animation); + $extras = self::parseExtras($animation); + if (count($extras) > 0) { + if (!isset($extras['direction'])) { + $extras['direction'] = 'right'; + } + if ($extras['direction'] === 'top') { + $extras['direction'] = 'up'; + } + if ($extras['direction'] === 'bottom') { + $extras['direction'] = 'down'; + } } + $res[] = $extras; } - - return $extras; + return $res; } public static function replaceCustomURL($url) @@ -773,15 +779,13 @@ class contentLink extends wsHTML5Link public function getAdditionnalContent() { $res = parent::getAdditionnalContent(); - $variables = self::parseAnimation($this->image_rollover); - - if (!isset($variables['type']) || !$variables['type']) { - $variables['type'] = 'none'; - } - if (isset($variables['zindex'])) { - $this->zindex = $variables['zindex']; + $animations = self::parseAnimations($this->image_rollover); + foreach ($animations as $animation) { + if (isset($animation['zindex'])) { + $this->zindex = $animation['zindex']; + } } - $res .= ' data-animation-type="' . $variables['type'] . '" data-animation="' . htmlspecialchars(json_encode($variables), ENT_QUOTES) . '" '; + $res .= ' data-animations="' . htmlspecialchars(json_encode($animations), ENT_QUOTES) . '" '; return $res; }