]> _ Git - cubeextranet.git/commitdiff
wait #5339 @1
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Wed, 6 Jul 2022 15:03:44 +0000 (15:03 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Wed, 6 Jul 2022 15:03:44 +0000 (15:03 +0000)
inc/ws/DAO/class.ws.dao.book.php
inc/ws/Util/html5/class.ws.html5.php
inc/ws/Util/html5/master/class.ws.html5.compiler.php
inc/ws/Util/packager/class.ws.packager.html.php

index dd8b242aa3dd47c2f54b9f1f993088399429bcbc..9b2ed2160cc2ce1e38fe5d58a358073ebd8e4321 100644 (file)
@@ -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;
index 033903fae50905eae19f7338bcba7a5453dbab87..b71da0e0240152eef7e492ce7f78a00b54ebf560 100644 (file)
@@ -16,7 +16,7 @@ class wsHTML5
      * @param null $book\r
      * @return wsHTML5Compiler\r
      */\r
-    public static function compilerFactory($book_id, $version = 'stable', $phonegap = false, $phonegapVersion = 'latest', $dir = null, $standalone = false, $appcache = false, $home = false, $book = null, $forceTheme = false)\r
+    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)\r
     {\r
         if (is_null($version)) {\r
             global $core;\r
@@ -48,7 +48,7 @@ class wsHTML5
             }\r
         }\r
 \r
-        return new wsHTML5Compiler($book_id, $version, $phonegap, $phonegapVersion, $dir, $standalone, $appcache, $home, $book, $forceTheme);\r
+        return new wsHTML5Compiler($book_id, $version, $phonegap, $phonegapVersion, $dir, $standalone, $appcache, $home, $book, $forceTheme,$hybrid);\r
     }\r
 \r
     public static function getPhonegapVersion($v = 'latest')\r
index a7470f5cbdfd4098df3d2e4cdc476d9118140d94..7aa78be1b1e6d8816ab4d6e0a09a653512166c9d 100644 (file)
@@ -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"></iframe></noscript>
     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;
index c1642524968899e46cda3e019dc7e902bc563fc9..42f8405328c61baa731d9964f593758acd5760f8 100644 (file)
@@ -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);