From: vincent@cubedesigners.com Date: Mon, 29 Nov 2021 16:46:30 +0000 (+0000) Subject: wip #4927 @0.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=b60641c9cc619aa7467d58a96015d8596effef15;p=cubeextranet.git wip #4927 @0.5 --- diff --git a/inc/ws/Controlleur/class.ws.url.php b/inc/ws/Controlleur/class.ws.url.php index 72af827e0..cb7d64b9c 100644 --- a/inc/ws/Controlleur/class.ws.url.php +++ b/inc/ws/Controlleur/class.ws.url.php @@ -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; }