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