2
#include <vdr/plugin.h>
3
#include <vdr/config.h>
7
#include "epg_events.h"
9
#include "recordings.h"
12
using namespace vdrlive;
18
<%session scope="global">
19
bool logged_in(false);
21
<%request scope="page">
22
RecordingsTree recordingsTree(LiveRecordingsManager());
25
<%include>page_init.eh</%include>
27
if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html");
29
pageTitle = tr("Recordings");
31
<& pageelems.doc_type &>
34
<title>VDR-Live - <$ pageTitle $></title>
35
<link rel="stylesheet" type="text/css" href="styles.css" />
36
<& tooltip.javascript var=("domTT_styleClass") value=("domTTepg") &>
37
<& pageelems.ajax_js &>
38
<script type="text/javascript" src="treeview.js"></script>
40
<body onload="<& pageelems.infobox_start_update &>">
42
<& menu active=("recordings") &>
44
<div class="boxheader"><div><div><$ tr("List of recordings") $></div></div></div>
45
% if (Recordings.Count() == 0) {
46
<$ tr("No recordings found") $>
48
<div class="recordings">
49
<ul class="recordingslist" style="display: block;">
50
<& recordings.recordings_item &>
53
<div class="epg_data" style="display: none;">
54
<& recordings.recordings_data &>
60
<%include>page_exit.eh</%include>
62
<# ---------------------------------------------------------------------- #>
64
<%def recordings_item>
70
RecordingsTree::Map::iterator iter;
71
RecordingsTree::Map::iterator end = recordingsTree.end(path);
73
for (iter = recordingsTree.begin(path); iter != end; ++iter) {
74
RecordingsTree::RecordingsItemPtr recItem = iter->second;
75
string folderimg("folder_closed.png");
76
string collapseimg("plus.png");
77
if (recItem->IsDir()) {
79
<li class="recording">
80
<& rec_item_dir name=(recItem->Name()) level=(level) &>
82
cxxtools::QueryParams recItemParams(qparam, false);
83
for (path_type::const_iterator i = path.begin(); i != path.end(); ++i) {
84
recItemParams.add("path", *i);
86
recItemParams.add("path", recItem->Name());
87
recItemParams.add("level", lexical_cast<string, int>(level + 1));
89
<ul class="recordingslist" style="display: none;">
90
% callComp("recordings.recordings_item", request, reply, recItemParams);
96
for (iter = recordingsTree.begin(path); iter != end; ++iter) {
97
RecordingsTree::RecordingsItemPtr recItem = iter->second;
98
if (!recItem->IsDir()) {
99
EpgEventPtr epgEvent(RecordingsTree::CreateEpgEvent(recItem));
101
epgEvents.push_back(epgEvent);
103
string day(FormatDateTime("%a,", recItem->StartTime()));
104
string dayLen(lexical_cast<string, int>(day.length() - 1) + ".25em;");
105
string hint(tr("Click to view details.")); if (epgEvent && !epgEvent->ShortDescr().empty()) hint = (epgEvent->ShortDescr() + "<br />" + hint);
107
<li class="recording">
108
<& rec_item_file name=(recItem->Name()) level=(level) id=(recItem->Id()) day=(day) dayLen=(dayLen) startTime=(recItem->StartTime()) hint=(hint) shortDescr=(epgEvent ? epgEvent->ShortDescr() : "") archived=(epgEvent ? epgEvent->Archived() : "") archiveId=(recItem->ArchiveId()) &>
116
<# ---------------------------------------------------------------------- #>
118
<%def recordings_data>
120
// create hidden div for the tooltip hints.
121
for (vector<EpgEventPtr>::iterator i = epgEvents.begin(); i != epgEvents.end(); ++i) {
122
EpgEventPtr epg = *i;
123
string start(epg->StartTime("%a,") + string(" ")
124
+ epg->StartTime(tr("%b %d %y")) + string(" ")
125
+ epg->StartTime(tr("%I:%M %p")));
126
string tools_component = epg->Archived().empty() ? "recordings.rec_tools" : "recordings.archived_disc" ;
128
<& pageelems.epg_tt_box boxId=(epg->Id()) caption=(epg->Caption()) tools_comp=(tools_component) time=(start) title=(epg->Title()) short_descr=(epg->ShortDescr()) long_descr=(epg->LongDescr()) archived=(epg->Archived()) elapsed=(epg->Elapsed()) &>
134
<# ---------------------------------------------------------------------- #>
140
<& pageelems.ajax_action_href action="play_recording" param=(id) tip=(tr("play this recording.")) image="play.png" alt="" &>
143
<# ---------------------------------------------------------------------- #>
149
<img src="on_dvd.png" alt="on_dvd" <& tooltip.hint text=(archived) &> />
152
<# ---------------------------------------------------------------------- #>
158
string collapseimg = "plus.png";
159
string folderimg = "folder_closed.png";
161
<div class="recording_item" onclick="Toggle(this)">
162
<div class="recording_imgs"><%cpp> reply.out() << StringRepeat(level, "<img src=\"transparent.png\" alt=\"\" width=\"16px\" height=\"16px\" />"); </%cpp><img class="recording_expander" src="<$ collapseimg $>" alt="" /><img class="recording_folder" src="<$ folderimg $>" alt="" /></div>
163
<div class="recording_spec">
164
<div class="recording_name"><$ name $></div>
166
<div class="recording_actions"> </div>
170
<# ---------------------------------------------------------------------- #>
185
<div class="recording_item">
186
<div class="recording_imgs"><%cpp> reply.out() << StringRepeat(level + 1, "<img src=\"transparent.png\" alt=\"\" width=\"16px\" height=\"16px\" />"); </%cpp><%cpp> if (!archived.empty()) { </%cpp><& archived_disc archived=(archived) &><%cpp> } else { </%cpp><img src="movie.png" alt="movie" /><%cpp> } </%cpp></div>
187
<div class="recording_spec">
188
<div class="recording_day" style="width: <$ dayLen $>"><$ day $></div>
189
<div class="recording_date"><$ FormatDateTime(tr("%b %d %y"), startTime) $></div>
190
<div class="recording_time"><$ FormatDateTime(tr("%I:%M %p"), startTime) $></div>
191
<div class="recording_name" <& 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></div>
193
<div class="recording_actions">
195
if (archived.empty()) {
197
<& pageelems.ajax_action_href action="play_recording" param=(id) tip=(tr("play this recording.")) image="play.png" alt="" &>
202
<img src="transparent.png" alt="" width="16px" height="16px" />
206
<img src="edit.png" alt="" />
207
<img src="del.png" alt="" />
210
if (! archived.empty()) {
212
<div class="recording_arch"><$ archived $></div>