'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',
$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')) {
$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) {
<?php\r
\r
-class wsPackagerWinEXEHTML extends wsPackager {\r
+class wsPackagerWinEXEHTML extends wsPackager\r
+{\r
\r
protected $exeName;\r
protected $appName;\r
protected $nwplatform = 'windows-x32';\r
protected $nwversion = '0.29.2';\r
protected $appversion = '';\r
+ protected $node_platform = 'win';\r
\r
- public function __construct($book_id) {\r
+ public function __construct($book_id)\r
+ {\r
parent::__construct($book_id, null, true, true);\r
$this->version = 'win-exe-html';\r
$this->book->parametres->alwaysHTML5 = true;\r
}\r
}\r
\r
- protected function preparePackage() {\r
+ protected function preparePackage()\r
+ {\r
parent::preparePackage();\r
$this->copyFluidbookFiles();\r
$this->makeJSON();\r
$cl->setArg('title', $this->appName);\r
$cl->setArg('output-dir', $this->buildPath);\r
$cl->setArg('nw-version', $this->nwversion);\r
- //$cl->setArg('sdk-build');\r
+ $cl->setArg('sdk-build');\r
$cl->setArg('main', 'index.html');\r
$cl->setArg('name', $this->exeName);\r
$cl->setArg('mac-icon', $this->vdir . 'icon.icns');\r
$cl->debug();\r
}\r
\r
- function makeJSON() {\r
+ function makeJSON()\r
+ {\r
$data = ['app_name' => $this->appName, 'main' => 'index.html', 'name' => $this->exeName, 'version' => '1.0.' . time(),\r
- 'webkit' => [],\r
- 'window' => ['height' => 768, 'width' => 1024, 'title' => $this->appName, 'id' => 'main', 'icon' => 'icon.png', 'mac_icon' => 'icon.icns']\r
+ 'webkit' => [],\r
+ 'window' => ['height' => 768, 'width' => 1024, 'title' => $this->appName, 'id' => 'main', 'icon' => 'icon.png', 'mac_icon' => 'icon.icns'],\r
+ 'dependencies' => ['child_process' => "^1.0.2",\r
+ 'fs' => '0.0.1-security',\r
+ 'path' => '^0.12.7'],\r
];\r
$pngIcon = $this->vdir . '/icon.png';\r
$winIcon = $this->vdir . '/icon.ico';\r
file_put_contents($this->vdir . '/package.json', json_encode($data));\r
}\r
\r
- public function makePackage($zip) {\r
+ public function makePackage($zip)\r
+ {\r
parent::makePackage($zip);\r
$res = $this->zip();\r
$this->postPackage();\r
return $res;\r
}\r
\r
- public function getFinalPackageDir() {\r
+ public function getFinalPackageDir()\r
+ {\r
return $this->buildPath . '/' . $this->exeName . '/' . $this->nwplatform;\r
}\r
\r
- protected function compile() {\r
+ protected function compile()\r
+ {\r
$this->daoBook->compile($this->book_id, 'html5', false, $this->book->parametres->forceCompileOnDownload);\r
}\r
\r
- protected function copyFluidbookFiles() {\r
+ protected function copyFluidbookFiles()\r
+ {\r
// Copie du FB vers un répertoire temporaire\r
$cp = new cubeCommandLine('cp');\r
$cp->setArg('R');\r
$cp->setArg(null, WS_BOOKS . '/html5/' . $this->book->book_id . '/*');\r
$cp->setArg(null, $this->vdir);\r
$cp->execute();\r
+\r
+\r
+ $this->copyExtras();\r
+ $this->copyNodeModules();\r
+\r
+ }\r
+\r
+ protected function copyExtras()\r
+ {\r
+\r
+ if ($this->book->parametres->form == 'bourbon') {\r
+\r
+ $dest = $this->vdir . '/exe';\r
+ if (!file_exists($dest)) {\r
+ mkdir($dest, 0777, true);\r
+ }\r
+ $this->copy(WS_FILES . '/bourbon/sendemail.exe', $dest . '/sendemail.exe');\r
+ }\r
+ }\r
+\r
+ protected function copyNodeModules()\r
+ {\r
+ $dest = $this->vdir . '/node_modules';\r
+ if (!file_exists($dest)) {\r
+ mkdir($dest, 0777, true);\r
+ }\r
+ $cp = new cubeCommandLine('cp');\r
+ $cp->setArg('R');\r
+ $cp->setArg('p');\r
+ $cp->setArg(null, WS_COMPILE_ASSETS . '/_exehtml/_node_modules_' . $this->node_platform . '/*');\r
+ $cp->setArg(null, $dest);\r
+ $cp->execute();\r
}\r
}
\ No newline at end of file