]> _ Git - cubeextranet.git/commitdiff
wait #4021 @0.75
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Fri, 30 Oct 2020 18:39:42 +0000 (18:39 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Fri, 30 Oct 2020 18:39:42 +0000 (18:39 +0000)
inc/ws/Controlleur/class.ws.url.php

index 2fa4afcc76fc6cde071d1e6eb1528627fc23e64b..930bdb4869bfc5cdd5298aa0c428708ec8adfb9c 100644 (file)
@@ -1123,7 +1123,10 @@ html.tall{height:150%}' . "\n";
         }
         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();
@@ -1139,46 +1142,45 @@ html.tall{height:150%}' . "\n";
     }
 
 
-    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 = [])