]> _ Git - cubeextranet.git/commitdiff
wip #4927 @0.5
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Mon, 29 Nov 2021 16:46:30 +0000 (16:46 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Mon, 29 Nov 2021 16:46:30 +0000 (16:46 +0000)
inc/ws/Controlleur/class.ws.url.php

index 72af827e041d5e785d123b00f673aa6e89d8f26b..cb7d64b9c7c5018c4e935e0dbffa950819469aeb 100644 (file)
@@ -987,7 +987,13 @@ html.tall{height:150%}' . "\n";
         return wsStats::display($bid . '_' . $hash, $annee, $mois);
     }
 
-    public static function viewerh($args)
+    public static function viewers($args)
+    {
+
+        self::viewerh($args, 's');
+    }
+
+    public static function viewerh($args, $v = 'h')
     {
         global $core;
 
@@ -1050,20 +1056,30 @@ html.tall{height:150%}' . "\n";
             } else {
                 $theme = $daoTheme->getThemeOfBook($book_id, true);
             }
-            self::loadingCompile(SITE_PATH . 'viewerh/' . implode('_', $e) . '/' . $q, $book, $theme);
+            self::loadingCompile(SITE_PATH . 'viewer' . $v . '/' . implode('_', $e) . '/' . $q, $book, $theme);
             exit;
         }
+
+        if ($v === 'h') {
+            $fbv = 'html5';
+        } else if ($v === 's') {
+            $fbv = 'scorm';
+        }
+
         $CrawlerDetect = new Jaybizzle\CrawlerDetect\CrawlerDetect();
         if (!isset($_GET['force']) && !$nointerface && !$CrawlerDetect->isCrawler()) {
-            $book->parametres->scorm_enable = false;
-            $dao->compile($book_id, 'html5', false, false, false, $book, false, $forceTheme);
+            if($fbv!=='scorm') {
+                $book->parametres->scorm_enable = false;
+            }
+
+            $dao->compile($book_id, $fbv, false, false, false, $book, false, $forceTheme);
             wsMaintenance::_socialImage($book->cid);
         }
 
         $book_id = $e[0];
         $hash = $e[1];
 
-        self::commonHTML5Viewer($book_id, $hash, '', [], $forceTheme);
+        self::commonHTML5Viewer($book_id, $hash, $fbv, [], $forceTheme);
     }
 
 
@@ -1158,19 +1174,18 @@ html,body{height:100%;cursor: wait;font-family: "Open Sans", Arial;background-co
         if (!$forceTheme) {
             self::logReferer($book_id);
         }
-        $htmlFile = WS_BOOKS . '/html5' . $dir . '/' . $id . '/index' . $version . '.html';
+        $htmlFile = WS_BOOKS . '/html5' . $dir . '/' . $id . '/index.html';
         $html = '';
         if (file_exists($htmlFile)) {
             $html = file_get_contents($htmlFile);
         } else {
-            $dao->compile($book_id, 'html5', false, false, false, $book, false, $forceTheme);
+            $dao->compile($book_id, $version, false, false, false, $book, false, $forceTheme);
             $html = file_get_contents($htmlFile);
         }
         foreach ($replace as $from => $to) {
             $html = str_replace($from, $to, $html);
         }
 
-
         echo $html;
         exit;
     }