]> _ Git - cubeextranet.git/commitdiff
fix #1737 @2
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Mon, 9 Oct 2017 13:07:09 +0000 (13:07 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Mon, 9 Oct 2017 13:07:09 +0000 (13:07 +0000)
inc/ws/Util/html5/burgermenu/class.ws.html5.links.php

index 55d758fa2ef2215c82c5c20c2de2ed7d153a6896..c946903c55ce0ecae4ff4b9e5cdf4edc7f5d3dbb 100644 (file)
@@ -221,8 +221,8 @@ class wsHTML5Link {
                $this->compiler->copyLinkFile($file, 'data/links/', $video);
        }
 
-       public function copyExternalDir($dir) {
-               $this->compiler->copyLinkDir($dir, 'data/links');
+       public function copyExternalDir($dir, $dest = 'data/links') {
+               $this->compiler->copyLinkDir($dir, $dest);
        }
 
        public function unzipFile($file, $moveAssets = false) {
@@ -530,8 +530,8 @@ class videoLink extends wsHTML5Link {
                $h = round($this->height * $this->getCssScale());
 
                // Note: width and height for the video is normally measured from the
-        // preview frame for local files or set to 1280 x 720 for web videos.
-        // The $w and $h variables here seem to be null generally...
+               // preview frame for local files or set to 1280 x 720 for web videos.
+               // The $w and $h variables here seem to be null generally...
 
                return $this->makeVideoTag($this, $w, $h, $this->compiler);
        }
@@ -569,7 +569,7 @@ class videoLink extends wsHTML5Link {
                        $attr['height'] = $h;
 
                } else if (!is_null($compiler)) {
-            // Get video dimensions from thumbnail if possible (locally uploaded files)
+                       // Get video dimensions from thumbnail if possible (locally uploaded files)
                        $path = WS_BOOKS . '/working/' . $compiler->book_id . '/' . $basename . '.jpg';
                        $dim = getimagesize($path);
                        $attr['width'] = $dim[0];
@@ -821,11 +821,11 @@ class htmlMultimediaLink extends wsHTML5Link {
                        if ($ext == 'oam') {
                                $d = $this->unzipFile($this->alternative, true);
                                $this->_config = $this->getConfigOAM($d['dir']);
-                               $this->copyExternalDir($d['dir']);
+                               $this->copyExternalDir($d['dir'], $d['fdir']);
                        } elseif ($ext == 'zip') {
                                $d = $this->unzipFile($this->alternative, false);
                                $this->_config = $this->getConfigZIP($d['dir']);
-                               $this->copyExternalDir($d['dir']);
+                               $this->copyExternalDir($d['dir'], $d['fdir']);
                        } elseif ($ext == 'html') {
                                $fdir = 'data/links';
                                $dir = $fdir;
@@ -1225,8 +1225,8 @@ class zoomLink extends normalLink {
                // Data attributes
                $attributes = [
                        'maxzoom' => $this->to,
-            'width' => round($this->width),
-            'height' => round($this->height)
+                       'width' => round($this->width),
+                       'height' => round($this->height)
                ];
 
                // Set data attributes
@@ -1243,30 +1243,30 @@ class zoomLink extends normalLink {
 
                $maxzoom = ((int)$this->to !== 0) ? $this->to : 2; // Max zoom level might not always be set in the link editor
 
-        // TODO: Consider generating higher-res images (eg. 2x) for HiDPI screens. Maybe some extra optimisations can be done on the larger images...
+               // TODO: Consider generating higher-res images (eg. 2x) for HiDPI screens. Maybe some extra optimisations can be done on the larger images...
 
                $extractOptions = [
-                   // The Poppler::extractArea function accepts a resolution setting and uses that to determine the
-            // scale factor on the extracted images. It does so by dividing by 72, so we can pass our own scale
-            // factor by setting the resolution to 72 * $maxzoom
-                   'resolution' => 72 * $maxzoom
-        ];
+                       // The Poppler::extractArea function accepts a resolution setting and uses that to determine the
+                       // scale factor on the extracted images. It does so by dividing by 72, so we can pass our own scale
+                       // factor by setting the resolution to 72 * $maxzoom
+                       'resolution' => 72 * $maxzoom
+               ];
 
                // Round all link co-ordinates because there seems to be a problem with the the Workshop link editor
-        // where link "left" values (and maybe others) change fractionally upon saves. This causes problems later when
-        // extracting the zoom images from the PDF because it causes a cache-miss and the images are regenerated again.
+               // where link "left" values (and maybe others) change fractionally upon saves. This causes problems later when
+               // extracting the zoom images from the PDF because it causes a cache-miss and the images are regenerated again.
                $x = round($this->left);
                $y = round($this->top);
                $w = round($this->width);
                $h = round($this->height);
-        $bookwidth = round($this->compiler->book->parametres->width);
+               $bookwidth = round($this->compiler->book->parametres->width);
 
-        //error_log("--- Book Width: $bookwidth ---");
+               //error_log("--- Book Width: $bookwidth ---");
 
                $p = wsDAOBook::getDocumentPage($this->compiler->book_id, $this->page);
                $pdfpath = wsDocument::getDir($p['document_id']) . 'original.pdf';
 
-        $left = CubeIT_Files::tempnam();
+               $left = CubeIT_Files::tempnam();
                $leftfile = CubeIT_CommandLine_Poppler::extractArea($pdfpath,
                        $p['document_page'],
                        array('x' => $x, 'y' => $y, 'width' => $w, 'height' => $h),