]> _ Git - cubeextranet.git/commitdiff
wip #2227 @0:10
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Thu, 4 Oct 2018 12:50:33 +0000 (12:50 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Thu, 4 Oct 2018 12:50:33 +0000 (12:50 +0000)
inc/ws/Controlleur/class.ws.url.php
inc/ws/Util/html5/master/class.ws.html5.links.php

index dcef8b5c13fcb58b310e0db2db1ffc2eba3aa502..a4c7d7cfe1454cdc140a57cfecc91e2e94ca9149 100644 (file)
@@ -135,7 +135,7 @@ class wsUrl
                        }
                        if ($book->version > 1 || $droits->admin) {
                                $types = [];
-                               if (!$book->parametres->scorm_enable && !$book->parametres->alwaysHTML5) {
+                               if (!$book->parametres->alwaysHTML5) {
                                        $types[] = 'flash';
                                        $defaultPlayer = 'viewer';
                                } else {
index e2d0cf7a116ab97961984f0601b02c2c4bd06341..185b0398965872ca13ed124ac198efab525ceeb7 100644 (file)
@@ -32,6 +32,7 @@ class wsHTML5Link
        public $rot;
        public $class;
        public $uid;
+       public $scorm;
        public $zindex = 4;
 
        protected $_init;
@@ -51,6 +52,8 @@ class wsHTML5Link
         */
        public static function getInstance($id, $init, &$compiler)
        {
+               $init['scorm'] = (stristr($init['to'], 'scorm') || stristr($init['alternative'], 'scorm'));
+
                switch ($init['type']) {
                        case 1:
                        case 2:
@@ -240,7 +243,7 @@ class wsHTML5Link
 
        public function getHTMLContainer()
        {
-               return '<div class="' . $this->getHTMLContainerClass() . '" data-id="' . $this->uid . '" id="l_' . $this->id . '"' . $this->getAdditionnalContent() . '>' . $this->getHTMLContent() . '</div>';
+               return '<div class="' . $this->getHTMLContainerClass() . '" data-scorm="' . $this->scorm . '" data-id="' . $this->uid . '" id="l_' . $this->id . '"' . $this->getAdditionnalContent() . '>' . $this->getHTMLContent() . '</div>';
        }
 
        public function getHTMLContainerClass()
@@ -1484,21 +1487,21 @@ class haguenauManifLink extends internalLink
 
 class zoomLink extends normalLink
 {
-    protected $maxzoom_default = 2;
+       protected $maxzoom_default = 2;
 
        public function getHTMLContainerClass()
        {
-           $class = ' zoomarea';
+               $class = ' zoomarea';
 
-        $groups = explode(',', $this->group);
+               $groups = explode(',', $this->group);
 
-        // If there's more than one group assigned, this link shouldn't be clickable (disabled via CSS)
-        // This needs to be set here (parent element) instead of on the actual link so we don't end up with a dead zone
-        if (count($groups) > 1) {
-            $class .= ' pointer-events-none';
-        }
+               // If there's more than one group assigned, this link shouldn't be clickable (disabled via CSS)
+               // This needs to be set here (parent element) instead of on the actual link so we don't end up with a dead zone
+               if (count($groups) > 1) {
+                       $class .= ' pointer-events-none';
+               }
 
-           return parent::getHTMLContainerClass() . $class;
+               return parent::getHTMLContainerClass() . $class;
        }
 
        public function getDefaultTooltip()
@@ -1515,17 +1518,17 @@ class zoomLink extends normalLink
        {
                $res = parent::getAdditionnalContent();
 
-               $res .= ' id="'. $this->uid .'"';
+               $res .= ' id="' . $this->uid . '"';
 
                // Data attributes
                $attributes = [
                        'maxzoom' => empty($this->to) ? $this->maxzoom_default : $this->to,
-            'group' => $this->group,
-            'group-count' => empty($this->group) ? 0 : count(explode(',', $this->group)),
+                       'group' => $this->group,
+                       'group-count' => empty($this->group) ? 0 : count(explode(',', $this->group)),
                        'width' => round($this->width),
                        'height' => round($this->height),
-            'x' => round($this->left),
-            'y' => round($this->top)
+                       'x' => round($this->left),
+                       'y' => round($this->top)
                ];
 
                // Set data attributes
@@ -1603,15 +1606,15 @@ class zoomLink extends normalLink
 
        public function getClasses()
        {
-        // Assign CSS classes for all groups so we can match and group them via JS
-        $groups = explode(',', $this->group);
-        $group_classes = [];
+               // Assign CSS classes for all groups so we can match and group them via JS
+               $groups = explode(',', $this->group);
+               $group_classes = [];
 
-        foreach ($groups as $group) {
-            if (empty($group)) continue;
+               foreach ($groups as $group) {
+                       if (empty($group)) continue;
 
-            $group_classes[] = 'zoom-group-' . trim($group);
-        }
+                       $group_classes[] = 'zoom-group-' . trim($group);
+               }
 
                return array_merge($group_classes, ['zoomPopup'], parent::getClasses());
        }