From 0edde9ef2a1b8098175cfebe70e62ff928a1f417 Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Wed, 9 Oct 2019 15:13:10 +0000 Subject: [PATCH] wip #3097 @2 --- fluidbook/compile/hybrid/index.html | 19 +++++++++++++ .../Util/packager/class.ws.packager.html.php | 27 ++++++++++++------- 2 files changed, 36 insertions(+), 10 deletions(-) create mode 100644 fluidbook/compile/hybrid/index.html diff --git a/fluidbook/compile/hybrid/index.html b/fluidbook/compile/hybrid/index.html new file mode 100644 index 000000000..a3c19ef75 --- /dev/null +++ b/fluidbook/compile/hybrid/index.html @@ -0,0 +1,19 @@ + + + + + + + + + \ No newline at end of file diff --git a/inc/ws/Util/packager/class.ws.packager.html.php b/inc/ws/Util/packager/class.ws.packager.html.php index 6fa874117..1e68dcdd9 100644 --- a/inc/ws/Util/packager/class.ws.packager.html.php +++ b/inc/ws/Util/packager/class.ws.packager.html.php @@ -248,17 +248,24 @@ class wsPackagerHTML extends wsPackager return; } $dest = $this->vdir . 'm'; - $this->_compileHTML5($this->book_id, $this->book, $dest); - - try { - $mfid = $this->book->parametres->mobilefirstFluidbookId; - if ($mfid != '' && (int)$mfid > 0) { - $mfbook = $this->daoBook->selectById($mfid); - $dest .= '/mf'; - $this->_compileHTML5($mfid, $mfbook, $dest); + + $mfid = $this->book->parametres->mobilefirstFluidbookId; + if ($mfid != '' && (int)$mfid > 0) { + $mfbook = $this->daoBook->selectById($mfid); + $this->_compileHTML5($this->book_id, $this->book, $dest . '/d'); + $this->_compileHTML5($mfid, $mfbook, $dest . '/mf'); + + $hybrid = file_get_contents(WS_COMPILE_ASSETS . '/hybrid/index.html'); + $replace = [ + 'breakpoint' => ((int)$this->book->parametres->mobilefirstBreakpoint - 1) . 'px', + 'bgcolor' => $this->theme->parametres->loadingBackColor + ]; + foreach ($replace as $var => $value) { + $hybrid = str_replace('$' . $var, $value, $hybrid); } - } catch (Exception $e) { - die($e->getMessage()); + file_put_contents($dest . '/index.html', $hybrid); + } else { + $this->_compileHTML5($this->book_id, $this->book, $dest); } fb(time(), 'end prepare html5'); -- 2.39.5