Integrate better monocle in COPS

--HG--
extra : rebase_source : 9132076c5553d0a2a7c550e7f3523b922e52b693
This commit is contained in:
Sébastien Lucas 2014-01-11 18:48:10 +01:00
parent 62941ccb4b
commit 1d2e37d259
3 changed files with 8 additions and 2 deletions

View file

@ -72,10 +72,13 @@ class JSONRenderer
$out ["datas"] = array ();
$dataKindle = $book->GetMostInterestingDataToSendToKindle ();
foreach ($book->getDatas() as $data) {
$tab = array ("id" => $data->id, "format" => $data->format, "url" => $data->getHtmlLink (), "mail" => 0);
$tab = array ("id" => $data->id, "format" => $data->format, "url" => $data->getHtmlLink (), "mail" => 0, "readerUrl" => "");
if (!empty ($config['cops_mail_configuration']) && !is_null ($dataKindle) && $data->id == $dataKindle->id) {
$tab ["mail"] = 1;
}
if ($data->format == "EPUB") {
$tab ["readerUrl"] = "epubreader.php?data={$data->id}&db=0"; //TODO fix the database
}
array_push ($out ["datas"], $tab);
}
$out ["authors"] = array ();