]> _ Git - cubeextranet.git/commitdiff
(no commit message)
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 22 Jun 2010 12:40:52 +0000 (12:40 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 22 Jun 2010 12:40:52 +0000 (12:40 +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 55a0e7bb1e8e0dc25e724cfe569062428b981e41..ae7ecd33398a6b85eef5f9e686887f4e9c78454b 100644 (file)
@@ -339,8 +339,9 @@ class extranetCore extends cubeCore {
                $db->books->status('integer', 0, false);\r
                $db->books->date_status('integer', 0, false);\r
                $db->books->parametres('text', 0, false);\r
-               $db->books->chapters('text',0,false);\r
-               $db->books->links('text',0,false);\r
+               $db->books->chapters('text', 0, false);\r
+               $db->books->links('text', 0, false);\r
+               $db->books->rulers('text', 0, false);\r
                $db->books->date('integer', 0, false);\r
                // Clés\r
                $db->books->primary('pk_books', 'book_id');\r
index 2d04cf3ceb72db4d4726c511dfacd19a293b444d..9baa625a0f9306707b0add7a21fd8aa4b1009d17 100644 (file)
@@ -60,8 +60,8 @@ class wsFlash extends cubeFlashGateway {
                        }\r
                        $fname = cubeFiles::tidyName($infos['name']);\r
                        $dir = '/books/working/' . $this->args['book_id'] . '/' ;\r
-                       if (!file_exists(ROOT.$dir)) {\r
-                               mkdir(ROOT.$dir, 0777, true);\r
+                       if (!file_exists(ROOT . $dir)) {\r
+                               mkdir(ROOT . $dir, 0777, true);\r
                        }\r
                        $dest = $dir . $fname;\r
                        move_uploaded_file($infos['tmp_name'], ROOT . $dest);\r
@@ -333,9 +333,17 @@ class wsFlash extends cubeFlashGateway {
 \r
                $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
+       {\r
+               global $core;\r
+               $dao = new wsDAOBook($core->con);\r
+               $dao->setLinksAndRulers($this->args['book_id'], $this->args['links'], $this->args['rulers']);\r
+       }\r
+\r
        public function formatSize($val)\r
        {\r
                $str = files::size($val);\r
index 9fab5d2d980b8243422a38ccb39f15fdd6bd401b..a6307ad1f6d1bbef4b0fd00b291953c7c638dc57 100644 (file)
@@ -29,6 +29,12 @@ class wsDAOBook extends extranetDAO {
                        $book->links = json_decode($r->links, false);\r
                }\r
 \r
+               if ($r->rulers = '') {\r
+                       $book->rulers = array();\r
+               } else {\r
+                       $book->rulers = json_decode($r->rulers, false);\r
+               }\r
+\r
                $p = unserialize($r->parametres);\r
                if (!$p || $p->isEmpty()) {\r
                        $p = new wsBookParametres($book);\r
@@ -255,8 +261,17 @@ class wsDAOBook extends extranetDAO {
                $c->update('WHERE book_id=\'' . $this->con->escape($book_id) . '\'');\r
        }\r
 \r
+       public function setLinksAndRulers($book_id, $links, $rulers)\r
+       {\r
+               $c = $this->con->openCursor('books');\r
+               $c->links = json_encode(json_decode($links, false));\r
+               $c->rulers = json_encode(json_decode($rulers, false));\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
                $pages = $this->getPagesOfBook($book_id);\r
                $res = array();\r
                foreach($pages as $page => $p) {\r
@@ -274,11 +289,15 @@ class wsDAOBook extends extranetDAO {
                                        continue;\r
                                }\r
                                $link = array();\r
-                               $cols = array('page' => '', 'type' => '', 'to' => '','left'=>'', 'top' => '', 'width' => '', 'height' => '', 'target' => '_blank', 'video_loop' => '1', 'video_auto_start' => '1', 'video_controls' => '1', 'video_sound_on' => '1');\r
+                               $cols = array('page' => '', 'type' => '', 'to' => '', 'left' => '', 'top' => '', 'width' => '', 'height' => '', 'target' => '_blank', 'video_loop' => true, 'video_auto_start' => true, 'video_controls' => true, 'video_sound_on' => true);\r
                                $k = 0;\r
                                foreach($cols as $col => $default) {\r
                                        if (isset($line[$k])) {\r
-                                               $link[$col] = $line[$k];\r
+                                               if (in_array($k, $booleans)) {\r
+                                                       $link[$col] = ($line[$k] == '1');\r
+                                               } else {\r
+                                                       $link[$col] = $line[$k];\r
+                                               }\r
                                        } else {\r
                                                $link[$col] = $default;\r
                                        }\r
index 5ca097864256f08db03e5492035963851fe5ef29..3b88d422d4e5722e6bed4a513dfd7317a680f081 100644 (file)
@@ -27,6 +27,7 @@ class wsBook extends cubeMetier {
 \r
        protected $chapters;\r
        protected $links;\r
+       protected $rulers;\r
 }\r
 \r
 ?>
\ No newline at end of file
index da95cbb3847dfd3ebec1ba017b03c3b1636c2740..9fdbc363a9c10a210a87e944283002016cc08ed0 100644 (file)
Binary files a/swf/_src/wsComposer.fla and b/swf/_src/wsComposer.fla differ