From: vincent@cubedesigners.com Date: Wed, 6 Jun 2018 10:50:47 +0000 (+0000) Subject: wip #1998 @4 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=4c131f215b45ad082059ae936ebef5a32fc39624;p=cubeextranet.git wip #1998 @4 --- diff --git a/inc/ws/Metier/class.ws.book.parametres.php b/inc/ws/Metier/class.ws.book.parametres.php index 486cc4b2b..4e3566b39 100644 --- a/inc/ws/Metier/class.ws.book.parametres.php +++ b/inc/ws/Metier/class.ws.book.parametres.php @@ -373,7 +373,7 @@ class wsBookParametres extends wsParametres $this->forms['archives'] = array('label' => __('Archives'), 'fieldsnames' => array('externalArchives', 'externalArchivesBack', '|', 'archivesLink', 'archivesLabel')); // . - $this->fields['form'] = array('type' => 'combo', 'default' => '', 'editable' => true, 'grade' => 5, 'label' => __('Formulaire'), 'datas' => array(__('Aucun') => '', __('Bulle Groupe') => 'bulle')); + $this->fields['form'] = array('type' => 'combo', 'default' => '', 'editable' => true, 'grade' => 5, 'label' => __('Formulaire'), 'datas' => array(__('Aucun') => '', 'Bulle Groupe' => 'bulle', 'Bourbon / Suggestions' => 'bourbon')); $this->forms['form'] = array('label' => __('Formulaire'), 'fieldsnames' => array('form')); 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 3e3f2cac7..34253ac47 100644 --- a/inc/ws/Util/html5/master/class.ws.html5.compiler.php +++ b/inc/ws/Util/html5/master/class.ws.html5.compiler.php @@ -27,7 +27,6 @@ class wsHTML5Compiler 'js/libs/gal/gal.js', 'js/libs/gal/gal.filesystem.js', 'js/libs/hammer.min.js', - 'js/libs/fluidbook/forms/fluidbook.form.bulle.js', 'js/libs/fluidbook/fluidbook.utils.js', 'js/libs/fluidbook/fluidbook.links.js', 'js/libs/fluidbook/fluidbook.support.js', @@ -720,7 +719,8 @@ class wsHTML5Compiler $manifestfile = '_imsmanifest.2004.xml'; } - $manifest = file_get_contents($this->assets . '/' . $manifestfile); if (!$this->book->parametres->scorm_title) { + $manifest = file_get_contents($this->assets . '/' . $manifestfile); + if (!$this->book->parametres->scorm_title) { $this->book->parametres->scorm_title = $this->book->parametres->title; } if (!$this->book->parametres->scorm_id || ($this->book->book_id > 16614 && $this->book->parametres->scorm_id == 'MFMCTE091mobile')) { @@ -1177,6 +1177,13 @@ class wsHTML5Compiler $this->config->manifest = $this->writeManifest(); } + if ($this->config->form == 'bulle') { + $this->addJs('js/libs/fluidbook/forms/fluidbook.form.bulle.js'); + } else if ($this->config->form == 'bourbon') { + $this->addJs('js/libs/parsley.min.js'); + $this->addJs('js/libs/fluidbook/forms/fluidbook.form.bourbon.js'); + } + if ($this->config->basket) { $this->addJs('js/libs/fluidbook/fluidbook.cart.js'); switch ($this->config->basketManager) { 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 00f8e7f9f..5158b699f 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 @@ -3,6 +3,7 @@ class wsPackagerMacEXEHTML extends wsPackagerWinEXEHTML { protected $nwplatform = 'osx64'; protected $nwversion = '0.29.0'; + protected $node_platform='mac'; public function __construct($book_id) { parent::__construct($book_id); 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 45528e9e4..a165c27cc 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 @@ -1,6 +1,7 @@ version = 'win-exe-html'; $this->book->parametres->alwaysHTML5 = true; @@ -26,7 +29,8 @@ class wsPackagerWinEXEHTML extends wsPackager { } } - protected function preparePackage() { + protected function preparePackage() + { parent::preparePackage(); $this->copyFluidbookFiles(); $this->makeJSON(); @@ -44,7 +48,7 @@ class wsPackagerWinEXEHTML extends wsPackager { $cl->setArg('title', $this->appName); $cl->setArg('output-dir', $this->buildPath); $cl->setArg('nw-version', $this->nwversion); - //$cl->setArg('sdk-build'); + $cl->setArg('sdk-build'); $cl->setArg('main', 'index.html'); $cl->setArg('name', $this->exeName); $cl->setArg('mac-icon', $this->vdir . 'icon.icns'); @@ -61,10 +65,14 @@ class wsPackagerWinEXEHTML extends wsPackager { $cl->debug(); } - function makeJSON() { + function makeJSON() + { $data = ['app_name' => $this->appName, 'main' => 'index.html', 'name' => $this->exeName, 'version' => '1.0.' . time(), - 'webkit' => [], - 'window' => ['height' => 768, 'width' => 1024, 'title' => $this->appName, 'id' => 'main', 'icon' => 'icon.png', 'mac_icon' => 'icon.icns'] + 'webkit' => [], + 'window' => ['height' => 768, 'width' => 1024, 'title' => $this->appName, 'id' => 'main', 'icon' => 'icon.png', 'mac_icon' => 'icon.icns'], + 'dependencies' => ['child_process' => "^1.0.2", + 'fs' => '0.0.1-security', + 'path' => '^0.12.7'], ]; $pngIcon = $this->vdir . '/icon.png'; $winIcon = $this->vdir . '/icon.ico'; @@ -83,22 +91,26 @@ class wsPackagerWinEXEHTML extends wsPackager { file_put_contents($this->vdir . '/package.json', json_encode($data)); } - public function makePackage($zip) { + public function makePackage($zip) + { parent::makePackage($zip); $res = $this->zip(); $this->postPackage(); return $res; } - public function getFinalPackageDir() { + public function getFinalPackageDir() + { return $this->buildPath . '/' . $this->exeName . '/' . $this->nwplatform; } - protected function compile() { + protected function compile() + { $this->daoBook->compile($this->book_id, 'html5', false, $this->book->parametres->forceCompileOnDownload); } - protected function copyFluidbookFiles() { + protected function copyFluidbookFiles() + { // Copie du FB vers un répertoire temporaire $cp = new cubeCommandLine('cp'); $cp->setArg('R'); @@ -106,5 +118,37 @@ class wsPackagerWinEXEHTML extends wsPackager { $cp->setArg(null, WS_BOOKS . '/html5/' . $this->book->book_id . '/*'); $cp->setArg(null, $this->vdir); $cp->execute(); + + + $this->copyExtras(); + $this->copyNodeModules(); + + } + + protected function copyExtras() + { + + if ($this->book->parametres->form == 'bourbon') { + + $dest = $this->vdir . '/exe'; + if (!file_exists($dest)) { + mkdir($dest, 0777, true); + } + $this->copy(WS_FILES . '/bourbon/sendemail.exe', $dest . '/sendemail.exe'); + } + } + + protected function copyNodeModules() + { + $dest = $this->vdir . '/node_modules'; + if (!file_exists($dest)) { + mkdir($dest, 0777, true); + } + $cp = new cubeCommandLine('cp'); + $cp->setArg('R'); + $cp->setArg('p'); + $cp->setArg(null, WS_COMPILE_ASSETS . '/_exehtml/_node_modules_' . $this->node_platform . '/*'); + $cp->setArg(null, $dest); + $cp->execute(); } } \ No newline at end of file diff --git a/inc/ws/Util/packager/class.ws.packager.win.inst.html.php b/inc/ws/Util/packager/class.ws.packager.win.inst.html.php index 6c20d46b3..5d99ed15a 100644 --- a/inc/ws/Util/packager/class.ws.packager.win.inst.html.php +++ b/inc/ws/Util/packager/class.ws.packager.win.inst.html.php @@ -32,7 +32,6 @@ class wsPackagerWinINSTHTML extends wsPackagerWinEXEHTML { mkdir(WS_FILES . '/packager/download', 0777, true); } - $fname = $this->exeName; $title = $this->appName;