summaryrefslogtreecommitdiff
path: root/pages/whats_on.ecpp
diff options
context:
space:
mode:
Diffstat (limited to 'pages/whats_on.ecpp')
-rw-r--r--pages/whats_on.ecpp26
1 files changed, 22 insertions, 4 deletions
diff --git a/pages/whats_on.ecpp b/pages/whats_on.ecpp
index a28b381..7e27bc8 100644
--- a/pages/whats_on.ecpp
+++ b/pages/whats_on.ecpp
@@ -15,6 +15,7 @@ using namespace vdrlive;
<%args>
type = "now";
string attime;
+string fixtime;
</%args>
<%session scope="global">
@@ -30,14 +31,19 @@ const cSchedules* Schedules = cSchedules::Schedules(schedulesLock);
string head;
time_t seektime = 0;
+string displaytime;
if (type == "now") {
head = tr("What's running at")+string(" ")+FormatDateTime(tr("%I:%M %p"), time(0));
} else if (type == "next") {
head = tr("What's on next?");
} else if (type == "at") {
- attime = ExpandTimeString(attime);
- seektime = GetTimeT(attime);
+ if (attime != "")
+ displaytime = ExpandTimeString(attime);
+ else if (fixtime != "")
+ displaytime = ExpandTimeString(fixtime);
+
+ seektime = GetTimeT(displaytime);
if (seektime - time(0) + 3600 < 0) // if wanted time is past more then 1h, then use tomorrow
seektime += SECSINDAY;
head = tr("What's running at") + string(" ") + FormatDateTime(tr("%I:%M %p"), seektime) +string(" (") +FormatDateTime(tr("%a, %b %d"), seektime) + string(")");
@@ -54,12 +60,24 @@ if (type == "now") {
<script type="text/javascript"><!--
function init()
{
- document.getElementById("spectime").value = "<$ attime $>";
+% if (attime != "") {
+ document.getElementById("spectime").value = "<$ attime $>";
+% }
+<{
+ if (fixtime != "") {
+ vector< string > parts = StringSplit( LiveSetup().GetTimes(), ';' );
+ vector< string >::const_iterator part = parts.begin();
+ for ( int i = 0; part != parts.end(); ++i, ++part ) {
+ if (*part == fixtime) {
+}>
+ document.getElementById("userdeftimes").options[<$ i+1 $>].selected = true;
+<{ }}}
+}>
}
function showtime(selection)
{
if (selection.options[selection.selectedIndex].value != "")
- window.location.href = "whats_on.html?type=at&attime=" + selection.options[selection.selectedIndex].value;
+ window.location.href = "whats_on.html?type=at&fixtime=" + selection.options[selection.selectedIndex].value;
}
function showspectime(selection)
{