]> _ Git - cubeextranet.git/commitdiff
#1852
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 6 Feb 2018 14:01:52 +0000 (14:01 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 6 Feb 2018 14:01:52 +0000 (14:01 +0000)
inc/ws/Util/html5/landing-page/class.ws.html5.compiler.php
inc/ws/Util/html5/landing-page/class.ws.html5.links.php

index 760ff5cc27c31db099a6214081b24a6dc70e6cd8..a6330d3fb3d713052711bc6e4f76046a8bc10da7 100644 (file)
@@ -807,6 +807,15 @@ class wsHTML5Compiler {
                        $ignore = split(',', $ignore);
                }
 
+               if ($this->book->parametres->externalChaptersHTML != '') {
+                       $d = $this->unzipFile($this->book->parametres->externalChaptersHTML, false, 'data/chapters/');
+                       $meta = $this->getConfigZIP($d['dir']);
+                       $this->config->externalChaptersSize = new stdClass();
+                       $this->config->externalChaptersSize->width = $meta['width'];
+                       $this->config->externalChaptersSize->height = $meta['height'];
+                       $this->vdir->copyDirectory($d['dir'], $d['fdir']);
+               }
+
                $daoDoc = new wsDAODocument($core->con);
                $daoDoc->getLinksAndRulers($this->book_id, $links, $rulers);
 
@@ -1699,4 +1708,25 @@ class wsHTML5Compiler {
         return array('dir' => $dir, 'fdir' => $fdir);
     }
 
+       public function getConfigZIP($d) {
+               $res = array('width' => 0, 'height' => 0);
+               if (file_exists($d . '/index.html')) {
+                       $doc = new DOMDocument();
+                       $doc->loadHTMLFile($d . '/index.html');
+                       $xpath = new DOMXPath($doc);
+                       $c = $xpath->query("//canvas");
+                       foreach ($c as $canvas) {
+                               /* @var $canvas DOMElement */
+                               $res['width'] = intval((string)$canvas->getAttribute('width'));
+                               $res['height'] = intval((string)$canvas->getAttribute('height'));
+                       }
+
+                       $r = array('html' => 'index.html', 'inject' => array(), 'injectcss' => array(), 'injectjs' => array());
+               } else {
+                       $r = array('html' => false, 'inject' => array(file_get_contents($d . '/init.js')), 'injectcss' => array('multimedia.css'), 'injectjs' => array('multimedia.js'));
+               }
+               $res = array_merge($res, $r);
+               return $res;
+       }
+
 }
index 997d37a810ffe7703b38cd7a5a1f31b70a8299c9..db049eed849074acf246a59f74064d300b9d1cde 100644 (file)
@@ -945,24 +945,7 @@ class htmlMultimediaLink extends wsHTML5Link {
        }
 
        public function getConfigZIP($d) {
-               $res = array('width' => $this->video_width, 'height' => $this->video_height);
-               if (file_exists($d . '/index.html')) {
-                       $doc = new DOMDocument();
-                       $doc->loadHTMLFile($d . '/index.html');
-                       $xpath = new DOMXPath($doc);
-                       $c = $xpath->query("//canvas");
-                       foreach ($c as $canvas) {
-                               /* @var $canvas DOMElement */
-                               $res['width'] = intval((string)$canvas->getAttribute('width'));
-                               $res['height'] = intval((string)$canvas->getAttribute('height'));
-                       }
-
-                       $r = array('html' => 'index.html', 'inject' => array(), 'injectcss' => array(), 'injectjs' => array());
-               } else {
-                       $r = array('html' => false, 'inject' => array(file_get_contents($d . '/init.js')), 'injectcss' => array('multimedia.css'), 'injectjs' => array('multimedia.js'));
-               }
-               $res = array_merge($res, $r);
-               return $res;
+               return $this->compiler->getConfigZIP($d);
        }
 
        public function getConfigHTML($d, $html) {