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
|
<%pre>
#include <vdr/plugin.h>
#include <vdr/config.h>
#include "exception.h"
#include "tools.h"
#include "epg_events.h"
#include "recordings.h"
#include "setup.h"
using namespace vdrlive;
using namespace std;
</%pre>
<%args>
</%args>
<%session scope="global">
bool logged_in(false);
</%session>
<%request scope="page">
RecordingsTree recordingsTree(LiveRecordingsManager());
EpgEvents epgEvents;
</%request>
<%include>page_init.eh</%include>
<{
if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html");
}>
<%cpp>
pageTitle = tr("Recordings");
</%cpp>
<& pageelems.doc_type &>
<html>
<head>
<title>VDR-Live - <$ pageTitle $></title>
<link rel="stylesheet" type="text/css" href="styles.css" />
<& tooltip.javascript var=("domTT_styleClass") value=("domTTepg") &>
<& pageelems.ajax_js &>
<script type="text/javascript" language="javascript" src="treeview.js"></script>
</head>
<body onload="<& pageelems.infobox_start_update &>">
<& 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="epg_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;
string folderimg("folder_closed.png");
string collapseimg("plus.png");
if (recItem->IsDir()) {
reply.out() << string("\t\t\t")
+ string("<div class=\"recording_item\" onclick=\"Toggle(this)\">\n")
+ string("\t\t\t<div class=\"recording_imgs\">")
+ StringRepeat(level, "<img src=\"transparent.png\" alt=\"\" width=\"16px\" height=\"16px\" />")
+ string("<img class=\"recording_expander\" src=\"") + collapseimg + string("\" alt=\"\" />")
+ string("<img class=\"recording_folder\" src=\"") + folderimg + string("\" alt=\"\" />")
+ string("</div>");
}>
<div class="recording_spec">
<div class="recording_name"><$ recItem->Name() $></div>
</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<string, int>(level + 1));
callComp("recordings.recordings_item", request, reply, recItemParams);
}
}
for (iter = recordingsTree.begin(path); iter != end; ++iter) {
RecordingsTree::RecordingsItemPtr recItem = iter->second;
string folderimg("folder_closed.png");
string collapseimg("plus.png");
if (!recItem->IsDir()) {
const cRecordingInfo* info = recItem->RecInfo();
if (info) {
EpgEventPtr epgEvent(new EpgEvent(recItem->Id(),
recItem->Name(),
info->Title() ? info->Title() : recItem->Name(),
info->ShortText() ? info->ShortText() : "",
info->Description() ? info->Description() : "",
recItem->StartTime(),
recItem->StartTime()));
epgEvents.push_back(epgEvent);
}
string day(FormatDateTime("%a,", recItem->StartTime()));
string dayLen(lexical_cast<string, int>(day.length() - 1) + ".25em;");
reply.out() << string("\t\t\t")
+ string("<div class=\"recording_item\">\n")
+ string("\t\t\t<div class=\"recording_imgs\">")
+ StringRepeat(level, "<img src=\"transparent.png\" alt=\"\" width=\"16px\" height=\"16px\" />")
+ string("<img src=\"transparent.png\" alt=\"\" width=\"16px\" height=\"16px\" />")
+ string("<img src=\"movie.png\" alt=\"movie\" />")
+ string("</div>");
string shortDescr(tr("Click to view details.")); if (info && info->ShortText()) shortDescr = (string("") + info->ShortText() + string("<br />") + shortDescr);
}>
<div class="recording_spec">
<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=(recItem->Id()) &>><$ recItem->Name() $></div>
</div>
<div class="recording_actions">
<& pageelems.ajax_action_href action="play_recording" param=(recItem->Id()) tip=(tr("play this recording.")) image="play.png" alt="" &>
<img src="edit.png" alt="" />
<img src="del.png" alt="" />
</div>
</div>
% }
</li>
<{
}
}>
</ul>
</%def>
<%def recordings_data>
<{
// create hidden div for the tooltip hints.
for (vector<EpgEventPtr>::iterator i = epgEvents.begin(); i != epgEvents.end(); ++i) {
EpgEventPtr epg = *i;
string start(epg->StartTime("%a,") + string(" ")
+ epg->StartTime(tr("%b %d %y")) + string(" ")
+ epg->StartTime(tr("%I:%M %p")));
}>
<& pageelems.epg_tt_box boxId=(epg->Id()) caption=(epg->Caption()) tools_comp=("recordings.rec_tools") time=(start) title=(epg->Title()) short_descr=(epg->ShortDescr()) long_descr=(epg->LongDescr()) elapsed=(epg->Elapsed()) &>
<{
}
}>
</%def>
<%def rec_tools>
<%args>
string id;
</%args>
<& pageelems.ajax_action_href action="play_recording" param=(id) tip=(tr("play this recording.")) image="play.png" alt="" &>
</%def>
|