From b6249f73a4510c0138d6e46858286914445ec35a Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Mon, 11 Apr 2011 13:20:27 +0000 Subject: [PATCH] --- fluidbook/compile/_js/fluidbook.js | 9 +++++++++ inc/ws/Controlleur/class.ws.url.php | 20 ++++++++++++++++---- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/fluidbook/compile/_js/fluidbook.js b/fluidbook/compile/_js/fluidbook.js index 077303293..dd619994b 100644 --- a/fluidbook/compile/_js/fluidbook.js +++ b/fluidbook/compile/_js/fluidbook.js @@ -1,3 +1,12 @@ +function getWmode(){ + var ua=navigator.userAgent; + if(ua.search(/mac/i)>-1 && ua.search(/opera/i)>-1){ + return 'normal'; + }else{ + return 'direct'; + } +} + function getLocation(){ return window.location.toString(); } diff --git a/inc/ws/Controlleur/class.ws.url.php b/inc/ws/Controlleur/class.ws.url.php index 61986ff86..6d1b984a7 100644 --- a/inc/ws/Controlleur/class.ws.url.php +++ b/inc/ws/Controlleur/class.ws.url.php @@ -388,22 +388,26 @@ html{height:100%}' . "\n"; { $args = cubePage::getArgs($args); + $wmode = isset($args[1])?$args[1]:''; + $e = explode('_', $args[0]); if (count($e) == 2 || $e[2] < TIME-10) { $e[2] = TIME; - http::redirect(SITE_PATH . 'viewer/' . implode('_', $e) . '/'); + http::redirect(SITE_PATH . 'viewer/' . implode('_', $e) . '/' . $wmode); exit; } $book_id = $e[0]; + $wmode = $wmode != ''?$wmode:'default'; + self::checkDocumentVersionOfBook($book_id); wsSecureSWF::checkProtectedSWF(); - echo self::commonViewer($book_id, $e[1]); + echo self::commonViewer($book_id, $e[1], false, $wmode); } - public static function commonViewer($book_id, $hash, $standalone = false) + public static function commonViewer($book_id, $hash, $standalone = false, $wmode = 'default') { if (!defined('MINIMIZE_JS')) { define('MINIMIZE_JS', false); @@ -422,6 +426,8 @@ html{height:100%}' . "\n"; global $meta; global $jsvar; + cubePage::swfobject(2); + $dao = new wsDAOBook($core->con); $book = $dao->selectById($book_id); @@ -463,7 +469,13 @@ html{height:100%}' . "\n"; $res .= ''; $res .= ''; - $res .= cubeMedia::flash2('index.swf', '100%', '100%', $fv, 'fluidbook', '', 10, '#' . $theme->parametres->loadingBackColor, $alt, 'true', 'noscale', 'gpu', array('allowScriptAccess' => 'always')); + $res .= '
'; + $res .= ''; $js = array($webcompile . 'fluidbook.js'); $jsvar = array(); -- 2.39.5