2
#include <vdr/channels.h>
8
#include "epg_events.h"
10
using namespace vdrlive;
17
string searchtimerquery;
20
<%session scope="global">
21
bool logged_in(false);
23
<%include>page_init.eh</%include>
25
if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html");
28
pageTitle = tr("Search results");
29
SearchResults results;
30
if (!searchtimerid.empty())
31
results.GetByID(lexical_cast< int >(searchtimerid));
32
if (!searchtimerquery.empty())
33
results.GetByQuery(SearchResults::PopQuery(searchtimerquery));
34
if (!searchplain.empty())
36
string query = searchplain;
37
StringReplace(query, "&", "&");
43
s.SetUseSubtitle(false);
44
s.SetUseDescription(false);
45
results.GetByQuery(s.ToText());
48
<& pageelems.doc_type &>
51
<title>VDR-Live - <$ pageTitle $></title>
52
<link rel="stylesheet" type="text/css" href="/styles.css" />
53
<& tooltip.javascript var=("domTT_styleClass") value=("domTTepg") &>
54
<& pageelems.ajax_js &>
56
<body onload="<& pageelems.infobox_start_update &>">
58
<& menu active=("searchepg") &>
60
% if (results.size() == 0) {
61
<$ tr("No search results") $>
63
<table class="searchresults" cellspacing="0" callpadding="0">
65
string current_day = "";
66
bool active_line = false;
70
for (SearchResults::iterator result = results.begin(); result != results.end(); ++result) {
71
// active_line = !active_line;
72
string channelname = Channels.GetByChannelID(result->Channel())->Name();
73
int channelnr = Channels.GetByChannelID(result->Channel())->Number();
74
string start(result->StartTime() ? FormatDateTime(tr("%I:%M %p"), result->StartTime()) : "");
75
string end(result->StopTime() ? FormatDateTime(tr("%I:%M %p"), result->StopTime()) : "");
76
string day(result->StartTime() ? FormatDateTime(tr("%A, %b %d %Y"), result->StartTime()) : "");
77
tEventID event = result->EventId();
78
tChannelID channel_id(result->Channel());
79
string description = result->Description();
82
string evntId("eventId_");
83
evntId += lexical_cast<std::string, int>(++evntNr);
84
EpgEventPtr epgEvent(new EpgEvent(evntId, channelname, result->Title(), result->ShortText(), description, result->StartTime(), result->StopTime()));
85
epgEvents.push_back(epgEvent);
86
bool truncated = false;
88
if (current_day != day) {
89
if (current_day != "") {
92
<td colspan="5" style="border-top: 1px solid black; border-bottom: none; background-image: none"> </td></tr>
98
<td class="day" colspan="5"><div class="boxheader"><div><div><$ day $></div></div></div></td>
102
<tr class="<? active_line ? "active" ?>">
103
<td style="border-left: 1px solid black"><& pageelems.event_timer channelid=(channel_id) eventid=(event)&></td>
104
<td><a href="schedule.html?channel=<$ channelnr $>"><$ channelname $></a></td>
105
<td><$ start $> - <$ end $></td>
108
<div class="more"<& tooltip.hint text=(StringEscapeAndBreak(StringWordTruncate(description, 300, truncated)) + string("<br />") + string(tr("Click to view details."))) &><& tooltip.display domId=(epgEvent->Id()) &>><strong><$ result->Title() $></strong></div><$ result->ShortText() $><br />
111
<td style="border-right: 1px solid black"> </td>
114
% if (results.size() > 0) {
116
<td colspan="5" style="border-top: 1px solid black; background: none; border-bottom: none"> </td>
121
<div class="epg_data" style="display: none;">
123
// create hidden div for the tooltip hints.
124
for (vector<EpgEventPtr>::iterator i = epgEvents.begin(); i != epgEvents.end(); ++i) {
125
EpgEventPtr epg = *i;
127
<& pageelems.epg_tt_box boxId=(epg->Id()) caption=(epg->Caption()) time=(epg->StartTime(tr("%I:%M %p")) + string(" - ") + epg->EndTime(tr("%I:%M %p"))) title=(epg->Title()) short_descr=(epg->ShortDescr()) long_descr=(epg->LongDescr()) elapsed=(epg->Elapsed()) &>
135
<%include>page_exit.eh</%include>