adapt to console_table 1.2.0
[bdrem.git] / src / bdrem / Renderer / Html.php
1 <?php
2 namespace bdrem;
3
4 class Renderer_Html extends Renderer
5 {
6     protected $httpContentType = 'application/xhtml+xml; charset=utf-8';
7
8     public function render($arEvents)
9     {
10         $tr = new Renderer_HtmlTable();
11         $table = $tr->render($arEvents);
12         $s = <<<HTM
13 <?xml version="1.0" encoding="utf-8"?>
14 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
15 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
16  <head>
17   <title>bdrem</title>
18   <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
19   <style type="text/css">
20 table {
21     border: 1px solid black;
22     border-collapse: collapse;
23     margin-left: auto;
24     margin-right: auto;
25 }
26 td, th {
27     border: 1px solid grey;
28     border-left: 0px;
29     border-right: 0px;
30     padding: 0.1ex 1ex;
31 }
32
33 tr.prev td {
34     background-color: #C4DDF4;
35 }
36 tr.today td {
37     background-color: #FEDCBA;
38 }
39 tr.next td {
40     background-color: #DEFABC;
41 }
42 tr:hover td {
43     background-color: white;
44 }
45
46 .r {
47     text-align: right;
48 }
49
50 tr td.icon {
51     background-color: white;
52 }
53 tr.prev td.icon {
54     color: #00A;
55 }
56 tr.today td.icon {
57     color: black;
58     background-color: #FEDCBA;
59 }
60 tr.next td.icon {
61     color: #080;
62 }
63
64 tr.d-3 td.icon:before {
65     content: "\342\227\224"
66 }
67 tr.d-2 td.icon:before {
68     content: "\342\227\221"
69 }
70 tr.d-1 td.icon:before {
71     content: "\342\227\225"
72 }
73 tr.d0 td.icon:before {
74     content: "\342\230\205"
75 }
76 tr.d1 td.icon:before {
77     content: "\342\227\225"
78 }
79 tr.d2 td.icon:before {
80     content: "\342\227\221"
81 }
82 tr.d3 td.icon:before {
83     content: "\342\227\224"
84 }
85   </style>
86  </head>
87  <body>
88 $table
89  </body>
90 </html>
91 HTM;
92         return $s;
93     }
94 }
95 ?>