From aabb096b9742ff94102d9345982c84af3e6bec45 Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Thu, 19 May 2016 14:03:51 +0000 Subject: [PATCH] done #423 @3 --- inc/ws/Controlleur/class.ws.url.php | 9 ++++----- inc/ws/DAO/class.ws.dao.book.php | 14 ++++++++++++++ 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/inc/ws/Controlleur/class.ws.url.php b/inc/ws/Controlleur/class.ws.url.php index 56fc76ed6..98fb9bd01 100644 --- a/inc/ws/Controlleur/class.ws.url.php +++ b/inc/ws/Controlleur/class.ws.url.php @@ -324,7 +324,7 @@ class wsUrl { $res .= ''; - if (!isset($collection->settings['perline']) || !$collection->settings['perline']) { + if (!isset($collection->settings['perline']) || !$collection->settings['perline']) { $collection->settings['perline'] = 3; } $res .= '

' . __('Thème') . '

'; @@ -1056,7 +1056,7 @@ html{height:100%}' . "\n"; $dao->compile($book_id, 'html5'); $time = self::getHTML5CacheTime($book_id); - if (count($e) == 2 || $e[2] != $time) { + if (count($e) == 2 || $e[2] <= $time - 10) { $e[2] = $time; http::redirect(SITE_PATH . 'viewerh/' . implode('_', $e) . '/index.html'); exit; @@ -1087,10 +1087,9 @@ html{height:100%}' . "\n"; $dao = new wsDAOBook($core->con); $e = explode('_', $args[0]); $dao->compile($e[0], 'html5'); - $time = self::getHTML5CacheTime($e[0]); - if (count($e) == 2 || $e[2] != $time) { - $e[2] = $time; + if (count($e) == 2 || $e[2] <= TIME - 15) { + $e[2] = TIME; http::redirect(SITE_PATH . 'viewerhu/' . implode('_', $e) . '/' . $args[1]); exit; } diff --git a/inc/ws/DAO/class.ws.dao.book.php b/inc/ws/DAO/class.ws.dao.book.php index 024ca9775..81e82654a 100644 --- a/inc/ws/DAO/class.ws.dao.book.php +++ b/inc/ws/DAO/class.ws.dao.book.php @@ -1186,8 +1186,11 @@ class wsDAOBook extends commonDAO { $daoDoc->getLinksAndRulers($book_id, $links, $rulers); + $audiodescription = array(); + $imagesassets = array(); $id = 1; + $ignoreLinks = array(); foreach ($links as $id => $link) { $links[$id]['id'] = $id; if ($link['type'] == 15) { @@ -1219,7 +1222,17 @@ class wsDAOBook extends commonDAO { } } } + + if ($link['type'] == 25) { + $audiodescription[$link['page']] = $link['to']; + $ignoreLinks[] = $id; + } + } + + foreach ($ignoreLinks as $ignoreLink) { + unset($links[$ignoreLink]); } + $links = array_values($links); $externalsOptions = array('ongletsSWF', 'tabs2DSWF', 'externalChapters', 'externalArchives', 'ambientSound'); foreach ($externalsOptions as $e) { @@ -1231,6 +1244,7 @@ class wsDAOBook extends commonDAO { } } + $flex->addVariable('audiodescription', $audiodescription, false, true, "JSONObject"); $flex->addVariable('links', $links, false, true, 'JSONObject'); $flex->addVariable('signature', $exportSignature, false, true, 'JSONObject'); -- 2.39.5