From: vincent@cubedesigners.com Date: Mon, 22 Oct 2018 14:39:28 +0000 (+0000) Subject: fix #2038 @1.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=fc0d24f7c4961d90b1a2b07da72db0815ed0f00a;p=cubeextranet.git fix #2038 @1.5 --- diff --git a/fluidbook/compile/fluidbook.png b/fluidbook/compile/fluidbook.png new file mode 100644 index 000000000..983708ade Binary files /dev/null and b/fluidbook/compile/fluidbook.png differ diff --git a/inc/commons/class.common.tools.php b/inc/commons/class.common.tools.php index 482683316..126adb80c 100644 --- a/inc/commons/class.common.tools.php +++ b/inc/commons/class.common.tools.php @@ -557,11 +557,12 @@ class commonTools public static function pngToIcns($file, $res) { if (!file_exists($file)) { + die('!!!!'); return; } $icns = array(128, 256, 512); - $png2icns = new cubeCommandLine('png2icns'); + $png2icns = new CubeIT_CommandLine('png2icns'); $png2icns->setArg(null, $res); $tmp = array(); @@ -579,6 +580,7 @@ class commonTools } $png2icns->execute(); + $png2icns->debug(); foreach ($tmp as $item) { unlink($tmp); } @@ -1196,13 +1198,13 @@ class commonTools $url = $_GET['url']; $dir = '/data/extranet/www/cache/youtubedl'; `cd $dir;youtube-dl $url`; - $fname=trim(`youtube-dl --get-filename $url`); + $fname = trim(`youtube-dl --get-filename $url`); $path = $dir . '/' . $fname; header('Content-Type: application/octet-stream'); - header('Content-Disposition: attachment; filename="'.$fname.'"'); - header('X-SendFile: '.$path); + header('Content-Disposition: attachment; filename="' . $fname . '"'); + header('X-SendFile: ' . $path); ob_end_clean(); exit; } diff --git a/inc/ws/Util/packager/class.ws.packager.mac.exe.html.php b/inc/ws/Util/packager/class.ws.packager.mac.exe.html.php index db67c40fe..f6afc2453 100644 --- a/inc/ws/Util/packager/class.ws.packager.mac.exe.html.php +++ b/inc/ws/Util/packager/class.ws.packager.mac.exe.html.php @@ -1,18 +1,23 @@ version = 'mac-exe-html'; + } - public function makePackage($zip) { + public function makePackage($zip) + { $this->preparePackage(); - $toDelete = ['chromedriver', 'credits.html', 'minidump_stackwalk', 'nwjc', 'payload']; + $toDelete = ['chromedriver', 'credits.html', 'minidump_stackwalk', 'nwjc', 'payload', 'v8_context_snapshot.bin', 'natives_blob.bin']; foreach ($toDelete as $item) { $p = $this->getFinalPackageDir() . '/' . $item; `rm -rf "$p"`; @@ -26,11 +31,14 @@ class wsPackagerMacEXEHTML extends wsPackagerWinEXEHTML { return $res; } - public function getFinalPackageDir() { - return parent::getFinalPackageDir() . $this->nwplatform . '/'; + public function getFinalPackageDir() + { + $res = parent::getFinalPackageDir(); + return $res; } - protected function preparePackage() { + protected function preparePackage() + { $this->initTempDir(); $this->copyFluidbookFiles(); $this->makeJSON(); @@ -44,6 +52,7 @@ class wsPackagerMacEXEHTML extends wsPackagerWinEXEHTML { $cl->setPath(CONVERTER_PATH); $cl->setArg('p', $this->nwplatform); $cl->setArg('o', $this->buildPath); + $cl->setArg('v', $this->nwversion); $cl->setArg('winIco', $this->vdir . '/icon.ico'); $cl->setArg('macIcns', $this->vdir . '/icon.icns'); $cl->setArg(null, $this->vdir); diff --git a/inc/ws/Util/packager/class.ws.packager.win.exe.html.php b/inc/ws/Util/packager/class.ws.packager.win.exe.html.php index f4894e18c..f33c43c56 100644 --- a/inc/ws/Util/packager/class.ws.packager.win.exe.html.php +++ b/inc/ws/Util/packager/class.ws.packager.win.exe.html.php @@ -2,14 +2,14 @@ class wsPackagerWinEXEHTML extends wsPackager { - protected $exeName; protected $appName; protected $buildPath; protected $nwplatform = 'windows-x32'; - protected $nwversion = '0.29.2'; + protected $nwversion = '0.34.0'; protected $appversion = ''; protected $node_platform = 'win'; + protected $exenameMaxlength = 30; public function __construct($book_id) { @@ -20,10 +20,10 @@ class wsPackagerWinEXEHTML extends wsPackager $this->_clean = false; if ($this->book->parametres->offlineTitle == "") { - $this->exeName = cubeText::str2URL(mb_substr($this->book->parametres->title, 0, 30)); + $this->exeName = cubeText::str2URL(mb_substr($this->book->parametres->title, 0, $this->exenameMaxlength)); $this->appName = $this->book->parametres->title; } else { - $this->exeName = cubeText::str2URL($this->book->parametres->offlineTitle); + $this->exeName = cubeText::str2URL(mb_substr($this->book->parametres->offlineTitle, 0, $this->exenameMaxlength)); $this->appName = $this->book->parametres->offlineTitle; } } @@ -75,18 +75,25 @@ class wsPackagerWinEXEHTML extends wsPackager ]; $pngIcon = $this->vdir . '/icon.png'; $winIcon = $this->vdir . '/icon.ico'; - if ($this->theme->parametres->favicon == '') { - $png = WS_COMPILE_ASSETS . '/fluidbook.png'; - $ico = WS_COMPILE_ASSETS . '/fluidbook.ico'; - } else { - $png = $this->vdir . '/data/favicon.png'; - $ico = $this->vdir . '/data/favicon.ico'; + + $png = WS_COMPILE_ASSETS . '/fluidbook.png'; + $ico = WS_COMPILE_ASSETS . '/fluidbook.ico'; + + if ($this->theme->parametres->favicon != '') { + if (file_exists($this->vdir . '/data/favicon.png')) { + $png = $this->vdir . '/data/favicon.png'; + } + if (file_exists($this->vdir . '/data/favicon.ico')) { + $ico = $this->vdir . '/data/favicon.ico'; + } } $icns = $this->vdir . '/icon.icns'; $this->copy($png, $pngIcon); $this->copy($ico, $winIcon); + commonTools::pngToIcns($png, $icns); + file_put_contents($this->vdir . '/package.json', json_encode($data)); } @@ -127,10 +134,8 @@ class wsPackagerWinEXEHTML extends wsPackager $cp->setArg(null, $this->vdir); $cp->execute(); - $this->copyExtras(); $this->copyNodeModules(); - } protected function copyExtras()