<%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; <%session scope="global"> bool logged_in(false); <%include>page_init.eh <{ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); }> <%cpp> pageTitle = tr("Search results"); SearchResults results; if (!searchtimerid.empty()) results.GetByID(lexical_cast< int >(searchtimerid)); if (!searchtimerquery.empty()) results.GetByQuery(SearchResults::PopQuery(searchtimerquery)); <& pageelems.doc_type &> VDR-Live - <$ pageTitle $> <& tooltip.javascript var=("domTT_styleClass") value=("domTTepg") &> <& pageelems.ajax_js &> <& pageelems.logo &> <& menu active=("searchresults") &>
% if (results.size() == 0) { <$ tr("No search results") $> % } <{ string current_day = ""; bool active_line = false; EpgEvents epgEvents; int evntNr = 0; for (SearchResults::iterator result = results.begin(); result != results.end(); ++result) { // active_line = !active_line; string channelname = Channels.GetByChannelID(result->Channel())->Name(); 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; if (current_day != day) { if (current_day != "") { }> <{ } }> % current_day = day; % } "> % } % if (results.size() > 0) { % }
 
<$ day $>
<& pageelems.event_timer channelid=(channel_id) eventid=(event)&> <$ channelname $> <$ start $> - <$ end $>
") + string(tr("Click to view details."))) &><& tooltip.display domId=(epgEvent->Id()) &>><$ result->Title() $>
<$ result->ShortText() $>
 
 
<%include>page_exit.eh