summaryrefslogtreecommitdiff
path: root/pages/channels_widget.ecpp
blob: 5bd69b2da80eef58f02c3044b703452486438b97 (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
<%pre>
#include <vdr/channels.h>
#include "setup.h"
#include "tools.h"

using namespace vdrlive;

</%pre>
<%args>
name = "channel";
int lastChannel = LiveSetup().GetLastChannel();
selected;
onchange;
bool channelId = false;
</%args>
	
	<select name="<$ name $>" <{ reply.out() << ( !onchange.empty() ? "onchange=\""+onchange+"\"" : "" ); }>>
<{
		for (cChannel *listChannel = Channels.First(); listChannel && listChannel->Number() <= lastChannel; listChannel = Channels.Next(listChannel)) {
			if (!listChannel->GroupSep() && *listChannel->Name()) {
				std::string listChannelId = *listChannel->GetChannelID().ToString();
}>
				<option value="<? channelId ? *listChannel->GetChannelID().ToString() ?><? !channelId ? listChannel->Number() ?>" 
					<{ reply.out() << ( listChannelId == selected ? "selected=\"selected\"" : "" ); }>><$ listChannel->Name() $></option>
<{
			}
		}
}>
	</select>