summaryrefslogtreecommitdiff
path: root/pages/menu.ecpp
blob: ff420457d4f08583fd0bb84c156617d7be30b015 (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
<%pre>
#include <string>
#include <vdr/plugin.h>
#include <vdr/config.h>
#include "livefeatures.h"
#include "setup.h"

using namespace std;
using namespace vdrlive;

</%pre>
<%args>
active;
component;
</%args>
<%session scope="global">
bool logged_in(false);
</%session>
<%request scope="page">
std::string set_active;
std::string set_component;
</%request>
<{
if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html");
}>
<{

	using namespace vdrlive;

	set_active = active;
	if (!component.empty())
		set_component = component;
}>
<div class="menu">
	  <a href="whats_on.html?type=now" <& menu.setactive current=("whats_on") &>><$ tr("What's on?") $></a>
	| <a href="schedule.html" <& menu.setactive current=("schedule") &>><$ tr("Schedule") $></a>
	| <a href="timers.html" <& menu.setactive current=("timers") &>><$ tr("Timers") $></a>
% if ( LiveFeatures< features::epgsearch >().Recent() ) {
	| <a href="searchepg.html" <& menu.setactive current=("searchepg") &>><$ tr("Search") $></a>
	| <a href="searchtimers.html" <& menu.setactive current=("searchtimers") &>><$ tr("Searchtimers") $></a>
% }
	| <a href="recordings.html" <& menu.setactive current=("recordings") &>><$ tr("Recordings") $></a>
	| <a href="remote.html" <& menu.setactive current=("remote") &>><$ tr("Remote Control") $></a>
	| <a href="setup.html" <& menu.setactive current=("setup") &>><$ tr("Setup") $></a>
<# --- Used by D.H. to test infobox (not part of the released version)
	| <a href="ibox_status.html" <& menu.setactive current=("status") &>><$ tr("Status Test") $></a>
--- #>
% if (LiveSetup().UseAuth()) {
	| <a id="login" href="login.html?action=logout"><$ tr("Logout") $></a>
% }
	| <a <& tooltip.display domId=("aboutBox") &>>?</a>
</div>
% if (!component.empty()) {
<div class="pagemenu">
 <div> <!-- outer -->
  <div> <!-- inner -->
	<& menu.component current=("whats_on") &>
	<& menu.component current=("schedule") &>
	<& menu.component current=("timers") &>
% if ( LiveFeatures< features::epgsearch >().Recent() ) {
	<& menu.component current=("search") &>
	<& menu.component current=("searchtimers") &>
% }
	<& menu.component current=("recordings") &>
	<& menu.component current=("remote") &>
  </div>
 </div>
</div>
% }

<%def setactive>
<%args>
current;
</%args>
<%cpp> if (current== set_active) { </%cpp>class="active"<%cpp> } </%cpp>
</%def>

<%def component>
<%args>
current;
</%args>
<%cpp> if ((current== set_active) && (!set_component.empty())) { </%cpp><& (set_component) &><%cpp> } </%cpp>
</%def>