<%pre> #include #include #include #include #include #include "setup.h" #include "tools.h" #include "epg_events.h" using namespace std; using namespace vdrlive; <%args> type = "now"; <%include>page_init.eh <{ cSchedulesLock schedulesLock; const cSchedules* Schedules = cSchedules::Schedules(schedulesLock); string head; if (type == "now") { head = tr("What's running at")+string(" ")+FormatDateTime(tr("%I:%M %p"), time(0)); } else { type="next"; head = tr("What's on next?"); } }> VDR-Live - <$ head $> <& tooltip.javascript var=("domTT_styleClass") value=("domTTepg") &> <& pageelems.ajax_js &> <& pageelems.logo &> <& menu active=(type) &>
<{ EpgEvents epgEvents; ReadLock channelsLock( Channels ); if (channelsLock) { int evntNr = 0; for (cChannel *Channel = Channels.First(); Channel && Channel->Number() <= LiveSetup().GetLastChannel(); Channel = Channels.Next(Channel)) { if (!Channel->GroupSep()) { const cSchedule *Schedule = Schedules->GetSchedule(Channel); if (Schedule) { const cEvent *Event = (type == "now" ? Schedule->GetPresentEvent() : Schedule->GetFollowingEvent()); if (Event) { std::string evntId("eventId_"); evntId += lexical_cast(++evntNr); EpgEventPtr epgEvent(new EpgEvent(evntId, Event, Channel->Name())); epgEvents.push_back(epgEvent); tChannelID channel_id(Channel->GetChannelID()); tEventID event = Event->EventID(); bool truncated = false; string description(); }>
<$ (epgEvent->Caption()) $>
<& pageelems.event_timer channelid=(channel_id) eventid=(event) &> % if (type == "now") { <& pageelems.ajax_action_href action="switch_channel" tip=(tr("Switch to this channel.")) param=(channel_id) image="zap.png" alt="" &> % }
<$ (epgEvent->StartTime(tr("%I:%M %p"))) $> - <$ (epgEvent->EndTime(tr("%I:%M %p"))) $>
<$ (epgEvent->Title()) $>
<$ (epgEvent->ShortDescr()) $>
<$ (StringWordTruncate(epgEvent->LongDescr(), 150, truncated)) $>
LongDescr(), 300, truncated)) + string("
") + string(tr("Click to view details."))) &><& tooltip.display domId=(epgEvent->Id()) &>><$ (string(tr("more")) + string(" ...")) $>
<{ } } } } } }>
<%include>page_exit.eh