\r
public function setChaptersFromOldFluidbook($book_id)\r
{\r
+ $book = $this->selectById($book_id);\r
+ $n = explode(',', $book->numerotation);\r
+\r
$xml = simplexml_load_file('http://ws.fluidbook.com/books/' . $book_id . '/data/links.xml');\r
$res = array();\r
$chapters = $xml->xpath('//chapters');\r
foreach($chapters as $ch) {\r
$c = array();\r
$c['label'] = (string)$ch->txt;\r
- $c['page'] = (string)$ch->page;\r
+\r
+ $p = intval((string)$ch->page);\r
+ if ($p <= 0) {\r
+ continue;\r
+ }\r
+ $c['page'] = $n[$p];\r
$c['level'] = intval((string)$ch->level);\r
$res[] = $c;\r
}\r