Code

< 40 %
40-60 %
> 60 %
1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
3
<?php
4
/**
5
 * COPS (Calibre OPDS PHP Server) epub reader
6
 *
7
 * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
8
 * @author     Sébastien Lucas <[email protected]>
9
 */
10
11
require_once 'config.php';
12
require_once 'base.php';
13
14
header('Content-Type: text/html;charset=utf-8');
15
16
$idData = getURLParam('data', NULL);
17
$add = 'data=' . $idData . '&';
18
if (!is_null (GetUrlParam (DB))) {
19
    $add .= DB . '=' . GetUrlParam (DB) . '&';
20
}
21
$myBook = Book::getBookByDataId($idData);
22
23
$book = new EPub($myBook->getFilePath('EPUB', $idData));
24
$book->initSpineComponent();
25
26
?>
27
<head>
28
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
29
    <meta http-equiv="imagetoolbar" content="no" />
30
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
31
    <title>COPS's Epub Reader</title>
32
    <script type="text/javascript" src="<?php echo getUrlWithVersion('resources/monocle/scripts/monocore.js') ?>"></script>
33
    <script type="text/javascript" src="<?php echo getUrlWithVersion('resources/monocle/scripts/monoctrl.js') ?>"></script>
34
    <link rel="stylesheet" type="text/css" href="<?php echo getUrlWithVersion('resources/monocle/styles/monocore.css') ?>" media="screen" />
35
    <link rel="stylesheet" type="text/css" href="<?php echo getUrlWithVersion('resources/monocle/styles/monoctrl.css') ?>" media="screen" />
36
    <script type="text/javascript">
37
        Monocle.DEBUG = true;
38
        var bookData = {
39
          getComponents: function() {
40
            <?php echo 'return ' . json_encode($book->components()) . ';'; ?>
41
          },
42
          getContents: function() {
43
            <?php echo 'return ' . json_encode($book->contents()) . ';'; ?>
44
          },
45
          getComponent: function (componentId) {
46
            return { url: "epubfs.php?<?php echo $add ?>comp="  + componentId };
47
          },
48
          getMetaData: function(key) {
49
            return {
50
              title: "<?php echo $myBook->title ?>",
51
              creator: "Inventive Labs"
52
            }[key];
53
          }
54
        }
55
56
    </script>
57
    <script type="text/javascript" src="<?php echo getUrlWithVersion('styles/cops-monocle.js') ?>"></script>
58
    <link rel="stylesheet" type="text/css" href="<?php echo getUrlWithVersion('styles/cops-monocle.css') ?>" media="screen" />
59
</head>
60
<body>
61
  <div id="readerBg">
62
      <div class="board"></div>
63
      <div class="jacket"></div>
64
      <div class="dummyPage"></div>
65
      <div class="dummyPage"></div>
66
      <div class="dummyPage"></div>
67
      <div class="dummyPage"></div>
68
      <div class="dummyPage"></div>
69
  </div>
70
  <div id="readerCntr">
71
      <div id="reader"></div>
72
  </div>
73
</body>
74
</html>
75