From: vincent@cubedesigners.com Date: Tue, 22 Jun 2010 12:40:52 +0000 (+0000) Subject: (no commit message) X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=691d8fa3ee782a6b8667859f17689e42ed44edfd;p=cubeextranet.git --- diff --git a/inc/extranet/Controlleur/class.extranet.core.php b/inc/extranet/Controlleur/class.extranet.core.php index 55a0e7bb1..ae7ecd333 100644 --- a/inc/extranet/Controlleur/class.extranet.core.php +++ b/inc/extranet/Controlleur/class.extranet.core.php @@ -339,8 +339,9 @@ class extranetCore extends cubeCore { $db->books->status('integer', 0, false); $db->books->date_status('integer', 0, false); $db->books->parametres('text', 0, false); - $db->books->chapters('text',0,false); - $db->books->links('text',0,false); + $db->books->chapters('text', 0, false); + $db->books->links('text', 0, false); + $db->books->rulers('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 2d04cf3ce..9baa625a0 100644 --- a/inc/ws/Controlleur/class.ws.flash.php +++ b/inc/ws/Controlleur/class.ws.flash.php @@ -60,8 +60,8 @@ class wsFlash extends cubeFlashGateway { } $fname = cubeFiles::tidyName($infos['name']); $dir = '/books/working/' . $this->args['book_id'] . '/' ; - if (!file_exists(ROOT.$dir)) { - mkdir(ROOT.$dir, 0777, true); + if (!file_exists(ROOT . $dir)) { + mkdir(ROOT . $dir, 0777, true); } $dest = $dir . $fname; move_uploaded_file($infos['tmp_name'], ROOT . $dest); @@ -333,9 +333,17 @@ 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() + { + global $core; + $dao = new wsDAOBook($core->con); + $dao->setLinksAndRulers($this->args['book_id'], $this->args['links'], $this->args['rulers']); + } + public function formatSize($val) { $str = files::size($val); diff --git a/inc/ws/DAO/class.ws.dao.book.php b/inc/ws/DAO/class.ws.dao.book.php index 9fab5d2d9..a6307ad1f 100644 --- a/inc/ws/DAO/class.ws.dao.book.php +++ b/inc/ws/DAO/class.ws.dao.book.php @@ -29,6 +29,12 @@ class wsDAOBook extends extranetDAO { $book->links = json_decode($r->links, false); } + if ($r->rulers = '') { + $book->rulers = array(); + } else { + $book->rulers = json_decode($r->rulers, false); + } + $p = unserialize($r->parametres); if (!$p || $p->isEmpty()) { $p = new wsBookParametres($book); @@ -255,8 +261,17 @@ class wsDAOBook extends extranetDAO { $c->update('WHERE book_id=\'' . $this->con->escape($book_id) . '\''); } + public function setLinksAndRulers($book_id, $links, $rulers) + { + $c = $this->con->openCursor('books'); + $c->links = json_encode(json_decode($links, false)); + $c->rulers = json_encode(json_decode($rulers, false)); + $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'); $pages = $this->getPagesOfBook($book_id); $res = array(); foreach($pages as $page => $p) { @@ -274,11 +289,15 @@ class wsDAOBook extends extranetDAO { continue; } $link = array(); - $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'); + $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); $k = 0; foreach($cols as $col => $default) { if (isset($line[$k])) { - $link[$col] = $line[$k]; + if (in_array($k, $booleans)) { + $link[$col] = ($line[$k] == '1'); + } else { + $link[$col] = $line[$k]; + } } else { $link[$col] = $default; } diff --git a/inc/ws/Metier/class.ws.book.php b/inc/ws/Metier/class.ws.book.php index 5ca097864..3b88d422d 100644 --- a/inc/ws/Metier/class.ws.book.php +++ b/inc/ws/Metier/class.ws.book.php @@ -27,6 +27,7 @@ class wsBook extends cubeMetier { protected $chapters; protected $links; + protected $rulers; } ?> \ No newline at end of file diff --git a/swf/_src/wsComposer.fla b/swf/_src/wsComposer.fla index da95cbb38..9fdbc363a 100644 Binary files a/swf/_src/wsComposer.fla and b/swf/_src/wsComposer.fla differ