From 71250cd7abb9ee93f39e1db506a5dafcca699349 Mon Sep 17 00:00:00 2001 From: Christian Wieninger Date: Sat, 26 May 2007 08:08:12 +0000 Subject: - some i18n fixes - added an input field for arbitrary time --- pages/whats_on.ecpp | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/pages/whats_on.ecpp b/pages/whats_on.ecpp index ed7ff99..5015f67 100644 --- a/pages/whats_on.ecpp +++ b/pages/whats_on.ecpp @@ -15,7 +15,7 @@ using namespace vdrlive; <%args> type = "now"; string attime; -time_t seektime = 0; + <%session scope="global"> bool logged_in(false); @@ -29,15 +29,17 @@ cSchedulesLock schedulesLock; const cSchedules* Schedules = cSchedules::Schedules(schedulesLock); string head; +time_t seektime = 0; + 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") { seektime = GetTimeT(attime); - if (seektime - time(0) + 3600 < 0) - seektime += 24 * 60 * 60; - head = tr("What's running at")+string(" ")+FormatDateTime(tr("%a, %b %d"), seektime) + string(" ") + FormatDateTime(tr("%I:%M %p"), seektime); + 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,6 +56,11 @@ if (type == "now") { if (selection.options[selection.selectedIndex].value != "") window.location.href = "whats_on.html?type=at&attime=" + selection.options[selection.selectedIndex].value; } + function showspectime(selection) + { + if (selection.value != "") + window.location.href = "whats_on.html?type=at&attime=" + selection.value; + } //--> @@ -62,13 +69,7 @@ if (type == "now") {
<{ EpgEvents epgEvents; - time_t seektime = 0; - if (type == "at") - { - seektime = GetTimeT(attime); - if (seektime - time(0) + 3600 < 0) - seektime += 24 * 60 * 60; - } + ReadLock channelsLock( Channels ); if (channelsLock) { int evntNr = 0; @@ -146,8 +147,11 @@ if (type == "now") { <%include>page_exit.eh <%def whats_on_actions> -<$ tr("Now") $>   -<$ tr("Next") $>   +<$ tr("Now") $> +| +<$ tr("Next") $> +| +<$ tr("What's on") $> +| +<$ tr("at") $> + -- cgit v1.2.3