]> _ Git - cubeextranet.git/commitdiff
done #2285 @1
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Wed, 3 Oct 2018 12:59:57 +0000 (12:59 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Wed, 3 Oct 2018 12:59:57 +0000 (12:59 +0000)
inc/ws/Controlleur/class.ws.url.php
style/ws/style.css

index c42836f174372521af10790b8f7ddf22aa88df13..01b2a442f7e47f605426e52c9e174db2bb9cf32a 100644 (file)
@@ -134,7 +134,22 @@ class wsUrl
                                $res .= '<td>' . $book->version . '</td>';
                        }
                        if ($book->version > 1 || $droits->admin) {
-                               $res .= '<td class="bouton"><a href="/viewer/' . $book->book_id . '_' . $book->hash . '/" class="openContextMenu voir btbook" rel="' . $context_view_id . '" rev="' . $book->book_id . '§' . $book->hash . '§' . TIME . '">' . $btVoir . '</a></td>';
+                               $types = [];
+                               if (!$book->parametres->scorm_enable && !$book->parametres->alwaysHTML5) {
+                                       $types[] = 'flash';
+                                       $defaultPlayer = 'viewer';
+                               } else {
+                                       $defaultPlayer = 'viewerh';
+                               }
+                               if ($book->parametres->mobileVersion != 'pdf') {
+                                       $types[] = 'html5';
+                               }
+                               if ($book->parametres->scorm_enable) {
+                                       $types[] = 'scorm';
+                               }
+
+
+                               $res .= '<td class="bouton"><a href="/' . $defaultPlayer . '/' . $book->book_id . '_' . $book->hash . '/" class="openContextMenu voir btbook" data-type="' . implode(',', $types) . '" rel="' . $context_view_id . '" rev="' . $book->book_id . '§' . $book->hash . '§' . TIME . '">' . $btVoir . '</a></td>';
                                $res .= '<td class="bouton"><a class="popupFSBar edit btbook" rel="toolbar=yes" rev="editor_' . $book->book_id . '" href="' . SITE_PATH . 'editor/' . $book->book_id . '_' . $book->hash . '">' . $btEdit . '</a></td>';
                        } else {
                                $res .= '<td></td><td></td>';
@@ -614,20 +629,10 @@ class wsUrl
        {
                global $core;
 
-               if (wsDroits::admin()) {
-                       $viewers = array(array('version' => 'viewer', 'title' => __('Version Flash'), 'icon' => cubeMedia::image(IMG . '/flash.png')),
-                               array('version' => 'viewerh', 'title' => __('Version HTML5'), 'icon' => cubeMedia::image(IMG . '/html5.png')),
-                               array('version' => 'vieweru', 'title' => __('Version Flash') . ' (' . __('debuggage') . ')', 'icon' => cubeMedia::image(IMG . '/flashbug.png')),
-                               array('version' => 'viewerhu', 'title' => __('Version HTML5') . ' (' . __('debuggage') . ')', 'icon' => cubeMedia::image(IMG . '/html5bug.png')),
-                               //array('version' => 'viewerhu', 'title' => __('Widget HTML5'), 'icon' => cubeMedia::image(IMG . '/html5bug.png'), 'file' => 'widget.html', 'pattern' => '$1_$2_$3'),
-                               array('version' => 'viewer1', 'title' => __('Version 1'), 'icon' => cubeMedia::image(IMG . '/flash.png'))
-                       );
-               } else {
-                       $viewers = array(array('version' => 'viewer', 'title' => __('Version Flash'), 'icon' => cubeMedia::image(IMG . '/flash.png')),
-                               array('version' => 'viewerh', 'title' => __('Version HTML5'), 'icon' => cubeMedia::image(IMG . '/html5.png'))
-                       );
-
-               }
+               $viewers = array(array('type' => 'flash', 'version' => 'viewer', 'title' => __('Version Flash'), 'icon' => cubeMedia::image(IMG . '/flash.png')),
+                       array('type' => 'html5', 'version' => 'viewerh', 'title' => __('Version HTML5'), 'icon' => cubeMedia::image(IMG . '/html5.png')),
+                       array('type' => 'scorm', 'version' => 'viewers', 'title' => __('Version SCORM'), 'icon' => cubeMedia::image(IMG . '/html5.png')),
+               );
 
                $res = '<div class="contextMenu viewbookContextMenu" id="' . $id . '">';
                $res .= '<ul>';
@@ -640,7 +645,7 @@ class wsUrl
                                if (!isset($infos['pattern'])) {
                                        $infos['pattern'] = '$1_$2';
                                }
-                               $res .= '<li><a class="popupFSBar" rel="toolbar=1,scrollbars=1" rev="' . $infos['version'] . '_$1" href="' . SITE_PATH . $infos['version'] . '/' . $infos['pattern'] . '/' . $infos['file'] . '">' . $infos['icon'] . $infos['title'] . '</a></li>';
+                               $res .= '<li data-type="' . $infos['type'] . '"><a class="popupFSBar" rel="toolbar=1,scrollbars=1" rev="' . $infos['version'] . '_$1" href="' . SITE_PATH . $infos['version'] . '/' . $infos['pattern'] . '/' . $infos['file'] . '">' . $infos['icon'] . $infos['title'] . '</a></li>';
                        }
                }
                $res .= '</ul></div>';
