summaryrefslogtreecommitdiff
path: root/pages/edit_timer.ecpp
blob: 5995a3b73e8c91875ee22b65c2f34e95281ba3db (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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
<%pre>
#include <vdr/plugin.h>
#include <vdr/config.h>
#include <vdr/i18n.h>
#include "setup.h"
#include "tools.h"
#include "timers.h"

using namespace vdrlive;

</%pre>
<%args>
timerid;
</%args>
<{
	ReadLock channelsLock( Channels );
	if (!channelsLock) 
		return DECLINED; // XXX error page

	{
		ReadLock channelsLock2( Channels );
		if (!channelsLock2)return DECLINED;
	}

	cMutexLock timersLock( &LiveTimerManager() );
	SortedTimers& timers = LiveTimerManager().GetTimers();

	cTimer* timer = 0;
	if ( !timerid.empty() ) {
		timer = timers.GetByTimerId( timerid );
		if ( timer == 0 )
			return DECLINED; // XXX error page
	}

	bool active = timer ? timer->Flags() & tfActive : true;
	std::string channel = timer ? *timer->Channel()->GetChannelID().ToString() : "";
	std::string title = timer ? timer->File() : "";
	int day = ( !timer || timer->Day() ) ? StringToInt( FormatDateTime( "%d", timer ? timer->Day() : time( 0 ) ) ) : 0;
	bool wday_mon = timer ? timer->WeekDays() & 0x01 : false;
	bool wday_tue = timer ? timer->WeekDays() & 0x02 : false;
	bool wday_wed = timer ? timer->WeekDays() & 0x04 : false;
	bool wday_thu = timer ? timer->WeekDays() & 0x08 : false;
	bool wday_fri = timer ? timer->WeekDays() & 0x10 : false;
	bool wday_sat = timer ? timer->WeekDays() & 0x20 : false;
	bool wday_sun = timer ? timer->WeekDays() & 0x40 : false;
	int start_h = timer ? ( timer->Start() / 100 ) % 100 : StringToInt( FormatDateTime( "%H", time( 0 ) ) );
	int start_m = timer ? timer->Start() % 100 : StringToInt( FormatDateTime( "%M", time( 0 ) ) );
	int end_h = timer ? ( timer->Stop() / 100 ) % 100 : StringToInt( FormatDateTime( "%H", time( 0 ) ) );
	int end_m = timer ? timer->Stop() % 100 : StringToInt( FormatDateTime( "%M", time( 0 ) ) );
	bool vps = timer ? timer->Flags() & tfVps : ::Setup.UseVps;
	int priority = timer ? timer->Priority() : ::Setup.DefaultPriority;
	int lifetime = timer ? timer->Lifetime() : ::Setup.DefaultLifetime;
}>
<html>
	<head>
		<title>VDR Live - <$ timer ? tr("Edit timer") : tr("New timer") $></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">
			<div class="head_box"><$ timer ? tr("Edit timer") : tr("New timer") $></div>
			<form name="new_timer">
				<input type="hidden" name="timerid" value="<$ timerid $>"/>
				<table>
					<tr>
						<td>Timer aktiv: </td>
						<td>
							<input name="active" value="1" <{ reply.out() << ( active ? "checked=\"checked\"" : "" ); }> type="radio">Ja
							<input name="active" value="0" <{ reply.out() << ( !active ? "checked=\"checked\"" : "" ); }> type="radio">Nein
						</td>
					</tr>
					<tr>
						<td>
							Kanal:
						</td>
						<td>
<& channels_widget name=("channel") selected=(channel) &>
						</td>
					</tr>
					
					<tr>
						<td>Titel</td>
						<td><input type="text" name="title" value="<$ title $>" size="80" /></td>
					</tr>
					
					
					<tr>
						<td>Tag der Aufnahme</td>
						<td><input type="text" name="day" value="<? day ? day ?>" size="2" maxlength="2" /></td>
					</tr>
					
					<tr>
						<td>Wochentag</td>
						<td>
							<input type="checkbox" name="wday_mon" value="1" <{ reply.out() << ( wday_mon ? "checked=\"checked\"" : "" ); }>/> Montag
							<input type="checkbox" name="wday_tue" value="1" <{ reply.out() << ( wday_tue ? "checked=\"checked\"" : "" ); }>/> Dienstag
							<input type="checkbox" name="wday_wed" value="1" <{ reply.out() << ( wday_wed ? "checked=\"checked\"" : "" ); }>/> Mittwoch
							<input type="checkbox" name="wday_thu" value="1" <{ reply.out() << ( wday_thu ? "checked=\"checked\"" : "" ); }>/> Donnerstag
							<input type="checkbox" name="wday_fri" value="1" <{ reply.out() << ( wday_fri ? "checked=\"checked\"" : "" ); }>/> Freitag
							<input type="checkbox" name="wday_sat" value="1" <{ reply.out() << ( wday_sat ? "checked=\"checked\"" : "" ); }>/> Samstag
							<input type="checkbox" name="wday_sun" value="1" <{ reply.out() << ( wday_sun ? "checked=\"checked\"" : "" ); }>/> Sonntag
						</td>
					</tr>
					
					<tr>
						<td>Startzeit:</td>
						<td><input type="text" size="2" maxlength="2" name="start_h" value="<$ start_h $>" /> : <input type="text" size="2" maxlength="2" name="start_m" value="<$ start_m $>" /></td>
					</tr>
					
					<tr>
						<td>Endzeit:</td>
						<td><input type="text" size="2" maxlength="2" name="end_h" value="<$ end_h $>" /> : <input type="text" size="2" maxlength="2" name="end_m" value="<$ end_m $>" /></td>
					</tr>
					
					<tr>
						<td>VPS verwenden</td>
						<td><input type="checkbox" name="vps" value="1" <{ reply.out() << ( vps ? "checked=\"checked\"" : "" ); }>/></td>
					</tr>

					<tr>
						<td>Priorität:</td>
						<td><input type="text" size="2" maxlength="2" name="prio" value="<$ priority $>" /></td>
					</tr>
					
					<tr>
						<td>Lebensdauer:</td>
						<td><input type="text" size="2" maxlength="2" name="life" value="<$ lifetime $>" /></td>
					</tr>
					
				</table>
			</form>
		</div>
	</body>
</html>