]> _ Git - cubeextranet.git/commitdiff
#2251
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 2 Oct 2018 12:20:14 +0000 (12:20 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 2 Oct 2018 12:20:14 +0000 (12:20 +0000)
inc/ws/Controlleur/class.ws.flash.php
inc/ws/Util/html5/master/class.ws.html5.compiler.php

index 973e5d5a809e600892d0953fc366e1ac5cbfeea3..a78c6cda2d4925ee2de043c55edb92168028207f 100644 (file)
@@ -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;
index 2c06ad7af79322f95e01d679565b14ea06c5822c..1a3d942291326361933c01c8a226ad10978fb4fb 100644 (file)
@@ -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();