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

#include "livefeatures.h"
#include "setup.h"
#include "i18n.h"
#include "timerconflict.h"

using namespace std;
using namespace vdrlive;

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

set_active = active;
if (!component.empty()) {
	set_component = component;
}

</%cpp>
<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") &>><$ trVDR("Schedule") $></a>
	| <a href="timers.html" <& menu.setactive current=("timers") &>><$ trVDR("Timers") $></a>
<%cpp>
if ( LiveFeatures< features::epgsearch >().Recent() ) {
</%cpp>
	| <a href="searchepg.html" <& menu.setactive current=("searchepg") &>><$ tr("Search") $></a>
	| <a href="searchtimers.html" <& menu.setactive current=("searchtimers") &>><$ tr("Searchtimers") $></a>
<%cpp>
}
</%cpp>
	| <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") &>><$ trVDR("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>
--- #>
<%cpp>
if (LiveSetup().UseAuth()) {
</%cpp>
	| <a id="login" href="login.html?action=logout"><$ tr("Logout") $></a>
<%cpp>
}
</%cpp>
	| <a <& tooltip.display domId=("aboutBox") &>>?</a>
</div>
<div id="messagebar" class="<? !timerNotifier.ShouldNotify() ? "notpresent" ?>">
  <div> <!-- outer -->
	<div><!-- inner -->
	  <$ tr("Your attention is required") $>:
	  <span id="mbmessage"><$ timerNotifier.Message() $></span>
	  <a id="mbreact" href="<$ timerNotifier.Url() $>"><$ tr("React") $></a>
<%cpp>
if (LiveSetup().GetUseAjax()) {
</%cpp>
      <span id="mbdelimiter" class="<? timerNotifier.Url().empty() ? "notpresent" ?>">|</span>
	  <span id="mbdismiss"><a href="" onclick="$('messagebar').addClass('notpresent'); return false"><$ tr("Dismiss") $></a></span>
<%cpp>
}
</%cpp>
    </div>
  </div>
</div>
<%cpp>
if (!component.empty()) {
</%cpp>
<div id="pagemenu">
  <div> <!-- outer -->
    <div> <!-- inner -->
	  <& menu.component current=("whats_on") &>
	  <& menu.component current=("schedule") &>
	  <& menu.component current=("timers") &>
<%cpp>
	if (LiveFeatures< features::epgsearch >().Recent()) {
</%cpp>
	  <& menu.component current=("search") &>
	  <& menu.component current=("searchtimers") &>
<%cpp>
	}
</%cpp>
	  <& menu.component current=("recordings") &>
	  <& menu.component current=("remote") &>
    </div>
  </div>
</div>
<%cpp>
}
</%cpp>

<%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>