$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>';
{
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>';
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>';
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;
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;