]> _ Git - cubeextranet.git/commitdiff
fix #2584 @5
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Wed, 6 Feb 2019 16:38:06 +0000 (16:38 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Wed, 6 Feb 2019 16:38:06 +0000 (16:38 +0000)
inc/ws/Controlleur/class.ws.flash.php
inc/ws/DAO/class.ws.dao.book.php
inc/ws/DAO/class.ws.dao.document.php

index 21573451b687f1ac2eacf9214c012d8c02071351..ece710c01d3415ec8276da9138fca584147a3711 100644 (file)
@@ -658,11 +658,11 @@ class wsFlash extends cubeFlashGateway
                if ($p->$param != '') {
                        if ($specialName != 'archives') {
                                $themeRoot = WS_THEMES . '/' . $theme->theme_id . '/';
-                               $dim = getimagesize($themeRoot . $p->$param);
+                               $dim = CubeIT_Image::getimagesize($themeRoot . $p->$param);
                                $url = 'https://' . $_SERVER['HTTP_HOST'] . WEBROOT . '/fluidbook/themes/' . $theme->theme_id . '/' . $p->$param;
                        } else {
                                $bookRoot = WS_BOOKS . '/working/' . $book->book_id . '/';
-                               $dim = getimagesize($bookRoot . $p->$param);
+                               $dim = CubeIT_Image::getimagesize($bookRoot . $p->$param);
                                $url = 'https://' . $_SERVER['HTTP_HOST'] . WEBROOT . '/fluidbook/books/working/' . $book->book_id . '/' . $p->$param;
                        }
 
@@ -682,10 +682,12 @@ class wsFlash extends cubeFlashGateway
        {
                global $core;
 
+               $this->outputXML = false;
+
                $comments = isset($this->args['comments']) ? $this->args['comments'] : 'Saved from editor';
 
                $dao = new wsDAODocument($core->con);
-               $dao->setLinksAndRulers($this->args['book_id'], $this->args['links'], $this->args['rulers'], $comments, $core->user->utilisateur_id);
+               $dao->setLinksAndRulers($this->args['book_id'], $this->args['links'], $this->args['rulers'], $comments, $core->user->utilisateur_id, false);
 
                $daoBook = new wsDAOBook($core->con);
                $daoBook->setSpecialLinksAndRulers($this->args['book_id'], $this->args['specialLinks'], $this->args['specialRulers']);
index 3c9165517c5381fadfb0ac2b6b4025f6b953a69e..cf7049df0576c39b8d333818ecd4c42638a3b465 100644 (file)
@@ -615,7 +615,13 @@ class wsDAOBook extends commonDAO
                        $rulers = json_encode(json_decode($rulers, false));
                }
 
-               $links = wsLinks::encryptLinks($links);
+
+               echo '1 : ' . print_r($links) . "<br>";
+
+               $links = wsLinks::encryptLinks(json_decode($links));
+
+               echo '2 : ' . print_r($links) . "<br>";
+
 
                if (is_array($links)) {
                        $links = json_encode($links);
@@ -624,6 +630,7 @@ class wsDAOBook extends commonDAO
                        $rulers = json_encode($rulers);
                }
 
+               echo '3 : ' . $links . "<br>";
 
                $c1->links = $c->specialLinks = $links;
                $c1->rulers = $c->specialRulers = $rulers;
index 64cb80e0bcefeedb94ba75ea8c6185a1efab7f8e..d65454a4e65eb71ea149f820a764fcbcd7d895cf 100644 (file)
@@ -116,7 +116,7 @@ class wsDAODocument extends commonDAO
                return implode("\n", $log);
        }
 
-       public function setLinksAndRulers($book_id, $links, $rulers, $comments = '', $user = 0)
+       public function setLinksAndRulers($book_id, $links, $rulers, $comments = '', $user = 0, $handleSpecials = true)
        {
                $daoBook = new wsDAOBook($this->con);
                $pages = $daoBook->getPagesOfBook($book_id, false);
@@ -167,7 +167,7 @@ class wsDAODocument extends commonDAO
                $specialRulers = array();
 
                foreach ($t as $page => $tt) {
-                       if (!is_int($page)) {
+                       if (!is_int($page) && $handleSpecials) {
                                if (isset($tt['links'])) {
                                        $specialLinks = array_merge($specialLinks, $tt['links']);
                                }
@@ -202,7 +202,9 @@ class wsDAODocument extends commonDAO
                foreach ($links as $document_id => $dummy) {
                        wsLinks::setDocumentLinks($document_id, json_encode($links[$document_id]), json_encode($rulers[$document_id]), $user, $comments, TIME);
                }
-               $daoBook->setSpecialLinksAndRulers($book_id, $specialLinks, $specialRulers);
+               if ($handleSpecials) {
+                       $daoBook->setSpecialLinksAndRulers($book_id, $specialLinks, $specialRulers);
+               }
 
                $c = $this->con->openCursor('books');
                $c->changedate = TIME;