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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
|
<%pre>
#include <vdr/plugin.h>
#include <vdr/config.h>
#include "exception.h"
#include "tools.h"
#include "recordings.h"
using namespace vdrlive;
</%pre>
<%args>
</%args>
<%request scope="page">
RecordingsTree recordingsTree;
const std::string lPref("long_");
const std::string sPref("short_");
</%request>
<%include>page_init.eh</%include>
<%cpp>
pageTitle = tr("Recordings");
</%cpp>
<& pageelems.doc_type &>
<html>
<head>
<title>VDR-Live - <$ pageTitle $></title>
<link rel="stylesheet" type="text/css" href="styles.css" />
<script type="text/javascript" language="javascript" src="treeview.js"></script>
<& tooltip.javascript var=("domTT_oneOnly") value=("true") var=("domTT_styleClass") value=("domTTrecordings") &>
</head>
<body>
<& pageelems.logo &>
<& menu active=("recordings") &>
<div class="inhalt">
% if (Recordings.Count() == 0) {
Keine Aufnahmen vorhanden
% } else {
<div class="recordings">
<& recordings.recordings_item &>
</div>
<div class="recordings_data" style="display: none;">
<& recordings.recordings_data &>
</div>
% }
</div>
</body>
</html>
<%include>page_exit.eh</%include>
<%def recordings_item>
<%args>
path[];
int level = 0;
</%args>
<{
if (level > 0) {
}>
<ul class="recordingslist" style="display: none;">
<{
}
else {
}>
<ul class="recordingslist" style="display: block;">
<{
} // if (level > 0)
RecordingsTree::Map::iterator iter;
RecordingsTree::Map::iterator end = recordingsTree.end(path);
}>
<li class="recording">
<{
for (iter = recordingsTree.begin(path); iter != end; ++iter) {
RecordingsTree::RecordingsItemPtr recItem = iter->second;
std::string folderimg("folder_closed.png");
std::string collapseimg("plus.png");
if (recItem->IsDir()) {
reply.out() << std::string("\t\t\t")
+ std::string("<div class=\"recording_item\" onclick=\"Toggle(this)\">\n")
+ std::string("\t\t\t<div class=\"recording_imgs\">")
+ StringRepeat(level, "<img src=\"transparent.png\" alt=\"\" width=\"16px\" height=\"16px\" />")
+ std::string("<img class=\"recording_expander\" src=\"") + collapseimg + std::string("\" alt=\"\" />")
+ std::string("<img class=\"recording_folder\" src=\"") + folderimg + std::string("\" alt=\"\" />")
+ std::string("</div>");
}>
<div class="recording_name"><$ recItem->Name() $></div>
<div class="recording_actions"> </div>
</div>
<{
cxxtools::QueryParams recItemParams(qparam, false);
for (path_type::const_iterator i = path.begin(); i != path.end(); ++i) {
recItemParams.add("path", *i);
}
recItemParams.add("path", recItem->Name());
recItemParams.add("level", lexical_cast<std::string, int>(level + 1));
callComp("recordings.recordings_item", request, reply, recItemParams);
}
}
for (iter = recordingsTree.begin(path); iter != end; ++iter) {
RecordingsTree::RecordingsItemPtr recItem = iter->second;
std::string folderimg("folder_closed.png");
std::string collapseimg("plus.png");
if (!recItem->IsDir()) {
std::string day(FormatDateTime("%a,", recItem->StartTime()));
std::string dayLen(lexical_cast<std::string, int>(day.length() - 1) + ".25em;");
reply.out() << std::string("\t\t\t")
+ std::string("<div class=\"recording_item\">\n")
+ std::string("\t\t\t<div class=\"recording_imgs\">")
+ StringRepeat(level, "<img src=\"transparent.png\" alt=\"\" width=\"16px\" height=\"16px\" />")
+ std::string("<img src=\"transparent.png\" alt=\"\" width=\"16px\" height=\"16px\" />")
+ std::string("<img src=\"movie.png\" alt=\"movie\" />")
+ std::string("</div>");
const cRecordingInfo* info = recItem->RecInfo();
std::string shortDescr(tr("Click to view details.")); if (info && info->ShortText()) shortDescr = (std::string("") + info->ShortText() + std::string("<br />") + shortDescr);
}>
<div class="recording_day" style="width: <$ dayLen $>"><$ day $></div>
<div class="recording_date"><$ FormatDateTime(tr("%b %d %y"), recItem->StartTime()) $></div>
<div class="recording_time"><$ FormatDateTime(tr("%I:%M %p"), recItem->StartTime()) $></div>
<div class="recording_name" <& tooltip.hint text=(shortDescr) &><& tooltip.display domId=(lPref + recItem->Id()) &>><$ recItem->Name() $></div>
<div class="recording_actions">
<img src="play.png" alt="" />
<img src="edit.png" alt="" />
<img src="del.png" alt="" />
</div>
</div>
% }
</li>
<{
}
}>
</ul>
</%def>
<%def recordings_data>
<%args>
path[];
int level = 0;
</%args>
<{
RecordingsTree::Map::iterator iter;
RecordingsTree::Map::iterator end = recordingsTree.end(path);
for (iter = recordingsTree.begin(path); iter != end; ++iter) {
RecordingsTree::RecordingsItemPtr recItem = iter->second;
if (recItem->IsDir()) {
cxxtools::QueryParams recItemParams(qparam, false);
for (path_type::const_iterator i = path.begin(); i != path.end(); ++i) {
recItemParams.add("path", *i);
}
recItemParams.add("path", recItem->Name());
recItemParams.add("level", lexical_cast<std::string, int>(level + 1));
callComp("recordings.recordings_data", request, reply, recItemParams);
}
else {
const cRecordingInfo* info = recItem->RecInfo();
if (info) {
std::string start(FormatDateTime("%a,", recItem->StartTime()) + std::string(" ")
+ FormatDateTime(tr("%b %d %y"), recItem->StartTime()) + std::string(" ")
+ FormatDateTime(tr("%I:%M %p"), recItem->StartTime()));
std::string title(recItem->Name()); if (info->Title()) title = info->Title();
std::string shortDescr; if (info->ShortText()) shortDescr = info->ShortText();
std::string longDescr; if (info->Description()) longDescr = info->Description();
}>
<div class="re_longdescr" id="<$ (lPref + recItem->Id()) $>">
<div class="re_station">
<div class="boxheader"><div><div><$ recItem->Name() $><& tooltip.close domId=(lPref + recItem->Id()) &></div></div></div>
</div>
<div class="re_content">
<div class="info"><$ (start) $></div>
<div class="title"><$ (title) $></div>
<div class="short"><$ (shortDescr) $></div>
<div class="description">
<$ (longDescr) $>
</div>
</div>
</div>
<{
}
}
}
}>
</%def>
|