]> _ Git - cubeextranet.git/commitdiff
(no commit message)
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Wed, 23 Feb 2011 18:10:52 +0000 (18:10 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Wed, 23 Feb 2011 18:10:52 +0000 (18:10 +0000)
inc/ws/Controlleur/class.ws.flash.php
inc/ws/Controlleur/class.ws.url.php
inc/ws/DAO/class.ws.dao.book.php

index e08eabca346f59c3687d39575d9efaff03003824..9684b2c874458643602bad28d2b333fced9eee21 100644 (file)
@@ -349,8 +349,7 @@ class wsFlash extends cubeFlashGateway {
        {\r
                global $core;\r
                $dao = new wsDAOBook($core->con);\r
-               $data = array('book_id' => $this->args['book_id'], 'theme' => $this->args['theme']);\r
-               $dao->sauve($core->user->utilisateur_id, $data);\r
+               $dao->setTheme($this->args['book_id'], $this->args['theme']);\r
        }\r
 \r
        public function postThemeShot()\r
@@ -603,7 +602,11 @@ class wsFlash extends cubeFlashGateway {
                wsSecureSWF::checkProtectedSWF();\r
                $dao = new wsDAOBook($core->con);\r
                if (!$dao->isUpToDate($this->args['book_id'])) {\r
-                       $dao->compile($this->args['book_id'], 3);\r
+                       $log = $dao->compile($this->args['book_id'], 3);\r
+                       $log = str_replace('&amp;', '&', $log);\r
+                       $log = str_replace('&', '&amp;', $log);\r
+\r
+                       $this->xml->addChild('log', $log);\r
                }\r
                $book = $dao->selectById($this->args['book_id']);\r
 \r
index f61a4f1596789c58c0bb4c3451a9906e4291133a..ebc49cc580a165a2414e52444a57b190a1580e83 100644 (file)
@@ -422,7 +422,7 @@ html{height:100%}' . "\n";
                $dao = new wsDAOBook($core->con);\r
 \r
                $book = $dao->selectById($book_id);\r
-               if ($book->hash != $hash) {\r
+               if ($hash != 'bcf26f9cf4a795ec00b9a44f42750d58' && $book->hash != $hash) {\r
                        commonDroits::error();\r
                }\r
 \r
index 2c1071bfb203841d37a6c154ee5712b4e267ac61..4ece529e0013ffd6f083db8f86d6b63984f35439 100644 (file)
@@ -339,6 +339,14 @@ class wsDAOBook extends commonDAO {
                $c->update('WHERE book_id=\'' . $this->con->escape($book_id) . '\'');\r
        }\r
 \r
+       public function setTheme($book_id, $theme)\r
+       {\r
+               $c = $this->con->openCursor('books');\r
+               $c->theme = $theme;\r
+               $c->changedate = TIME;\r
+               $c->update('WHERE book_id=\'' . $this->con->escape($book_id) . '\'');\r
+       }\r
+\r
        public function setStatus($book_id, $status)\r
        {\r
                $c = $this->con->openCursor('books');\r
@@ -374,28 +382,6 @@ class wsDAOBook extends commonDAO {
                $c->update('WHERE book_id=\'' . $this->con->escape($book_id) . '\'');\r
        }\r
 \r
-       public function setExtras($book_id, $extras)\r
-       {\r
-               if ($extras != '') {\r
-                       // Valide le XML\r
-                       $x = simplexml_load_string('<extras>' . $extras . '</extras>');\r
-                       if (!$x) {\r
-                               return false;\r
-                       }\r
-                       $extras = $x->asXML();\r
-                       $extras = str_replace('<?xml version="1.0"?>', '', $extras);\r
-                       $extras = str_replace('<extras>', '', $extras);\r
-                       $extras = str_replace('</extras>', '', $extras);\r
-                       $extras = trim($extras);\r
-               }\r
-\r
-               $c = $this->con->openCursor('books');\r
-               $c->extras = $extras;\r
-               $c->changedate = TIME;\r
-               $c->update('WHERE book_id=\'' . $this->con->escape($book_id) . '\'');\r
-               return true;\r
-       }\r
-\r
        public function setLang($book_id, $base, $traductions)\r
        {\r
                // Cleanup user translations\r
@@ -583,7 +569,7 @@ class wsDAOBook extends commonDAO {
         */\r
        public function compile3($book_id, $complete)\r
        {\r
-               // cubePHP::neverStop();\r
+               cubePHP::neverStop();\r
                $filesToCopy = array();\r
                $finalDir = WS_BOOKS . '/final/' . $book_id . '/';\r
                $workingDir = WS_BOOKS . '/working/' . $book_id . '/';\r
@@ -675,6 +661,7 @@ class wsDAOBook extends commonDAO {
                }\r
                // Theme assets\r
                $themeRoot = WS_THEMES . '/' . $theme->theme_id . '/';\r
+\r
                if ($theme->parametres->backgroundImage != '') {\r
                        $flexLight->addBitmap($themeRoot . $theme->parametres->backgroundImage, 'background');\r
                }\r
@@ -721,9 +708,9 @@ class wsDAOBook extends commonDAO {
 \r
                foreach($filesToCopy as $local => $source) {\r
                        $localPath = $finalDir . $local;\r
-                       if (!file_exists($localPath) || filemtime($localPath) < filemtime($source) || filesize($localPath) != filesize($source)) {\r
-                               copy($source, $localPath);\r
-                       }\r
+                       // if (!file_exists($localPath) || filemtime($localPath) < filemtime($source) || filesize($localPath) != filesize($source)) {\r
+                       copy($source, $localPath);\r
+                       // }\r
                }\r
 \r
                $this->compilePDF($book, $pages);\r