From: vincent@cubedesigners.com Date: Wed, 6 Jul 2022 15:03:44 +0000 (+0000) Subject: wait #5339 @1 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=11f79b20462daf1d991bbb12a706dfb55473e9cb;p=cubeextranet.git wait #5339 @1 --- diff --git a/inc/ws/DAO/class.ws.dao.book.php b/inc/ws/DAO/class.ws.dao.book.php index dd8b242aa..9b2ed2160 100644 --- a/inc/ws/DAO/class.ws.dao.book.php +++ b/inc/ws/DAO/class.ws.dao.book.php @@ -1119,7 +1119,7 @@ class wsDAOBook extends commonDAO } } - public function compile($book_id, $version = 'all', $complete = false, $force = false, $dev = false, $book = null, $delete = true, $forceTheme = false) + public function compile($book_id, $version = 'all', $complete = false, $force = false, $dev = false, $book = null, $delete = true, $forceTheme = false,$hybrid=false) { if (is_null($book_id) || !$book_id) { @@ -1147,7 +1147,7 @@ class wsDAOBook extends commonDAO $res = ''; try { $this->compilePDF($book, $pages); - $res .= $this->compileHTML5($book_id, $book, $dev, $delete, $forceTheme); + $res .= $this->compileHTML5($book_id, $book, $dev, $delete, $forceTheme,$hybrid); $this->touchCompile($book_id, 'html5'); } catch (Exception $e) { @@ -1184,14 +1184,14 @@ class wsDAOBook extends commonDAO return wsBook::getAssetDirOfBook($book_id, $dir) . $path; } - public function compileHTML5($book_id, $book, $dev = false, $delete = true, $forceTheme = false) + public function compileHTML5($book_id, $book, $dev = false, $delete = true, $forceTheme = false,$hybrid=false) { $version = $book->parametres->mobileLVersion; if ($dev) { $version = 'dev'; } - $htmlCompiler = wsHTML5::compilerFactory($book_id, $version, false, 'latest', null, false, false, false, $book, $forceTheme); + $htmlCompiler = wsHTML5::compilerFactory($book_id, $version, false, 'latest', null, false, false, false, $book, $forceTheme,$hybrid); $htmlCompiler->compile($delete); self::$lastHTML5Compiler = $htmlCompiler; diff --git a/inc/ws/Util/html5/class.ws.html5.php b/inc/ws/Util/html5/class.ws.html5.php index 033903fae..b71da0e02 100644 --- a/inc/ws/Util/html5/class.ws.html5.php +++ b/inc/ws/Util/html5/class.ws.html5.php @@ -16,7 +16,7 @@ class wsHTML5 * @param null $book * @return wsHTML5Compiler */ - public static function compilerFactory($book_id, $version = 'stable', $phonegap = false, $phonegapVersion = 'latest', $dir = null, $standalone = false, $appcache = false, $home = false, $book = null, $forceTheme = false) + public static function compilerFactory($book_id, $version = 'stable', $phonegap = false, $phonegapVersion = 'latest', $dir = null, $standalone = false, $appcache = false, $home = false, $book = null, $forceTheme = false, $hybrid = false) { if (is_null($version)) { global $core; @@ -48,7 +48,7 @@ class wsHTML5 } } - return new wsHTML5Compiler($book_id, $version, $phonegap, $phonegapVersion, $dir, $standalone, $appcache, $home, $book, $forceTheme); + return new wsHTML5Compiler($book_id, $version, $phonegap, $phonegapVersion, $dir, $standalone, $appcache, $home, $book, $forceTheme,$hybrid); } public static function getPhonegapVersion($v = 'latest') 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 a7470f5cb..7aa78be1b 100644 --- a/inc/ws/Util/html5/master/class.ws.html5.compiler.php +++ b/inc/ws/Util/html5/master/class.ws.html5.compiler.php @@ -229,6 +229,7 @@ class wsHTML5Compiler protected $_svgSymbols = []; protected $_addedPDFJS = false; protected $audioDescriptionTextsList = []; + protected $hybrid = false; protected $_docDimensions = []; @@ -239,7 +240,7 @@ class wsHTML5Compiler public $seo = null; - function __construct($book_id, $version = 'stable', $phonegap = false, $phonegapVersion = 'latest', $dir = null, $standalone = false, $appcache = false, $home = false, $book = null, $forceTheme = false) + function __construct($book_id, $version = 'stable', $phonegap = false, $phonegapVersion = 'latest', $dir = null, $standalone = false, $appcache = false, $home = false, $book = null, $forceTheme = false, $hybrid = false) { global $core; @@ -248,6 +249,8 @@ class wsHTML5Compiler $this->multiApp = $this->home = $home; $this->version = $version; + $this->hybrid = $hybrid; + $this->assets = wsHTML5::getSourcesPath($this->version); $this->phonegap = $phonegap; @@ -1783,7 +1786,11 @@ height="0" width="0" style="display:none;visibility:hidden"> function writeSEO() { foreach ($this->seoArticles as $seoArticle) { - $html = file_get_contents($this->assets . '/_seo.html'); + if ($this->hybrid) { + $html = file_get_contents($this->assets . '/_seohybrid.html'); + } else { + $html = file_get_contents($this->assets . '/_seo.html'); + } $a = $seoArticle; unset($a['image']); $a['imageurl'] = 'https://workshop.fluidbook.com/services/facebook_thumbnail?cid=' . $this->book->cid . '&j=' . TIME; diff --git a/inc/ws/Util/packager/class.ws.packager.html.php b/inc/ws/Util/packager/class.ws.packager.html.php index c16425249..42f840532 100644 --- a/inc/ws/Util/packager/class.ws.packager.html.php +++ b/inc/ws/Util/packager/class.ws.packager.html.php @@ -217,9 +217,9 @@ class wsPackagerHTML extends wsPackager $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($this->book_id, $this->book, $dest . '/d', true); $vars = wsDAOBook::$lastHTML5Compiler->getIndexVars(); - $this->_compileHTML5($mfid, $mfbook, $dest . '/mf'); + $this->_compileHTML5($mfid, $mfbook, $dest . '/mf', true); $hybrid = file_get_contents(WS_COMPILE_ASSETS . '/hybrid/index.html'); $replace = [ @@ -242,10 +242,10 @@ class wsPackagerHTML extends wsPackager fb(time(), 'end prepare html5'); } - protected function _compileHTML5($bookId, $book, $dest) + protected function _compileHTML5($bookId, $book, $dest, $hybrid = false) { - $this->daoBook->compile($bookId, 'html5', false, $book->parametres->forceCompileOnDownload, false, $book); + $this->daoBook->compile($bookId, 'html5', false, $book->parametres->forceCompileOnDownload, false, $book, true, false, $hybrid); if (!file_exists($dest)) { mkdir($dest, 0777, true);