]> _ Git - cubeextranet.git/commitdiff
(no commit message)
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 22 Jun 2010 16:22:28 +0000 (16:22 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 22 Jun 2010 16:22:28 +0000 (16:22 +0000)
inc/extranet/Controlleur/class.extranet.core.php
inc/ws/Controlleur/class.ws.flash.php
inc/ws/DAO/class.ws.dao.book.php
inc/ws/Metier/class.ws.book.php
swf/_src/wsComposer.fla

index ae7ecd33398a6b85eef5f9e686887f4e9c78454b..a209563c9abbb13b9c2c586cc9f9b0f156b2535a 100644 (file)
@@ -342,6 +342,7 @@ class extranetCore extends cubeCore {
                $db->books->chapters('text', 0, false);\r
                $db->books->links('text', 0, false);\r
                $db->books->rulers('text', 0, false);\r
+               $db->books->extras('text',0,false);\r
                $db->books->date('integer', 0, false);\r
                // Clés\r
                $db->books->primary('pk_books', 'book_id');\r
index 9baa625a0f9306707b0add7a21fd8aa4b1009d17..5bf337a62bbdf346270c0225117a5fa0b5ce53ea 100644 (file)
@@ -334,7 +334,6 @@ class wsFlash extends cubeFlashGateway {
                $this->xml->addChild('width', $size[0]);\r
                $this->xml->addChild('height', $size[1]);\r
                $this->xml->addChild('rulers', json_encode($book->rulers));\r
-               fb($book->links);\r
        }\r
 \r
        public function saveLinks()\r
@@ -352,6 +351,21 @@ class wsFlash extends cubeFlashGateway {
                return $str;\r
        }\r
 \r
+       public function getExtras()\r
+       {\r
+               global $core;\r
+               $dao = new wsDAOBook($core->con);\r
+               $book = $dao->selectById($this->args['book_id']);\r
+               $this->xml->addChild('extras', htmlspecialchars(cubeXML::tidy($book->extras->asXML())));\r
+       }\r
+\r
+       public function saveExtras()\r
+       {\r
+               global $core;\r
+               $dao = new wsDAOBook($core->con);\r
+               $dao->setExtras($this->args['book_id'], $this->args['extras']);\r
+       }\r
+\r
        public function getBookInfos()\r
        {\r
                global $core;\r
index a6307ad1f6d1bbef4b0fd00b291953c7c638dc57..9858c1123c987c8a3a25d07a081e91cb919c3004 100644 (file)
@@ -22,6 +22,11 @@ class wsDAOBook extends extranetDAO {
                } else {\r
                        $book->chapters = json_decode($r->chapters, false);\r
                }\r
+               if ($r->extras == '') {\r
+                       $book->extras = simplexml_load_string('<?xml version="1.0" encoding="UTF-8" ?><extras />');\r
+               } else {\r
+                       $book->extras = simplexml_load_string('<?xml version="1.0" encoding="UTF-8" ?><extras>' . $r->extras . '</extras>');\r
+               }\r
 \r
                if ($r->links == '') {\r
                        $book->links = $this->getLinksFromCSV($r->book_id);\r
@@ -29,7 +34,7 @@ class wsDAOBook extends extranetDAO {
                        $book->links = json_decode($r->links, false);\r
                }\r
 \r
-               if ($r->rulers = '') {\r
+               if ($r->rulers == '') {\r
                        $book->rulers = array();\r
                } else {\r
                        $book->rulers = json_decode($r->rulers, false);\r
@@ -269,6 +274,13 @@ class wsDAOBook extends extranetDAO {
                $c->update('WHERE book_id=\'' . $this->con->escape($book_id) . '\'');\r
        }\r
 \r
+       public function setExtras($book_id, $extras)\r
+       {\r
+               $c = $this->con->openCursor('books');\r
+               $c->extras = $extras;\r
+               $c->update('WHERE book_id=\'' . $this->con->escape($book_id) . '\'');\r
+       }\r
+\r
        public function getLinksFromCSV($book_id)\r
        {\r
                $booleans = array('video_loop', 'video_auto_start', 'video_controls', 'video_sound_on');\r
index 3b88d422d4e5722e6bed4a513dfd7317a680f081..de4b232481ed7eb53248bb685079e4cfaec42283 100644 (file)
@@ -28,6 +28,7 @@ class wsBook extends cubeMetier {
        protected $chapters;\r
        protected $links;\r
        protected $rulers;\r
+       protected $extras;\r
 }\r
 \r
 ?>
\ No newline at end of file
index 1e74cfa6751e01d8e2a7c6e3c5910f22a35b35ed..815297249cfee213beaf92c471309fd162508d2b 100644 (file)
Binary files a/swf/_src/wsComposer.fla and b/swf/_src/wsComposer.fla differ