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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
|
<%pre>
#include <vdr/plugin.h>
#include <vdr/config.h>
#include "exception.h"
#include "tools.h"
#include "epg_events.h"
#include "recman.h"
#include "setup.h"
using namespace vdrlive;
using namespace std;
</%pre>
<%args>
</%args>
<%session scope="global">
bool logged_in(false);
</%session>
<%request scope="page">
RecordingsTreePtr recordingsTree(LiveRecordingsManager()->GetRecordingsTree());
</%request>
<%include>page_init.eh</%include>
<%cpp>
if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html");
pageTitle = tr("Recordings");
</%cpp>
<& pageelems.doc_type &>
<html>
<head>
<title>VDR-Live - <$ pageTitle $></title>
<& pageelems.stylesheets &>
<& pageelems.ajax_js &>
<script type="text/javascript" src="treeview.js"></script>
</head>
<body>
<& pageelems.logo &>
<& menu active=("recordings") &>
<div class="inhalt">
<div class="boxheader"><div><div><$ tr("List of recordings") $></div></div></div>
% if (Recordings.Count() == 0) {
<$ tr("No recordings found") $>
% } else {
<div class="recordings">
<ul class="recordingslist" style="display: block;">
<& recordings.recordings_item &>
</ul>
</div>
% }
</div>
</body>
</html>
<%include>page_exit.eh</%include>
<# ---------------------------------------------------------------------- #>
<%def recordings_item>
<%args>
path[];
int level = 0;
</%args>
<%cpp>
RecordingsMap::iterator iter;
RecordingsMap::iterator end = recordingsTree->end(path);
for (iter = recordingsTree->begin(path); iter != end; ++iter) {
RecordingsItemPtr recItem = iter->second;
string folderimg("folder_closed.png");
string collapseimg("plus.png");
if (recItem->IsDir()) {
</%cpp>
<li class="recording">
<& rec_item_dir name=(recItem->Name()) level=(level) &>
<%cpp>
#ifdef TNTVERS7
tnt::QueryParams recItemParams(qparam, false);
#else
cxxtools::QueryParams recItemParams(qparam, false);
#endif
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));
</%cpp>
<ul class="recordingslist" style="display: none;">
<%cpp>
callComp("recordings.recordings_item", request, reply, recItemParams);
</%cpp>
</ul>
</li>
<%cpp>
}
}
for (iter = recordingsTree->begin(path); iter != end; ++iter) {
RecordingsItemPtr recItem = iter->second;
if (!recItem->IsDir()) {
string day(FormatDateTime("%a,", recItem->StartTime()));
string dayLen(lexical_cast<string, int>(day.length() - 1) + ".25em;");
string shortDescr(recItem->RecInfo()->ShortText() ? recItem->RecInfo()->ShortText() : "");
string hint(tr("Click to view details.")); if (!shortDescr.empty()) hint = shortDescr + "<br />" + hint;
</%cpp>
<li class="recording">
<& rec_item_file name=(recItem->Name()) level=(level) id=(recItem->Id()) day=(day) dayLen=(dayLen) startTime=(recItem->StartTime()) hint=(hint) shortDescr=(shortDescr) archived=(RecordingsManager::GetArchiveDescr(recItem->Recording())) &>
</li>
<%cpp>
}
}
</%cpp>
</%def>
<# ---------------------------------------------------------------------- #>
<%def rec_tools>
<%args>
string id;
string title;
</%args>
<& pageelems.ajax_action_href action="play_recording" param=(id) tip=(tr("play this recording.")) image="play.png" alt="" &>
<& pageelems.imdb_info_href title=(title) &>
</%def>
<# ---------------------------------------------------------------------- #>
<%def archived_disc>
<%args>
string archived;
string title;
</%args>
<img src="<$ LiveSetup().GetThemedLink("img", "on_dvd.png") $>" alt="on_dvd" <& tooltip.hint text=(archived) &> />
<& pageelems.imdb_info_href title=(title) &>
</%def>
<# ---------------------------------------------------------------------- #>
<%def rec_item_dir>
<%args>
string name;
int level;
string collapseimg = "plus.png";
string folderimg = "folder_closed.png";
</%args>
<div class="recording_item" onclick="Toggle(this)">
<div class="recording_imgs"><%cpp> reply.out() << StringRepeat(level, "<img src=\"/img/transparent.png\" alt=\"\" width=\"16px\" height=\"16px\" />"); </%cpp><img class="recording_expander" src="<$ LiveSetup().GetThemedLink("img", collapseimg) $>" alt="" /><img class="recording_folder" src="<$ LiveSetup().GetThemedLink("img", folderimg) $>" alt="" /></div>
<div class="recording_spec">
<div class="recording_name"><$ name $></div>
</div>
<div class="recording_actions"> </div>
</div>
</%def>
<# ---------------------------------------------------------------------- #>
<%def rec_item_file>
<%args>
string name;
int level;
string id;
string day;
string dayLen;
time_t startTime;
string hint;
string shortDescr;
string archived;
</%args>
<div class="recording_item">
<div class="recording_imgs"><%cpp> reply.out() << StringRepeat(level + 1, "<img src=\"/img/transparent.png\" alt=\"\" width=\"16px\" height=\"16px\" />"); </%cpp><%cpp> if (!archived.empty()) { </%cpp><img src="<$ LiveSetup().GetThemedLink("img", "on_dvd.png") $>" alt="on_dvd" <& tooltip.hint text=(archived) &> /><%cpp> } else { </%cpp><img src="<$ LiveSetup().GetThemedLink("img", "movie.png") $>" alt="movie" /><%cpp> } </%cpp></div>
<div class="recording_spec">
<div class="recording_day" style="width: <$ dayLen $>"><$ day $></div>
<div class="recording_date"><$ FormatDateTime(tr("%b %d %y"), startTime) $></div>
<div class="recording_time"><$ FormatDateTime(tr("%I:%M %p"), startTime) $></div>
<div class="recording_name"><a <& tooltip.hint text=(hint) &><& tooltip.display domId=(id) &>><$ name $><br /><%cpp>if ((name != shortDescr) && (!shortDescr.empty())) {</%cpp><span><$ shortDescr $></span><%cpp> } else { </%cpp><span> </span><%cpp> } </%cpp></a></div>
</div>
<div class="recording_actions">
<%cpp>
if (archived.empty()) {
</%cpp>
<& recordings.rec_tools id=(id) title=(name)&>
<%cpp>
}
else {
</%cpp>
<img src="/img/transparent.png" alt="" width="16px" height="16px" />
<& pageelems.imdb_info_href title=(name) &>
<%cpp>
}
</%cpp>
<!-- not supported yet ...
<img src="<$ LiveSetup().GetThemedLink("img", "edit.png") $>" alt="" />
<img src="<$ LiveSetup().GetThemedLink("img", "del.png") $>" alt="" />
-->
</div>
<%cpp>
if (! archived.empty()) {
</%cpp>
<div class="recording_arch"><$ archived $></div>
<%cpp>
}
</%cpp>
</div>
</%def>
|