From 7de63ed78131b0ca0ad6be36b40169165cf4a09f Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Mon, 14 Mar 2022 17:36:44 +0000 Subject: [PATCH] wip #5054 @1 --- inc/ws/Controlleur/class.ws.url.php | 5 +++-- inc/ws/DAO/class.ws.dao.book.php | 4 ++-- inc/ws/Util/html5/master/class.ws.html5.compiler.php | 11 +++++++---- inc/ws/Util/html5/master/class.ws.html5.links.php | 2 +- inc/ws/Util/packager/class.ws.packager.html.php | 8 ++++++-- 5 files changed, 19 insertions(+), 11 deletions(-) diff --git a/inc/ws/Controlleur/class.ws.url.php b/inc/ws/Controlleur/class.ws.url.php index 384e9a001..f25addac9 100644 --- a/inc/ws/Controlleur/class.ws.url.php +++ b/inc/ws/Controlleur/class.ws.url.php @@ -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 .= '
  • ' . $infos['icon'] . $infos['title'] . '
  • '; + $url = $h . $infos['version'] . '/' . $infos['pattern'] . '/' . $infos['file']; + $res .= '
  • ' . $infos['icon'] . $infos['title'] . '
  • '; } } $res .= ''; diff --git a/inc/ws/DAO/class.ws.dao.book.php b/inc/ws/DAO/class.ws.dao.book.php index df444ed9a..dd8b242aa 100644 --- a/inc/ws/DAO/class.ws.dao.book.php +++ b/inc/ws/DAO/class.ws.dao.book.php @@ -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) 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 3d8ba64ca..da22b71f9 100644 --- a/inc/ws/Util/html5/master/class.ws.html5.compiler.php +++ b/inc/ws/Util/html5/master/class.ws.html5.compiler.php @@ -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"> 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"> } } - $this->config->articlesList = $list; + if (isset($list)) { + $this->config->articlesList = $list; + } } 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 1044de7c8..137cae33a 100644 --- a/inc/ws/Util/html5/master/class.ws.html5.links.php +++ b/inc/ws/Util/html5/master/class.ws.html5.links.php @@ -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 diff --git a/inc/ws/Util/packager/class.ws.packager.html.php b/inc/ws/Util/packager/class.ws.packager.html.php index 0bc22c174..b49b72539 100644 --- a/inc/ws/Util/packager/class.ws.packager.html.php +++ b/inc/ws/Util/packager/class.ws.packager.html.php @@ -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); -- 2.39.5