]> _ Git - cubeextranet.git/commitdiff
done #423 @3
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Thu, 19 May 2016 14:03:51 +0000 (14:03 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Thu, 19 May 2016 14:03:51 +0000 (14:03 +0000)
inc/ws/Controlleur/class.ws.url.php
inc/ws/DAO/class.ws.dao.book.php

index 56fc76ed6efa93f23f7524a17fb17c0f4c43714f..98fb9bd01cb2fe9aec0a69edb0d5035a6205e6a3 100644 (file)
@@ -324,7 +324,7 @@ class wsUrl {
                $res .= '</table>';
 
 
-               if (!isset($collection->settings['perline'])  || !$collection->settings['perline']) {
+               if (!isset($collection->settings['perline']) || !$collection->settings['perline']) {
                        $collection->settings['perline'] = 3;
                }
                $res .= '<h3>' . __('Thème') . '</h3>';
@@ -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;
                }
index 024ca97754444bab11395076c8cd751822af8806..81e82654af1777b312837c4ee5314b2cb7755e67 100644 (file)
@@ -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');