]> _ Git - cubeextranet.git/commitdiff
wip #1998 @4
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Wed, 6 Jun 2018 10:50:47 +0000 (10:50 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Wed, 6 Jun 2018 10:50:47 +0000 (10:50 +0000)
inc/ws/Metier/class.ws.book.parametres.php
inc/ws/Util/html5/master/class.ws.html5.compiler.php
inc/ws/Util/packager/class.ws.packager.mac.exe.html.php
inc/ws/Util/packager/class.ws.packager.win.exe.html.php
inc/ws/Util/packager/class.ws.packager.win.inst.html.php

index 486cc4b2be0af0dfb922e86080223575116d0f42..4e3566b399e435673c3e6ca38e4dd3de06a62293 100644 (file)
@@ -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'));
 
index 3e3f2cac7ef8f8a28c4b4594c1df60539ab30069..34253ac4712797aea2486fb54b21a25f39211dd7 100644 (file)
@@ -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) {
index 00f8e7f9f8c200607faae2599877a1852163b1a2..5158b699f286d5a49f3d42f5f04053b7d3ea2d9f 100644 (file)
@@ -3,6 +3,7 @@
 class wsPackagerMacEXEHTML extends wsPackagerWinEXEHTML {\r
        protected $nwplatform = 'osx64';\r
        protected $nwversion = '0.29.0';\r
+       protected $node_platform='mac';\r
 \r
        public function __construct($book_id) {\r
                parent::__construct($book_id);\r
index 45528e9e4f14ae48d3a2cb3eb6d2df7322ebba0a..a165c27ccc05bf33b28d4c3381cc922e57d2967a 100644 (file)
@@ -1,6 +1,7 @@
 <?php\r
 \r
-class wsPackagerWinEXEHTML extends wsPackager {\r
+class wsPackagerWinEXEHTML extends wsPackager\r
+{\r
 \r
        protected $exeName;\r
        protected $appName;\r
@@ -8,8 +9,10 @@ class wsPackagerWinEXEHTML extends wsPackager {
        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
@@ -26,7 +29,8 @@ class wsPackagerWinEXEHTML extends wsPackager {
                }\r
        }\r
 \r
-       protected function preparePackage() {\r
+       protected function preparePackage()\r
+       {\r
                parent::preparePackage();\r
                $this->copyFluidbookFiles();\r
                $this->makeJSON();\r
@@ -44,7 +48,7 @@ class wsPackagerWinEXEHTML extends wsPackager {
                $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
@@ -61,10 +65,14 @@ class wsPackagerWinEXEHTML extends wsPackager {
                $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
@@ -83,22 +91,26 @@ class wsPackagerWinEXEHTML extends wsPackager {
                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
@@ -106,5 +118,37 @@ class wsPackagerWinEXEHTML extends wsPackager {
                $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
index 6c20d46b39b6da21b8005895a950724273a76ed9..5d99ed15af80bd753e47eb0fefb8bfa913d0faa3 100644 (file)
@@ -32,7 +32,6 @@ class wsPackagerWinINSTHTML extends wsPackagerWinEXEHTML {
                        mkdir(WS_FILES . '/packager/download', 0777, true);\r
                }\r
 \r
-\r
                $fname = $this->exeName;\r
                $title = $this->appName;\r
 \r