]> _ Git - cubeextranet.git/commitdiff
wip #819 @0.5
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 13 Mar 2018 15:04:00 +0000 (15:04 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 13 Mar 2018 15:04:00 +0000 (15:04 +0000)
inc/ws/Util/class.ws.tools.php
inc/ws/Util/html5/master/class.ws.html5.compiler.php
inc/ws/Util/html5/master/class.ws.html5.links.php
inc/ws/Util/packager/class.ws.packager.win.exe.html.php

index 498a4dd73aab8837829f1dadf5cdafc9fc8dad27..03cd916cc342a0824d6266c36c387877e115bf42 100644 (file)
@@ -121,8 +121,8 @@ class wsTools {
                        $batik = new cubeCommandLine('inkscape');
                        $batik->setArg('z');
                        $batik->setArg('e', $png);
-                       $batik->setArg('w', $w * $scale);
-                       $batik->setArg('h', $h * $scale);
+                       $batik->setArg('w', floatval($w) * $scale);
+                       $batik->setArg('h', floatval($h) * $scale);
                        $batik->setManualArg($svgColorized);
                        $batik->execute();
                }
index faa1dd462400edf4538b69d9cf67d44596286019..76a486e94faf71f035c7f2e434252536308c246c 100644 (file)
@@ -615,7 +615,11 @@ class wsHTML5Compiler {
                }
                $vars = array('titre', 'credits', 'statsfooter', 'ga', 'style', 'script', 'pagesContents', 'description', 'print', 'hiddenContents', 'splash', 'cache', 'bgcolor', 'message', 'favicon', 'svg', 'beginbody', 'csp', 'opengraph', 'twittercard');
                foreach ($vars as $v) {
-                       $html = str_replace('<!-- $' . $v . ' -->', $$v, $html);
+                       if (isset($$v)) {
+                               $html = str_replace('<!-- $' . $v . ' -->', $$v, $html);
+                       } else {
+                               $html = str_replace('<!-- $' . $v . ' -->', '', $html);
+                       }
                }
 
                $scripts = array();
@@ -1372,7 +1376,7 @@ class wsHTML5Compiler {
                $lessVariables['z'] = $this->z;
                $lessVariables['book-page-width'] = $w;
                $lessVariables['book-page-height'] = $h;
-               $lessVariables['book-page-ratio'] = $w / $h;
+               $lessVariables['book-page-ratio'] = floatval($w) / floatval($h);
 
                $lessVariables['shadow-opacity'] = wsHTML5::colorToArray($this->theme->parametres->bookShadeColor)['opacity'] * 1.2;
                $lessVariables['edges-display'] = $this->_lessBoolean($this->theme->parametres->usePageEdges);
@@ -1404,7 +1408,7 @@ class wsHTML5Compiler {
                        $texts .= 'height:' . ($hm / $this->cssSVGScale) . 'px; max-height:' . ($hm / $this->cssSVGScale) . 'px;';
                        $texts .= '}';
                } else {
-                       $texts = '.texts{width:' . floor($w + 4) . 'px;height:' . floor($h + 4) . 'px;}';
+                       $texts = '.texts{width:' . floor(floatval($w) + 4) . 'px;height:' . floor(floatval($h) + 4) . 'px;}';
                }
                $res[] = $texts;
 
index 5585ecbd5bdb51ed0f98a6e812ffb774b681ffc2..b55761156288c40e83ab9f64234404a305f5856a 100644 (file)
@@ -205,7 +205,7 @@ class wsHTML5Link {
 
        public function getHTMLContainerClass() {
                $res = trim('link ' . $this->class);
-               if ($this->page % 2 == 1) {
+               if (intval($this->page) % 2 == 1) {
                        $res .= ' odd';
                }
                return $res;
@@ -249,7 +249,7 @@ class wsHTML5Link {
        }
 
        public function getCSSContainer() {
-               if (!($this instanceof contentLink) && $this->page % 2 == 1) {
+               if (!($this instanceof contentLink) && intval($this->page) % 2 == 1) {
                        $this->page--;
                        $this->left += $this->compiler->width;
                }
index 65327c563c0ac56b8516b79ef50c90bacf4e529a..5e40df2bc8357f092204158a5013f1fb4af2c391 100644 (file)
@@ -61,7 +61,6 @@ class wsPackagerWinEXEHTML extends wsPackager {
                $cl->execute();\r
 \r
                $this->compileShortcut();\r
-\r
        }\r
 \r
        function compileShortcut() {\r