]> _ Git - cubeextranet.git/commitdiff
wip #5054 @1
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Mon, 14 Mar 2022 17:36:44 +0000 (17:36 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Mon, 14 Mar 2022 17:36:44 +0000 (17:36 +0000)
inc/ws/Controlleur/class.ws.url.php
inc/ws/DAO/class.ws.dao.book.php
inc/ws/Util/html5/master/class.ws.html5.compiler.php
inc/ws/Util/html5/master/class.ws.html5.links.php
inc/ws/Util/packager/class.ws.packager.html.php

index 384e9a001eacc9ac4b6573493441741337502882..f25addac917f3ef373b3397cfd8743d0d64384cc 100644 (file)
@@ -684,9 +684,10 @@ class wsUrl
 
                 $h = SITE_PATH;
                 if ($_SERVER['HTTP_HOST'] == 'exe.workshop.fluidbook.com') {
-                    $h = 'https://workshop.fluidbook.com' . SITE_PATH;
+                    $h = 'https://workshop.fluidbook.com/';
                 }
-                $res .= '<li data-type="' . $infos['type'] . '"><a class="extfb" target="_blank" href="' . $h . $infos['version'] . '/' . $infos['pattern'] . '/' . $infos['file'] . '">' . $infos['icon'] . $infos['title'] . '</a><a data-ok-content="' . __('URL copiée') . '" data-tippy-content="' . __("Copier l'URL dans le presse-papier") . '" class="clipboardurl" href="' . $h . $infos['version'] . '/' . $infos['pattern'] . '/' . $infos['file'] . '"><img src="/images/ws/link.svg"></a></li>';
+                $url = $h . $infos['version'] . '/' . $infos['pattern'] . '/' . $infos['file'];
+                $res .= '<li data-type="' . $infos['type'] . '"><a class="extfb" target="_blank" href="' . $url . '">' . $infos['icon'] . $infos['title'] . '</a><a data-ok-content="' . __('URL copiée') . '" data-tippy-content="' . __("Copier l'URL dans le presse-papier") . '" class="clipboardurl" href="' . $url . '"><img src="/images/ws/link.svg"></a></li>';
             }
         }
         $res .= '</ul></div>';
index df444ed9ad4701246a7163f023b7135ab4471587..dd8b242aa3dd47c2f54b9f1f993088399429bcbc 100644 (file)
@@ -1163,8 +1163,8 @@ class wsDAOBook extends commonDAO
         if (!file_exists($source)) {
             return;
         }
-        copy($source, $dest);
-        touch($dest, filemtime($source));
+        @copy($source, $dest);
+        @touch($dest, filemtime($source));
     }
 
     public static function getDocumentPage($book_id, $book_page)
index 3d8ba64caefec0abecae888146225fd826484a37..da22b71f9df838d5d73072c36adf1399599c5db0 100644 (file)
@@ -985,7 +985,8 @@ class wsHTML5Compiler
         $this->log('Js written');
         $this->vdir->sync($delete, $this);
         $this->log('Files Synced');
-        touch(rtrim(str_replace('/html5/', '/compiletime/', $this->dir)));
+//        $f=rtrim(str_replace('/html5/', '/compiletime/', $this->dir));
+//        touch($f);
     }
 
     protected function writeStats()
@@ -1719,8 +1720,8 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
 
     protected function writeScorm()
     {
-        $manifestfiles=['1.2'=>'_imsmanifest.12.xml','2004'=>'_imsmanifest.2004.xml','2004.3'=>'_imsmanifest.2004-3.xml'];
-        $manifestfile=$manifestfiles[$this->book->parametres->scorm_version];
+        $manifestfiles = ['1.2' => '_imsmanifest.12.xml', '2004' => '_imsmanifest.2004.xml', '2004.3' => '_imsmanifest.2004-3.xml'];
+        $manifestfile = $manifestfiles[$this->book->parametres->scorm_version];
 
         $manifest = file_get_contents($this->assets . '/' . $manifestfile);
         if (!$this->book->parametres->scorm_title) {
@@ -3498,7 +3499,9 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
             }
         }
 
-        $this->config->articlesList = $list;
+        if (isset($list)) {
+            $this->config->articlesList = $list;
+        }
 
     }
 
index 1044de7c84f1693116b9f73a1ed780dd398cc582..137cae33a420ff0e64ca101c930be8b677c145ac 100644 (file)
@@ -3105,7 +3105,7 @@ class slideshowLink extends normalLink
             $image_path_relative = $this->compiler->vdir->relativePath($slide['path']);
             $image_info = CubeIT_Image::getimagesize($slide['path']);
             $image_info_json = ($image_info) ? json_encode(['width' => $image_info[0], 'height' => $image_info[1], 'ratio' => round($image_info[0] / $image_info[1], 4)]) : '';
-            $image_dimensions = ($image_info) ? $image_info[3] : '';
+            $image_dimensions = ($image_info && isset($image_info[3])) ? $image_info[3] : '';
 
             // When displaying thumbnails, they are a fixed size, based on height
             // We set dimensions here to avoid extra work on the client side
index 0bc22c174923a1f2023079e58fc38f0d5fd0184b..b49b725394618be193eeda270b8da1d42bef10e8 100644 (file)
@@ -128,8 +128,12 @@ class wsPackagerHTML extends wsPackager
             'keywords' => $keywords,
         );
 
-        $this->origHTML = $this->book->parametres->htmlPrepend . file_get_contents($this->vdir . '/index.html');
-        unlink($this->vdir . '/index.html');
+        $this->origHTML = $this->book->parametres->htmlPrepend;
+        $h = $this->vdir . '/index.html';
+        if (file_exists($h)) {
+            $this->origHTML .= file_get_contents($h);
+            unlink($h);
+        }
         $this->origHTML = $this->replaceHTML($toReplace);
 
         $nav1 = $this->makeHTMLNav(true);