summaryrefslogtreecommitdiff
path: root/pages/whats_on.ecpp
blob: 090273cc06746103ced0c31c9a22b934781ec944 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<%pre>
#include <vdr/plugin.h>
#include <vdr/channels.h>
#include <vdr/epg.h>
#include <vdr/config.h>
#include <vdr/i18n.h>
#include "setup.h"
#include "tools.h"
#include "epg_events.h"

using namespace std;
using namespace vdrlive;

</%pre>
<%args>
type = "now";
</%args>
<%include>page_init.eh</%include>
<{

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?");
}

}>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
	<head>
		<title>VDR-Live - <$ head $></title>
		<link rel="stylesheet" type="text/css" href="styles.css" />
		<& tooltip.javascript var=("domTT_styleClass") value=("domTTepg") &>
		<& pageelems.ajax_js &>
	</head>
	<body onload="LiveStatusAjaxRequest('infobox.html', 'infobox')">
		<& pageelems.logo &>
		<& menu active=(type) &>
		<div class="inhalt">
<{
	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) {
							string evntId("eventId_");
							evntId += lexical_cast<std::string, int>(++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();
}>
			<div class="event">
				<div class="station">
					<div><div><div><a href="schedule.html?channel=<$ Channel->Number() $>" <& tooltip.hint text=(tr("View the schedule of this channel")) &>><$ (epgEvent->Caption()) $></a></div></div></div>
				</div>
				<div class="content">
					<div class="tools">
						<& 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="" &>
%							}
					</div>
				 	<div>
						<div class="info"><$ (epgEvent->StartTime(tr("%I:%M %p"))) $> - <$ (epgEvent->EndTime(tr("%I:%M %p"))) $></div>
						<div class="title"><$ (epgEvent->Title()) $></div>
						<div class="short"><$ (epgEvent->ShortDescr()) $></div>
						<div class="description"><$ (StringWordTruncate(epgEvent->LongDescr(), 150, truncated)) $></div>
						<div class="more"<& tooltip.hint text=(StringEscapeAndBreak(StringWordTruncate(epgEvent->LongDescr(), 300, truncated)) + string("<br />") + string(tr("Click to view details."))) &><& tooltip.display domId=(epgEvent->Id()) &>><$ (string(tr("more")) + string(" ...")) $></div>
%							if (epgEvent->Elapsed() >= 0) {
						<div class="progress"><div><& pageelems.progressbar progress=(epgEvent->Elapsed()) &></div></div>
%							}
				 	</div>
				</div>
			</div>
<{
					}
				}
			}
		}
	}
}>
		</div>
		<div class="epg_data" style="display: none;">
<{
	// create hidden div for the tooltip hints.
	for (vector<EpgEventPtr>::iterator i = epgEvents.begin(); i != epgEvents.end(); ++i) {
		EpgEventPtr epg = *i;
}>
		<& 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()) &>
<{
	}
}>
		</div>

	</body>
</html>
<%include>page_exit.eh</%include>