summaryrefslogtreecommitdiff
path: root/pages/whats_on_next.ecpp
blob: 9f3be56d3a2fdbff26021a987382f3d5caff832a (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
<%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"

using namespace vdrlive;

</%pre>
<%args>
</%args>
<{

cSchedulesLock schedulesLock;
const cSchedules* Schedules = cSchedules::Schedules(schedulesLock);


}>
<html>
	<head>
		<title>VDR-Live - <$ tr("What's on next?") $></title>
		<link rel="stylesheet" type="text/css" href="/styles.css" />
	</head>
	<body>
		<div class="left_area">
			<img src="logo.png" alt="VDR Live!" border="0" />
<& menu >
		</div>
		<div class="inhalt">
<& pageelems.header_box content=(tr("What's on next?")) &>

<{
	ReadLock channelsLock( Channels );
	if (channelsLock) {
		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 = Schedule->GetFollowingEvent();
						if (Event) {
							std::string title(Event->Title() ? Event->Title() : "");
							std::string short_description(Event->ShortText() ? Event->ShortText() : "");
							std::string description(Event->Description() ? Event->Description() : "");
							std::string start(Event->StartTime() ? FormatDateTime(tr("%I:%M %p"), Event->StartTime()) : "");
							std::string end(Event->EndTime() ? FormatDateTime(tr("%I:%M %p"), Event->EndTime()) : "");
}>
<& event_widget title=(title) short_description=(short_description) description=(description) channel_name=(Channel->Name()) start=(start) end=(end)>
<{
					}
				}
			}
		}
	}
}>
		</div>
	</body>
</html>