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

using namespace vdrlive;
using namespace std;

</%pre>
<%args>
	// input parameters
	string searchtimerid;
	string action;
</%args>
<%session scope="global">
bool logged_in(false);
</%session>
<%include>page_init.eh</%include>
<%cpp>
if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html");
</%cpp>
<%cpp>
	pageTitle = tr("Searchtimers");
	SearchTimers timers;
	if ( !searchtimerid.empty() ) {
		if (action == "toggle")
			timers.ToggleActive(searchtimerid);
		if (action == "delete")
			timers.Delete(searchtimerid);
	}
	if (action == "update")
		timers.TriggerUpdate();
</%cpp>
<& pageelems.doc_type &>
<html>
	<head>
		<title>VDR-Live - <$ pageTitle $></title>
		<& pageelems.stylesheets &>
		<& pageelems.ajax_js &>
	</head>
	<body>
		<& pageelems.logo &>
		<& menu active=("searchtimers") component=("searchtimers.searchtimer_actions")>
		<div class="inhalt">
			<table class="listing" cellspacing="0" cellpadding="0">
				<tr class="head">
					<td colspan="8">
						<div class="boxheader"><div><div><$ pageTitle $></div></div></div>
					</td>
				</tr>
				<tr class="description">
					<td class="action leftcol"><img src="img/transparent.png" alt="" width="16px" height="16px"/></td>
					<td><div class="withmargin"><$ tr("Expression") $></div></td>
					<td><div class="withmargin"><$ tr("Channel") $></div></td>
					<td><div class="withmargin"><$ tr("Starts between") $></div></td>
					<td class="rightcol" colspan="4"/>
				</tr>
<%cpp>
				for (SearchTimers::iterator timer = timers.begin(); timer != timers.end(); ++timer) {
					SearchTimers::iterator nextTimer = timer; ++nextTimer;
					bool bottom = (nextTimer == timers.end());
</%cpp>
				<tr>
					<td class="action leftcol <? bottom ? "bottomrow" ?>"><%cpp> if(timer->UseAsSearchTimer()) { </%cpp><img src="<$ LiveSetup().GetThemedLink("img", "arrow.png") $>" alt=""></img><%cpp> } </%cpp></td>
					<td class="<? bottom ? "bottomrow" ?>"><div class="withmargin"><$ timer->Search() $></div></td>
					<td class="<? bottom ? "bottomrow" ?>"><div class="withmargin"><$ timer->ChannelText() $></div></td>
					<td class="<? bottom ? "bottomrow" ?>"><div class="withmargin"><? timer->UseTime() ? timer->StartTimeFormatted()+" - "+timer->StopTimeFormatted() ?></div></td>
					<td class="action <? bottom ? "bottomrow" ?>"><a href="searchtimers.html?searchtimerid=<$ timer->Id() $>&action=toggle"><img src="<$ LiveSetup().GetThemedLink("img", timer->UseAsSearchTimer() ? "active.png" : "inactive.png") $>" alt="<$ tr("Toggle search timer actions (in)active") $>" <& tooltip.hint text=(tr("Toggle search timer actions (in)active")) &>></img></a></td>
					<td class="action <? bottom ? "bottomrow" ?>"><a href="searchresults.html?searchtimerid=<$ timer->Id() $>"><img src="<$ LiveSetup().GetThemedLink("img", "search.png") $>" alt="<$ tr("Browse search timer results") $>" <& tooltip.hint text=(tr("Browse search timer results")) &>></img></a></td>
					<td class="action <? bottom ? "bottomrow" ?>"><a href="edit_searchtimer.html?searchtimerid=<$ timer->Id() $>"><img src="<$ LiveSetup().GetThemedLink("img", "edit.png") $>" alt="<$ tr("Edit search timer") $>" <& tooltip.hint text=(tr("Edit search timer")) &>></img></a></td>
					<td class="action rightcol <? bottom ? "bottomrow" ?>"><a href="searchtimers.html?searchtimerid=<$ timer->Id() $>&action=delete" onclick="return confirm('<$ tr("Delete this search timer?") $>')"><img src="<$ LiveSetup().GetThemedLink("img", "del.png") $>" alt="<$ tr("Delete search timer") $>" <& tooltip.hint text=(tr("Delete search timer")) &>></img></a></td>
				</tr>
<%cpp>
				}
</%cpp>
				<tr class="spacer">
					<td colspan="8"/>
				</tr>
			</table>
		</div>
	</body>
</html>
<%include>page_exit.eh</%include>

<%def searchtimer_actions>
<a href="edit_searchtimer.html"><$ tr("New search timer") $></a>
<span class="sep">|</span>
<a href="searchtimers.html?action=update"><$ tr("Trigger search timer update") $></a>
</%def>