@@ -1054,31 +1059,6 @@ html{height:100%}' . "\n";
                echo self::commonViewer($book_id, $e[1], true);
        }
 
-       public static function vieweru($args)
-       {
-               commonDroits::min(5);
-
-               $args = cubePage::getArgs($args);
-
-               $qs = '';
-               if (isset($_SERVER['QUERY_STRING']) && !empty($_SERVER['QUERY_STRING'])) {
-                       $qs = '?' . $_SERVER['QUERY_STRING'];
-               }
-
-               $e = explode('_', $args[0]);
-               if (count($e) == 2 || $e[2] < TIME - 10) {
-                       $e[2] = TIME;
-                       http::redirect(SITE_PATH . 'vieweru/' . implode('_', $e) . '/' . $qs);
-                       exit;
-               }
-
-               $book_id = $e[0];
-
-               self::checkDocumentVersionOfBook($book_id);
-
-               echo self::commonViewer($book_id, $e[1], false, 'default', true);
-       }
-
        public static function viewerh($args)
        {
                global $core;
@@ -1130,77 +1110,6 @@ html{height:100%}' . "\n";
                return TIME;
        }
 
-       public static function viewerhu($args)
-       {
-               global $core;
-
-               commonDroits::min(5);
-               $args = cubePage::getArgs($args);
-               if (!isset($args[1])) {
-                       $args[1] = '';
-               }
-
-               $dao = new wsDAOBook($core->con);
-               $e = explode('_', $args[0]);
-
-               if (count($e) == 2 || $e[2] <= TIME - 15) {
-                       $e[2] = TIME;
-                       http::redirect(SITE_PATH . 'viewerhu/' . implode('_', $e) . '/' . $args[1]);
-                       exit;
-               }
-
-               $book_id = $e[0];
-               $dao->compile($e[0], 'html5', false, true, true);
-               $hash = $e[1];
-               self::commonHTML5Viewer($book_id, $hash, 'u');
-       }
-
-       public static function viewerha($args)
-       {
-               global $core;
-
-
-               $args = cubePage::getArgs($args);
-               if (!isset($args[1])) {
-                       $args[1] = '';
-               }
-
-               $dao = new wsDAOBook($core->con);
-               $e = explode('_', $args[0]);
-               $dao->compileTemp($e[0], 'ha', WS_BOOKS . '/html5a/' . $e[0]);
-               $time = time();
-
-               if (count($e) == 2 || $e[2] < $time - 20) {
-                       $e[2] = $time;
-                       http::redirect(SITE_PATH . 'viewerha/' . implode('_', $e) . '/' . $args[1]);
-                       exit;
-               }
-
-               $book_id = $e[0];
-               $hash = $e[1];
-               self::commonHTML5Viewer($book_id, $hash, 'a');
-       }
-
-       public static function viewerht($args)
-       {
-               commonDroits::min(5);
-               $args = cubePage::getArgs($args);
-
-               $e = explode('_', $args[0]);
-               $dao->compile($e[0], 'html5');
-               $time = self::getHTML5CacheTime($e[0]);
-
-               if (count($e) == 2 || $e[2] != $time) {
-                       $e[2] = $time;
-                       http::redirect(SITE_PATH . 'viewerht/' . implode('_', $e) . '/');
-                       exit;
-               }
-
-               $book_id = $e[0];
-               $hash = $e[1];
-               self::commonHTML5Viewer($book_id, $hash, 't');
-       }
-
        public static function commonHTML5Viewer($book_id, $hash, $version = '')
        {
                global $core;
index a2a6efe612a8a9c58c28459c9ed47fd5a7dbc62d..b3d0f51d885299e804035dc22d0ed3198ef713ee 100644 (file)
@@ -626,6 +626,8 @@ input[type="text"], input[type="password"], input[type="email"], input[type="sea
 }\r
 \r
 /* Menu Contextuel */\r
+\r
+\r
 .contextMenu {\r
        border: 1px solid #000;\r
        float: left;\r