aboutsummaryrefslogtreecommitdiff
path: root/src/bdrem/Renderer/Html.php
blob: af48e0ea179da6cb5279995b525a6ab5395fa52b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<?php
namespace bdrem;

class Renderer_Html extends Renderer
{
    protected $httpContentType = 'application/xhtml+xml; charset=utf-8';

    public function render($arEvents)
    {
        $tr = new Renderer_HtmlTable();
        $table = $tr->render($arEvents);
        $s = <<<HTM
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 <head>
  <title>bdrem</title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <style type="text/css">
table {
    border: 1px solid black;
    border-collapse: collapse;
    margin-left: auto;
    margin-right: auto;
}
td, th {
    border: 1px solid grey;
    border-left: 0px;
    border-right: 0px;
    padding: 0.1ex 1ex;
}

tr.prev td {
    background-color: #C4DDF4;
}
tr.today td {
    background-color: #FEDCBA;
}
tr.next td {
    background-color: #DEFABC;
}
tr:hover td {
    background-color: white;
}

.r {
    text-align: right;
}

tr td.icon {
    background-color: white;
}
tr.prev td.icon {
    color: #00A;
}
tr.today td.icon {
    color: black;
    background-color: #FEDCBA;
}
tr.next td.icon {
    color: #080;
}

tr.d-3 td.icon:before {
    content: "\342\227\224"
}
tr.d-2 td.icon:before {
    content: "\342\227\221"
}
tr.d-1 td.icon:before {
    content: "\342\227\225"
}
tr.d0 td.icon:before {
    content: "\342\230\205"
}
tr.d1 td.icon:before {
    content: "\342\227\225"
}
tr.d2 td.icon:before {
    content: "\342\227\221"
}
tr.d3 td.icon:before {
    content: "\342\227\224"
}
  </style>
 </head>
 <body>
$table
 </body>
</html>
HTM;
        return $s;
    }
}
?>