<%pre> #include #include #include "exception.h" #include "tools.h" #include "epg_events.h" #include "recman.h" #include "setup.h" using namespace vdrlive; using namespace std; <%args> <%session scope="global"> bool logged_in(false); <%request scope="page"> RecordingsTreePtr recordingsTree(LiveRecordingsManager()->GetRecordingsTree()); <%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 &> <& pageelems.ajax_js &> <& pageelems.logo &> <& menu active=("recordings") &>
<$ tr("List of recordings") $>
% if (Recordings.Count() == 0) { <$ tr("No recordings found") $> % } else {
    <& recordings.recordings_item &>
% }
<%include>page_exit.eh <# ---------------------------------------------------------------------- #> <%def recordings_item> <%args> path[]; int level = 0; <%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()) {
  • <& 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(level + 1));
  • % } %} <%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(day.length() - 1) + ".25em;"); string shortDescr(recItem->RecInfo()->ShortText() ? recItem->RecInfo()->ShortText() : ""); string hint(tr("Click to view details.")); if (!shortDescr.empty()) hint = shortDescr + "
    " + hint;
  • <& 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())) &>
  • <%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;
    <%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) $>
    <%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> }