}
if (count($e) == 2) {
$e[2] = $time;
- http::redirect(SITE_PATH . 'viewerh/' . implode('_', $e) . '/' . $q);
+ $daoTheme = new wsDAOTheme($core->con);
+ $theme = $daoTheme->getThemeOfBook($book_id, true);
+ self::loadingCompile(SITE_PATH . 'viewerh/' . implode('_', $e) . '/' . $q, $book, $theme);
+ //http::redirect(SITE_PATH . 'viewerh/' . implode('_', $e) . '/' . $q);
exit;
}
$CrawlerDetect = new Jaybizzle\CrawlerDetect\CrawlerDetect();
}
- public static function viewers($args)
+ public static function loadingCompile($url, $book, $theme)
{
- global $core;
-
- $args = cubePage::getArgs($args);
-
- $e = explode('_', $args[0]);
-
- $book_id = $e[0];
- $hash = $e[1];
-
- $dao = new wsDAOBook($core->con);
-
- $book = $dao->selectById($book_id);
- if ($hash != 'bcf26f9cf4a795ec00b9a44f42750d58' && $book->hash != $hash) {
- commonDroits::error();
- }
-
- if (!wsDroits::admin()) {
- if ($book->parametres->redirectDemo != '') {
- http::redirect($book->parametres->redirectDemo);
- exit;
- }
- if ($book->parametres->disableDemo) {
- commonDroits::error();
- }
- }
-
- $dao->compile($book_id, 'html5', false, false, false, $book);
- $time = TIME;
-
- if (count($e) == 2 || $e[2] <= $time - 10) {
- $e[2] = $time;
- http::redirect(SITE_PATH . 'viewers/' . implode('_', $e) . '/');
- exit;
- }
-
- $book_id = $e[0];
- $hash = $e[1];
- self::commonHTML5Viewer($book_id, $hash, '', ['<head>' => '<head><script type="text/javascript">var FORCE_SCORM=true;</script>']);
+ $res = '<html>';
+ $res .= '<head>';
+ $res .= '<link href="https://fonts.googleapis.com/css2?family=Open+Sans&display=swap" rel="stylesheet">';
+ $res .= '<style>
+@keyframes loader-spin {
+ 0% {
+ transform: rotate(0deg);
+ }
+ 100% {
+ transform: rotate(360deg);
+ }
+}
+*{margin:0;padding:0;}
+html,body{height:100%;cursor: wait;font-family: "Open Sans", Arial;background-color:#' . $theme->parametres->backgroundColor . ';}';
+ $res .= 'h2,h3{text-align:center;color:#' . $theme->parametres->couleurL . ';font-weight:400;position:relative;top:55%;}';
+ $res .= 'h2{font-size:16px;}';
+ $res .= 'h3{font-size:10px;}';
+ $res .= 'svg{position:absolute;top:calc(50% - 24px);left:calc(50% - 24px);
+ animation-name: loader-spin;
+ animation-duration: 1s;
+ animation-iteration-count: infinite;
+ animation-timing-function: linear;}';
+ $res .= '</style>';
+ $res .= '</head>';
+ $res .= '<body onload="window.location=\'' . $url . '\';">';
+ $res .= '<svg width="48" height="48" id="interface-loader" viewBox="0 0 48 48">
+ <circle cx="24" cy="24" r="23" fill="#' . $theme->parametres->couleurL . '"></circle>
+ <circle class="animate" cx="24" cy="24" fill="none" stroke="#' . $theme->parametres->loadingSecColor . '" stroke-width="3" r="16"
+ stroke-dasharray="80 80"
+ transform="rotate(0 24 24)">
+ </circle>
+ </svg>';
+ $res .= '<h2>' . __('Compilation du fluidbook en cours') . '...</h2>';
+ $res .= '<h3>' . __('Cette étape ne sera pas nécessaire lorsque le fluidbook sera installé installé sur son emplacement définitif') . '</h3>';
+ $res .= '</body>';
+ $res .= '</html>';
+ echo $res;
}
public static function commonHTML5Viewer($book_id, $hash, $version = '', $replace = [])