From: vincent@cubedesigners.com Date: Thu, 1 Sep 2022 16:20:42 +0000 (+0000) Subject: wait #4209 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=4971ce49729e74d53a7c556bbc0f32e6d24bd788;p=cubeextranet.git wait #4209 --- diff --git a/inc/ws/Controlleur/class.ws.flash.php b/inc/ws/Controlleur/class.ws.flash.php index 940d2ff99..971453941 100644 --- a/inc/ws/Controlleur/class.ws.flash.php +++ b/inc/ws/Controlleur/class.ws.flash.php @@ -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; } diff --git a/inc/ws/Util/html5/class.ws.html5.php b/inc/ws/Util/html5/class.ws.html5.php index b71da0e02..43d37267b 100644 --- a/inc/ws/Util/html5/class.ws.html5.php +++ b/inc/ws/Util/html5/class.ws.html5.php @@ -48,7 +48,7 @@ class wsHTML5 } } - return new wsHTML5Compiler($book_id, $version, $phonegap, $phonegapVersion, $dir, $standalone, $appcache, $home, $book, $forceTheme,$hybrid); + return new wsHTML5Compiler($book_id, $version, $phonegap, $phonegapVersion, $dir, $standalone, $appcache, $home, $book, $forceTheme, $hybrid); } public static function getPhonegapVersion($v = 'latest') @@ -94,16 +94,26 @@ class wsHTML5 return CubeIT_Graphics_Color::colorToCSS($color, $forceAlpha); } - public static function getSourcesPath($version) + public static function getSourcesPath($version, $dir = null) { - if ($version === 'stable') { - return WS_COMPILE_ASSETS . '/player/branches/master'; + $res = WS_COMPILE_ASSETS . '/player/'; + if (null !== $dir) { + $res .= $dir . '/'; } - if ($version === 'dev') { - return WS_COMPILE_ASSETS . '/player/local/master'; + if ($version === 'stable') { + $res .= 'branches/master'; + } else if ($version === 'dev') { + $res .= 'local/master'; + } else { + list($branch, $location) = explode('|', $version); + $res .= ($location === 'git' ? 'branches' : $location) . '/' . $branch; } - list($branch, $location) = explode('|', $version); - return WS_COMPILE_ASSETS . '/player/' . ($location === 'git' ? 'branches' : $location) . '/' . $branch; + return $res; + } + + public static function getCompiledSourcesPath($version) + { + return self::getSourcesPath($version, 'compiled'); } diff --git a/inc/ws/Util/html5/master/class.ws.html5.compiler.php b/inc/ws/Util/html5/master/class.ws.html5.compiler.php index 1b8b24de3..54ca92c79 100644 --- a/inc/ws/Util/html5/master/class.ws.html5.compiler.php +++ b/inc/ws/Util/html5/master/class.ws.html5.compiler.php @@ -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"> $finals['widget'] = $this->widgetJsFiles; } - $dirminimized = $this->assets . '/js/min/'; + $dirminimized = $this->compiledAssets . '/js/min/'; if (!file_exists($dirminimized)) { mkdir($dirminimized, 0777, true); }