From 9dc31cd1916809bbeef887659fb0e194b219edcd Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Tue, 2 Oct 2018 12:20:14 +0000 Subject: [PATCH] #2251 --- inc/ws/Controlleur/class.ws.flash.php | 4 +++- .../html5/master/class.ws.html5.compiler.php | 21 +++++++++++++++++-- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/inc/ws/Controlleur/class.ws.flash.php b/inc/ws/Controlleur/class.ws.flash.php index 973e5d5a8..a78c6cda2 100644 --- a/inc/ws/Controlleur/class.ws.flash.php +++ b/inc/ws/Controlleur/class.ws.flash.php @@ -753,8 +753,10 @@ class wsFlash extends cubeFlashGateway $nb_pages = count($pages); $this->xml->addChild('pages', $nb_pages); $total_size = 0; + foreach ($pages as $page => $info) { - $file = WS_DOCS . '/' . $info['document_id'] . '/p' . $info['document_page'] . '.swf'; + $docdir = wsDocument::getDir($info['document_id']); + $file = $docdir . '/p' . $info['document_page'] . '.swf'; $total_size += filesize($file); } $average_size = $total_size / $nb_pages; 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 2c06ad7af..1a3d94229 100644 --- a/inc/ws/Util/html5/master/class.ws.html5.compiler.php +++ b/inc/ws/Util/html5/master/class.ws.html5.compiler.php @@ -1009,6 +1009,7 @@ class wsHTML5Compiler ]; } + $pagesOfCustomLinks = []; foreach ($links as $linkData) { if (isset($linkData['image']) && $linkData['image'] && $linkData['type'] != 28) { @@ -1018,8 +1019,19 @@ class wsHTML5Compiler $dupData['type'] = 15; array_push($links, $dupData); } + if ($linkData['type'] == 7) { + $k = $linkData['to']; + if (!isset($pagesOfCustomLinks[$k])) { + $pagesOfCustomLinks[$k] = []; + } + if (!in_array($linkData['page'], $pagesOfCustomLinks[$k])) { + $pagesOfCustomLinks[$k][] = $linkData['page']; + } + } } + $this->config->pagesOfCustomLinks = $pagesOfCustomLinks; + $i = 0; $pages = array(); $cpages = array(); @@ -1154,7 +1166,8 @@ class wsHTML5Compiler if (!$reminimize) { foreach ($files as $file) { - if (filemtime($this->assets . '/' . $file) > $mintime) { + $f = $this->assets . '/' . $file; + if (file_exists($f) && filemtime($f) > $mintime) { $reminimize = true; break; } @@ -1170,7 +1183,11 @@ class wsHTML5Compiler if ($reminimize) { $js = ''; foreach ($files as $file) { - $js .= file_get_contents($this->assets . '/' . $file); + $f = $this->assets . '/' . $file; + if (!file_exists($f)) { + continue; + } + $js .= file_get_contents($f); $js .= ";\n\n"; } $tmp = cubeFiles::tempnam(); -- 2.39.5