if (count($e) == 2 || $e[2] <= $time - 10) {
$e[2] = $time;
- http::redirect(SITE_PATH . 'viewerh/' . implode('_', $e) . '/index.html');
+ http::redirect(SITE_PATH . 'viewerh/' . implode('_', $e) . '/');
exit;
}
if (count($e) == 2 || $e[2] <= $time - 10) {
$e[2] = $time;
- http::redirect(SITE_PATH . 'viewers/' . implode('_', $e) . '/index.html');
+ http::redirect(SITE_PATH . 'viewers/' . implode('_', $e) . '/');
exit;
}
$book_id = $e[0];
$hash = $e[1];
- self::commonHTML5Viewer($book_id, $hash);
+ self::commonHTML5Viewer($book_id, $hash, '', ['<head>' => '<head><script type="text/javascript">var FORCE_SCORM=true;</script>']);
}
return TIME;
}
- public static function commonHTML5Viewer($book_id, $hash, $version = '')
+ public static function commonHTML5Viewer($book_id, $hash, $version = '', $replace = [])
{
global $core;
self::checkDocumentVersionOfBook($book_id);
$dao = new wsDAOBook($core->con);
-
$dir = '';
$book = $dao->selectById($book_id);
}
self::logReferer($book_id);
-
- echo file_get_contents(WS_BOOKS . '/html5' . $dir . '/' . $book_id . '/index' . $version . '.html');
-
+ $html = file_get_contents(WS_BOOKS . '/html5' . $dir . '/' . $book_id . '/index' . $version . '.html');
+ foreach ($replace as $from => $to) {
+ $html = str_replace($from, $to, $html);
+ }
+ echo $html;
exit;
}
{
$args = cubePage::getArgs($args);
-
$qs = '';
if (isset($_SERVER['QUERY_STRING']) && !empty($_SERVER['QUERY_STRING'])) {
$qs = '?' . $_SERVER['QUERY_STRING'];