From: vincent@cubedesigners.com Date: Tue, 22 Jun 2010 16:22:28 +0000 (+0000) Subject: (no commit message) X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=dc3ca9f9364ea5055e908d63e7a2bbb9b14a2f6f;p=cubeextranet.git --- diff --git a/inc/extranet/Controlleur/class.extranet.core.php b/inc/extranet/Controlleur/class.extranet.core.php index ae7ecd333..a209563c9 100644 --- a/inc/extranet/Controlleur/class.extranet.core.php +++ b/inc/extranet/Controlleur/class.extranet.core.php @@ -342,6 +342,7 @@ class extranetCore extends cubeCore { $db->books->chapters('text', 0, false); $db->books->links('text', 0, false); $db->books->rulers('text', 0, false); + $db->books->extras('text',0,false); $db->books->date('integer', 0, false); // Clés $db->books->primary('pk_books', 'book_id'); diff --git a/inc/ws/Controlleur/class.ws.flash.php b/inc/ws/Controlleur/class.ws.flash.php index 9baa625a0..5bf337a62 100644 --- a/inc/ws/Controlleur/class.ws.flash.php +++ b/inc/ws/Controlleur/class.ws.flash.php @@ -334,7 +334,6 @@ class wsFlash extends cubeFlashGateway { $this->xml->addChild('width', $size[0]); $this->xml->addChild('height', $size[1]); $this->xml->addChild('rulers', json_encode($book->rulers)); - fb($book->links); } public function saveLinks() @@ -352,6 +351,21 @@ class wsFlash extends cubeFlashGateway { return $str; } + public function getExtras() + { + global $core; + $dao = new wsDAOBook($core->con); + $book = $dao->selectById($this->args['book_id']); + $this->xml->addChild('extras', htmlspecialchars(cubeXML::tidy($book->extras->asXML()))); + } + + public function saveExtras() + { + global $core; + $dao = new wsDAOBook($core->con); + $dao->setExtras($this->args['book_id'], $this->args['extras']); + } + public function getBookInfos() { global $core; diff --git a/inc/ws/DAO/class.ws.dao.book.php b/inc/ws/DAO/class.ws.dao.book.php index a6307ad1f..9858c1123 100644 --- a/inc/ws/DAO/class.ws.dao.book.php +++ b/inc/ws/DAO/class.ws.dao.book.php @@ -22,6 +22,11 @@ class wsDAOBook extends extranetDAO { } else { $book->chapters = json_decode($r->chapters, false); } + if ($r->extras == '') { + $book->extras = simplexml_load_string(''); + } else { + $book->extras = simplexml_load_string('' . $r->extras . ''); + } if ($r->links == '') { $book->links = $this->getLinksFromCSV($r->book_id); @@ -29,7 +34,7 @@ class wsDAOBook extends extranetDAO { $book->links = json_decode($r->links, false); } - if ($r->rulers = '') { + if ($r->rulers == '') { $book->rulers = array(); } else { $book->rulers = json_decode($r->rulers, false); @@ -269,6 +274,13 @@ class wsDAOBook extends extranetDAO { $c->update('WHERE book_id=\'' . $this->con->escape($book_id) . '\''); } + public function setExtras($book_id, $extras) + { + $c = $this->con->openCursor('books'); + $c->extras = $extras; + $c->update('WHERE book_id=\'' . $this->con->escape($book_id) . '\''); + } + public function getLinksFromCSV($book_id) { $booleans = array('video_loop', 'video_auto_start', 'video_controls', 'video_sound_on'); diff --git a/inc/ws/Metier/class.ws.book.php b/inc/ws/Metier/class.ws.book.php index 3b88d422d..de4b23248 100644 --- a/inc/ws/Metier/class.ws.book.php +++ b/inc/ws/Metier/class.ws.book.php @@ -28,6 +28,7 @@ class wsBook extends cubeMetier { protected $chapters; protected $links; protected $rulers; + protected $extras; } ?> \ No newline at end of file diff --git a/swf/_src/wsComposer.fla b/swf/_src/wsComposer.fla index 1e74cfa67..815297249 100644 Binary files a/swf/_src/wsComposer.fla and b/swf/_src/wsComposer.fla differ