<%pre> #include #include #include "exception.h" #include "tools.h" #include "epg_events.h" #include "recordings.h" #include "setup.h" using namespace vdrlive; using namespace std; <%args> <%session scope="global"> bool logged_in(false); <%request scope="page"> RecordingsTree recordingsTree(LiveRecordingsManager()); EpgEvents epgEvents; <%include>page_init.eh <%cpp> if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); pageTitle = tr("Recordings"); <& pageelems.doc_type &> VDR-Live - <$ pageTitle $> <& pageelems.stylesheets &> <& tooltip.javascript var=("domTT_styleClass") value=("domTTepg") &> <& pageelems.ajax_js &> <& pageelems.logo &> <& menu active=("recordings") &>
<$ tr("List of recordings") $>
% if (Recordings.Count() == 0) { <$ tr("No recordings found") $> % } else {
    <& recordings.recordings_item &>
% }
% if (Recordings.Count() > 0) { % } <%include>page_exit.eh <# ---------------------------------------------------------------------- #> <%def recordings_item> <%args> path[]; int level = 0; <%cpp> RecordingsTree::Map::iterator iter; RecordingsTree::Map::iterator end = recordingsTree.end(path); 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()) {
  • <& rec_item_dir name=(recItem->Name()) level=(level) &> <%cpp> 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(level + 1));
  • % } %} <%cpp> for (iter = recordingsTree.begin(path); iter != end; ++iter) { RecordingsTree::RecordingsItemPtr recItem = iter->second; if (!recItem->IsDir()) { EpgEventPtr epgEvent(RecordingsTree::CreateEpgEvent(recItem)); if (epgEvent) { epgEvents.push_back(epgEvent); } string day(FormatDateTime("%a,", recItem->StartTime())); string dayLen(lexical_cast(day.length() - 1) + ".25em;"); string hint(tr("Click to view details.")); if (epgEvent && !epgEvent->ShortDescr().empty()) hint = (epgEvent->ShortDescr() + "
    " + hint);
  • <& 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()) &>
  • <%cpp> } } <# ---------------------------------------------------------------------- #> <%def recordings_data> <%cpp> // create hidden div for the tooltip hints. for (vector::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"))); string tools_component = epg->Archived().empty() ? "recordings.rec_tools" : "recordings.archived_disc" ; <& 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()) &> <%cpp> } <# ---------------------------------------------------------------------- #> <%def rec_tools> <%args> string id; <& pageelems.ajax_action_href action="play_recording" param=(id) tip=(tr("play this recording.")) image="play.png" alt="" &> <# ---------------------------------------------------------------------- #> <%def archived_disc> <%args> string archived; " alt="on_dvd" <& tooltip.hint text=(archived) &> /> <# ---------------------------------------------------------------------- #> <%def rec_item_dir> <%args> string name; int level; string collapseimg = "plus.png"; string folderimg = "folder_closed.png";
    <%cpp> reply.out() << StringRepeat(level, "\"\""); " alt="" />" alt="" />
    <$ name $>
     
    <# ---------------------------------------------------------------------- #> <%def rec_item_file> <%args> string name; int level; string id; string day; string dayLen; time_t startTime; string hint; string shortDescr; string archived; string archiveId;
    <%cpp> reply.out() << StringRepeat(level + 1, "\"\""); <%cpp> if (!archived.empty()) { <& archived_disc archived=(archived) &><%cpp> } else { " alt="movie" /><%cpp> }
    <$ day $>
    <$ FormatDateTime(tr("%b %d %y"), startTime) $>
    <$ FormatDateTime(tr("%I:%M %p"), startTime) $>
    <& tooltip.display domId=(id) &>><$ name $>
    <%cpp>if ((name != shortDescr) && (!shortDescr.empty())) {<$ shortDescr $><%cpp> } else {  <%cpp> }
    <%cpp> if (archived.empty()) { <& pageelems.ajax_action_href action="play_recording" param=(id) tip=(tr("play this recording.")) image="play.png" alt="" &> <%cpp> } else { <%cpp> } " alt="" /> " alt="" />
    <%cpp> if (! archived.empty()) {
    <$ archived $>
    <%cpp> }