From e88a29cd196a3b9ea112c1f04c76f47d26bd159c Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Wed, 3 Oct 2018 12:59:57 +0000 Subject: [PATCH] done #2285 @1 --- inc/ws/Controlleur/class.ws.url.php | 133 +++++----------------------- style/ws/style.css | 2 + 2 files changed, 23 insertions(+), 112 deletions(-) diff --git a/inc/ws/Controlleur/class.ws.url.php b/inc/ws/Controlleur/class.ws.url.php index c42836f17..01b2a442f 100644 --- a/inc/ws/Controlleur/class.ws.url.php +++ b/inc/ws/Controlleur/class.ws.url.php @@ -134,7 +134,22 @@ class wsUrl $res .= '' . $book->version . ''; } if ($book->version > 1 || $droits->admin) { - $res .= '' . $btVoir . ''; + $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 .= '' . $btVoir . ''; $res .= '' . $btEdit . ''; } else { $res .= ''; @@ -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 = '
'; $res .= '
'; @@ -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; diff --git a/style/ws/style.css b/style/ws/style.css index a2a6efe61..b3d0f51d8 100644 --- a/style/ws/style.css +++ b/style/ws/style.css @@ -626,6 +626,8 @@ input[type="text"], input[type="password"], input[type="email"], input[type="sea } /* Menu Contextuel */ + + .contextMenu { border: 1px solid #000; float: left; -- 2.39.5