]> _ Git - cubeextranet.git/commitdiff
wait #4209
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Thu, 1 Sep 2022 16:20:42 +0000 (16:20 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Thu, 1 Sep 2022 16:20:42 +0000 (16:20 +0000)
inc/ws/Controlleur/class.ws.flash.php
inc/ws/Util/html5/class.ws.html5.php
inc/ws/Util/html5/master/class.ws.html5.compiler.php

index 940d2ff994199904ed19f3da5165d80521832c18..9714539410fecf7e5fffce7083aac59a87178cca 100644 (file)
@@ -214,43 +214,9 @@ class wsFlash extends cubeFlashGateway
             $api = new ws3API();
             $api->uploadThemeFile($this->args['theme_id'], $this->args['fieldname'], $tmp);
 
-
             $dir = WS_FILES . '/themes3/' . $this->args['theme_id'];
             $dest = $dir . '/' . $fname;
 
-
-            if (isset($this->args['type']) && $this->args['type'] == 'favicon') {
-                $icotool = new cubeCommandLine('icotool');
-                $icotool->setArg('c');
-                $icotool->setArg('o', $dir . '/fluidbook.ico');
-
-                $sizes = array(256, 128, 64, 32, 16);
-
-                foreach ($sizes as $s) {
-                    $r = $dir . '/ico-' . $s . '.png';
-                    $it = new cubeImageTools();
-                    $it->loadImage($dest);
-                    $it->resize($s, $s, 'crop', true, 'C', 'M', 'transparent');
-                    $it->output('png', $r);
-                    $icotool->setArg(null, $r);
-                }
-
-                $icotool->execute();
-            }
-
-            if (in_array(strtolower(files::getExtension($dest)), array('svg'))) {
-                // Optimize & rasterize SVG
-                $orig = str_replace('.svg', '.o.svg', $dest);
-                rename($dest, $orig);
-                $png = str_replace('.svg', '.png', $dest);
-
-                `/usr/local/bin/svgcleaner $orig $dest`;
-                if (!file_exists($dest)) {
-                    copy($orig, $dest);
-                }
-                `convert -background none $dest $png`;
-            }
-
             $this->xml->addChild('file', $fname);
             return;
         }
index b71da0e0240152eef7e492ce7f78a00b54ebf560..43d37267b8944935737e1deb653b523efa7cffa3 100644 (file)
@@ -48,7 +48,7 @@ class wsHTML5
             }\r
         }\r
 \r
-        return new wsHTML5Compiler($book_id, $version, $phonegap, $phonegapVersion, $dir, $standalone, $appcache, $home, $book, $forceTheme,$hybrid);\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
@@ -94,16 +94,26 @@ class wsHTML5
         return CubeIT_Graphics_Color::colorToCSS($color, $forceAlpha);\r
     }\r
 \r
-    public static function getSourcesPath($version)\r
+    public static function getSourcesPath($version, $dir = null)\r
     {\r
-        if ($version === 'stable') {\r
-            return WS_COMPILE_ASSETS . '/player/branches/master';\r
+        $res = WS_COMPILE_ASSETS . '/player/';\r
+        if (null !== $dir) {\r
+            $res .= $dir . '/';\r
         }\r
-        if ($version === 'dev') {\r
-            return WS_COMPILE_ASSETS . '/player/local/master';\r
+        if ($version === 'stable') {\r
+            $res .= 'branches/master';\r
+        } else if ($version === 'dev') {\r
+            $res .= 'local/master';\r
+        } else {\r
+            list($branch, $location) = explode('|', $version);\r
+            $res .= ($location === 'git' ? 'branches' : $location) . '/' . $branch;\r
         }\r
-        list($branch, $location) = explode('|', $version);\r
-        return WS_COMPILE_ASSETS . '/player/' . ($location === 'git' ? 'branches' : $location) . '/' . $branch;\r
+        return $res;\r
+    }\r
+\r
+    public static function getCompiledSourcesPath($version)\r
+    {\r
+        return self::getSourcesPath($version, 'compiled');\r
     }\r
 \r
 \r
index 1b8b24de36946e97ca9439875591291708bea132..54ca92c7948b885174e811222c0ade7197fb5128 100644 (file)
@@ -205,6 +205,7 @@ class wsHTML5Compiler
     public $svg = true;
     public $config = array();
     public $assets = '';
+    public $compiledAssets = '';
     public $phonegap = false;
     public $phonegapVersion;
     public $standalone = false;
@@ -252,6 +253,7 @@ class wsHTML5Compiler
         $this->hybrid = $hybrid;
 
         $this->assets = wsHTML5::getSourcesPath($this->version);
+        $this->compiledAssets = wsHTML5::getCompiledSourcesPath($this->version);
 
         $this->phonegap = $phonegap;
         $this->standalone = $standalone || $this->phonegap;
@@ -2631,7 +2633,7 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
             $finals['widget'] = $this->widgetJsFiles;
         }
 
-        $dirminimized = $this->assets . '/js/min/';
+        $dirminimized = $this->compiledAssets . '/js/min/';
         if (!file_exists($dirminimized)) {
             mkdir($dirminimized, 0777, true);
         }