$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
$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
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
} 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
$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
$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
protected $chapters;\r
protected $links;\r
protected $rulers;\r
+ protected $extras;\r
}\r
\r
?>
\ No newline at end of file