]> _ Git - cubeextranet.git/commitdiff
#1859
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Fri, 5 Jan 2018 13:04:15 +0000 (13:04 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Fri, 5 Jan 2018 13:04:15 +0000 (13:04 +0000)
inc/ws/Metier/class.ws.book.parametres.php
inc/ws/Util/html5/master/class.ws.html5.compiler.php

index b8bdfc42b73cfd82b6561c26b06ff0deb999e7dd..8dc5a5a3564a28228d55bc336135dede011a6005 100644 (file)
@@ -511,9 +511,10 @@ class wsBookParametres extends wsParametres {
                $this->fields['scorm_id'] = array('type' => 'text', 'default' => 'MFMCTE091mobile', 'editable' => true, 'label' => __('Identifiant SCORM'), 'grade' => 5);
                $this->fields['scorm_org'] = array('type' => 'text', 'default' => 'ACME-ORG-1350650111249', 'editable' => true, 'label' => __('Organisation SCORM'), 'grade' => 5);
                $this->fields['scorm_title'] = array('type' => 'text', 'default' => '', 'editable' => true, 'label' => __('Titre SCORM'), 'grade' => 5, 'hint' => __('Laisser vide pour utiliser le titre de la publication'));
+               $this->fields['scorm_variables'] = array('type' => 'textarea', 'default' => '', 'editable' => true, 'label' => __('Variables SCORM'), 'grade' => 5, 'hint' => __('Laisser vide pour utiliser le titre de la publication'));
 
                $this->forms['scorm'] = array('label' => __('SCORM'),
-                                             'fieldsnames' => array('scorm_enable', 'scorm_id', 'scorm_org', 'scorm_title'));
+                                             'fieldsnames' => array('scorm_enable', 'scorm_id', 'scorm_org', 'scorm_title','scorm_variables'));
        }
 
 }
index 6a6a20637eb70571fd1d5ab12c2a2be60531e142..7a29a7b02ff0bca64fa20be629369bd57e38c7dc 100644 (file)
@@ -55,6 +55,7 @@ class wsHTML5Compiler {
                'js/libs/fluidbook/fluidbook.zoom.js',
                'js/libs/fluidbook/fluidbook.menu.js',
                'js/libs/fluidbook/fluidbook.sound.js',
+               'js/libs/fluidbook/fluidbook.scorm.js',
                'js/libs/fluidbook/menu/fluidbook.chapters.js',
                'js/libs/fluidbook/menu/fluidbook.index.js',
                'js/libs/fluidbook/fluidbook.js',
@@ -658,6 +659,18 @@ class wsHTML5Compiler {
                        $manifest = str_replace('$' . $v, $this->book->parametres->$v, $manifest);
                }
                $this->vdir->file_put_contents('imsmanifest.xml', $manifest);
+
+               $variables = [];
+               $e = CubeIT_Text::explodeNewLines($this->book->parametres->scorm_variables);
+               foreach ($e as $item) {
+                       $item = trim($item);
+                       if ($item == '') {
+                               continue;
+                       }
+                       $f = explode('=', $item, 2);
+                       $variables[$f[0]] = $f[1];
+               }
+               $this->config->scorm_variables = $this->book->parametres->scorm_variables = $variables;
        }
 
        protected function writePrint() {