<%pre> #include #include #include #include "epgsearch.h" #include "tools.h" #include "setup.h" #include "epg_events.h" using namespace vdrlive; using namespace std; <%args> // input parameters string searchtimerid; string searchtimerquery; string searchplain; <%session scope="global"> bool logged_in(false); <%include>page_init.eh <%cpp> if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); pageTitle = tr("Search results"); SearchResults results; if (!searchtimerid.empty()) results.GetByID(lexical_cast< int >(searchtimerid)); if (!searchtimerquery.empty()) results.GetByQuery(SearchResults::PopQuery(searchtimerquery)); if (!searchplain.empty()) { SearchTimer s; s.SetId(0); s.SetSearch(searchplain); s.SetSearchMode(0); s.SetUseTitle(true); s.SetUseSubtitle(false); s.SetUseDescription(false); results.GetByQuery(s.ToText()); } <& pageelems.doc_type &> VDR-Live - <$ pageTitle $> <& pageelems.stylesheets &> <& tooltip.javascript var=("domTT_styleClass") value=("domTTepg") &> <& pageelems.ajax_js &> <& pageelems.logo &> <& menu active=("searchepg") &>
% if (results.size() == 0) { <$ tr("No search results") $> % } <%cpp> string current_day = ""; EpgEvents epgEvents; int evntNr = 0; for (SearchResults::iterator result = results.begin(); result != results.end(); ++result) { string channelname = Channels.GetByChannelID(result->Channel())->Name(); int channelnr = Channels.GetByChannelID(result->Channel())->Number(); string start(result->StartTime() ? FormatDateTime(tr("%I:%M %p"), result->StartTime()) : ""); string end(result->StopTime() ? FormatDateTime(tr("%I:%M %p"), result->StopTime()) : ""); string day(result->StartTime() ? FormatDateTime(tr("%A, %b %d %Y"), result->StartTime()) : ""); tEventID event = result->EventId(); tChannelID channel_id(result->Channel()); string description = result->Description(); string evntId("eventId_"); evntId += lexical_cast(++evntNr); EpgEventPtr epgEvent(new EpgEvent(evntId, channelname, result->Title(), result->ShortText(), description, result->StartTime(), result->StopTime())); epgEvents.push_back(epgEvent); bool truncated = false; bool bottom = false; SearchResults::iterator nextResult = result; ++nextResult; if (nextResult == results.end()) bottom = true; else { string nextDay(nextResult->StartTime() ? FormatDateTime(tr("%A, %b %d %Y"), nextResult->StartTime()) : ""); bottom = (day != nextDay); } if (current_day != day) { if (current_day != "") { % } % current_day = day; % } % }
<$ day $>
"><& pageelems.event_timer channelid=(channel_id) eventid=(event)&> "> ">
<$ start $> - <$ end $>
">
" + tr("Click to view details.")) &><& tooltip.display domId=(epgEvent->Id()) &>><$ result->Title() $>
<%cpp>if (result->ShortText().empty()) {  <%cpp> } <$ result->ShortText() $>
<%include>page_exit.eh