From e53dae90e2454400d57d815086c762684cf846b9 Mon Sep 17 00:00:00 2001 From: Dieter Hametner Date: Sun, 22 Jul 2007 17:22:00 +0000 Subject: - Some changes to enhance W3C XHTML strict compatibility. - Timer are called with epgid instead channelid and eventid. --- css/styles.css | 13 ++++++++++++- i18n.cpp | 21 ++++++++++++++++++++- i18n.h | 18 +++++++----------- pages/Makefile | 2 +- pages/channels_widget.ecpp | 2 +- pages/edit_searchtimer.ecpp | 2 +- pages/edit_timer.ecpp | 17 ++++++++++------- pages/pageelems.ecpp | 15 +++++++++------ pages/schedule.ecpp | 13 +++++++------ pages/searchepg.ecpp | 2 +- pages/searchresults.ecpp | 10 ++++------ 11 files changed, 73 insertions(+), 42 deletions(-) diff --git a/css/styles.css b/css/styles.css index 516ef4f..df41207 100644 --- a/css/styles.css +++ b/css/styles.css @@ -21,6 +21,11 @@ tr, td { padding-bottom: 0px; } +form { + margin: 0; + padding: 0; +} + input { border: 1px solid #6D96A9; font-size: 11px; @@ -301,7 +306,7 @@ div.pagemenu { } div.pagemenu div { - padding-bottom: 6px; + /* padding-bottom: 6px; */ background: #FFFFFF url(bg_line_top.png) bottom repeat-x; } @@ -312,6 +317,12 @@ div.pagemenu div div { border-bottom: 1px solid #C0C1DA; } +div.pagemenu div div div { + border: 0; + padding: 0; + margin: 0; +} + div.pagemenu a { color: black; font-weight: bold; diff --git a/i18n.cpp b/i18n.cpp index 1545298..d8ba2e3 100644 --- a/i18n.cpp +++ b/i18n.cpp @@ -4,7 +4,7 @@ extended version of i18n.cpp. (If you would like to submit a patch add more context like described below) - $Id: i18n.cpp,v 1.98 2007/07/21 17:52:41 tadi Exp $ + $Id: i18n.cpp,v 1.99 2007/07/22 17:22:00 tadi Exp $ Note to developers: How to safely integrate translations from third parties: @@ -36,6 +36,25 @@ I18n& LiveI18n() return instance; } +I18n::I18n() + : m_encoding( +#if VDRVERSNUM >= 10503 + cCharSetConv::SystemCharacterTable() ? cCharSetConv::SystemCharacterTable() : "UTF-8" +#else + I18nCharSets()[::Setup.OSDLanguage] +#endif + ) +{ + // fix encoding spelling for html standard. + std::string const iso("iso"); + if (m_encoding.find(iso) != std::string::npos) { + if (iso.length() == m_encoding.find_first_of("0123456789")) { + m_encoding.insert(iso.length(), "-"); + } + } +} + + const tI18nPhrase Phrases[] = { { "Live Interactive VDR Environment", "Live Interactive VDR Environment", diff --git a/i18n.h b/i18n.h index 25ba0a3..14478af 100644 --- a/i18n.h +++ b/i18n.h @@ -1,6 +1,7 @@ #ifndef VDR_LIVE_I18N_H #define VDR_LIVE_I18N_H +#include #include #include @@ -10,19 +11,14 @@ class I18n { friend I18n& LiveI18n(); - char const* m_encoding; + private: + std::string m_encoding; - I18n( I18n const& ); // don't copy - I18n() : m_encoding( -#if VDRVERSNUM >= 10503 - cCharSetConv::SystemCharacterTable() ? cCharSetConv::SystemCharacterTable() : "UTF-8" -#else - I18nCharSets()[::Setup.OSDLanguage] -#endif - ) {} + I18n( I18n const& ); // don't copy + I18n(); -public: - char const* CharacterEncoding() const { return m_encoding; } + public: + std::string const& CharacterEncoding() const { return m_encoding; } }; I18n& LiveI18n(); diff --git a/pages/Makefile b/pages/Makefile index fde3974..09dfd63 100644 --- a/pages/Makefile +++ b/pages/Makefile @@ -54,4 +54,4 @@ libpages.a: $(OBJS) $(AR) r $@ $^ clean: - @rm -f *~ *.o core* libpages.a $(OBJS:%.o=%.cpp) + @rm -f *~ *.o core* libpages.a $(OBJS:%.o=%.cpp) $(DEPFILE) diff --git a/pages/channels_widget.ecpp b/pages/channels_widget.ecpp index fcf8321..5bfe490 100644 --- a/pages/channels_widget.ecpp +++ b/pages/channels_widget.ecpp @@ -26,7 +26,7 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); int lastChannel = LiveSetup().GetLastChannel(); -> % for ( cChannel *listChannel = Channels.First(); listChannel && listChannel->Number() <= lastChannel; listChannel = Channels.Next( listChannel ) ) { % if ( listChannel->GroupSep() || *listChannel->Name() == '\0' ) % continue; diff --git a/pages/edit_searchtimer.ecpp b/pages/edit_searchtimer.ecpp index 4d27b59..9fd1c02 100644 --- a/pages/edit_searchtimer.ecpp +++ b/pages/edit_searchtimer.ecpp @@ -453,7 +453,7 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); <& pageelems.logo &> <& menu active=("searchtimers") &>
-
+ diff --git a/pages/edit_timer.ecpp b/pages/edit_timer.ecpp index 6bf3b9c..c389a6d 100644 --- a/pages/edit_timer.ecpp +++ b/pages/edit_timer.ecpp @@ -8,6 +8,7 @@ #include "tools.h" #include "timers.h" #include "setup.h" +#include "epg_events.h" using namespace std; using namespace vdrlive; @@ -16,8 +17,7 @@ using namespace vdrlive; <%args> // input parameters string timerid; - tChannelID channelid; - tEventID eventid = 0; + string epgid; // form parameters tChannelID channel; bool active = true; @@ -47,11 +47,13 @@ string edit_timerreferer; cTimer* timer; <%include>page_init.eh -<{ -if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); -}> <%cpp> - std::string message; + if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); + + tChannelID channelid = tChannelID(); + tEventID eventid = tEventID(); + + string message; cMutexLock timersLock( &LiveTimerManager() ); SortedTimers& timers = LiveTimerManager().GetTimers(); @@ -84,6 +86,7 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); auto_ptr< cTimer > eventTimer; if ( timer == 0 ) { + EpgEvents::DecodeDomId(epgid, channelid, eventid); if ( channelid.Valid() && eventid != 0 ) { cerr << "grabbing event" << endl << endl; cSchedulesLock schedLock; @@ -132,7 +135,7 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); <& pageelems.logo &> <& menu active=("timers") &>
- +
diff --git a/pages/pageelems.ecpp b/pages/pageelems.ecpp index 2cff427..277d84c 100644 --- a/pages/pageelems.ecpp +++ b/pages/pageelems.ecpp @@ -119,16 +119,19 @@ int update_status(1); <%def event_timer> <%args> + string epgid; + +<%cpp> tChannelID channelid; tEventID eventid; - -<%cpp> const cTimer* timer = LiveTimerManager().GetTimer(eventid, channelid); + EpgEvents::DecodeDomId(epgid, channelid, eventid); + const cTimer* timer = LiveTimerManager().GetTimer(eventid, channelid); if (timer) { " alt="" <& tooltip.hint text=(tr("Edit this")) &> /> <%cpp> } else { - + " alt="" <& tooltip.hint text=(tr("Record this")) &> /> <%cpp> } @@ -207,7 +210,7 @@ int update_status(1); EpgEvents::DecodeDomId(epgid, channelId, eventId); if (detail) { // output for vertical toolbox - <& pageelems.event_timer channelid=(channelId) eventid=(eventId) &> + <& pageelems.event_timer epgid=(epgid) &> <%cpp> if (elapsed > 0) { @@ -225,10 +228,10 @@ int update_status(1); } else { // table output - + - + <%cpp> } diff --git a/pages/schedule.ecpp b/pages/schedule.ecpp index f427a53..f7560dd 100644 --- a/pages/schedule.ecpp +++ b/pages/schedule.ecpp @@ -78,8 +78,8 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); string current_day = ""; const cEvent* PresentEvent = Schedule->GetPresentEvent(); time_t now = time(NULL) - ::Setup.EPGLinger * 60; - tChannelID channel_id(Channel->GetChannelID()); - int evntNr = 0; + // tChannelID channel_id(Channel->GetChannelID()); + // int evntNr = 0; for (const cEvent *Event = Schedule->Events()->First(); Event; Event = Schedule->Events()->Next(Event)) { if (Event->EndTime() <= now && Event != PresentEvent) continue; @@ -92,7 +92,8 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); string start(epgEvent->StartTime(tr("%I:%M %p"))); string end(epgEvent->EndTime(tr("%I:%M %p"))); string day(epgEvent->StartTime(tr("%A, %b %d %Y"))); - string strEventID = lexical_cast(Event->EventID()); + string epgid = EpgEvents::EncodeDomId(Channel->GetChannelID(), Event->EventID()); + // string strEventID = lexical_cast(Event->EventID()); bool truncated = false; bool lastEventCurrentDay = false; @@ -124,9 +125,9 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); } - + - + @@ -143,5 +144,5 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); <%include>page_exit.eh <%def channel_selection> -<$ tr("Show schedule of channel") $>: <& channels_widget name=("channel") selected=(Channel ? *Channel->GetChannelID().ToString() : "") onchange=("document.forms.channels.submit()") &> +
<& channels_widget name=("channel") selected=(Channel ? *Channel->GetChannelID().ToString() : "") onchange=("document.forms.channels.submit()") &>
diff --git a/pages/searchepg.ecpp b/pages/searchepg.ecpp index f885d4e..2331074 100644 --- a/pages/searchepg.ecpp +++ b/pages/searchepg.ecpp @@ -251,7 +251,7 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); <& pageelems.logo &> <& menu active=("searchepg") &>
-
+
"><& pageelems.event_timer channelid=(channelId) eventid=(eventId) &>"><& pageelems.event_timer epgid=(epgid) &> "><%cpp>if (elapsed > 0) { <& pageelems.ajax_action_href action="switch_channel" tip=(tr("Switch to this channel.")) param=(channelId) image="zap.png" alt="" &><%cpp> } "><%cpp>if (LiveFeatures().Recent()) { " alt="" <& tooltip.hint text=(tr("Search for repeats.")) &>><%cpp> } else { <%cpp> } ">" border="0" alt="" <& tooltip.hint text=(tr("Find more at the Internet Movie Database.")) &>>">" alt="" <& tooltip.hint text=(tr("Find more at the Internet Movie Database.")) &>>
"><& pageelems.event_timer channelid=(channel_id) eventid=(strEventID) &>"><& pageelems.event_timer epgid=(epgid) &> "><%cpp>if (LiveFeatures().Recent() ) { " alt="" <& tooltip.hint text=(tr("Search for repeats.")) &>><%cpp> } else { <%cpp> } ">" border="0" alt="" <& tooltip.hint text=(tr("Find more at the Internet Movie Database.")) &>>">" alt="" <& tooltip.hint text=(tr("Find more at the Internet Movie Database.")) &>> ">
<$ start $> - <$ end $>
topaligned rightcol ">
diff --git a/pages/searchresults.ecpp b/pages/searchresults.ecpp index dda0d12..dce7520 100644 --- a/pages/searchresults.ecpp +++ b/pages/searchresults.ecpp @@ -56,7 +56,7 @@ bool logged_in(false); % if (results.size() == 0) { <$ tr("No search results") $> % } -
+
<%cpp> string current_day = ""; @@ -66,10 +66,8 @@ bool logged_in(false); string start(result->StartTime() ? FormatDateTime(tr("%I:%M %p"), result->StartTime()) : ""); string end(result->StopTime() ? FormatDateTime(tr("%I:%M %p"), result->StopTime()) : ""); string day(result->StartTime() ? FormatDateTime(tr("%A, %b %d %Y"), result->StartTime()) : ""); - tEventID event = result->EventId(); - tChannelID channel_id(result->Channel()); string description = result->Description(); - string epgDomId(EpgEvents::EncodeDomId(result->Channel(), event)); + string epgid = EpgEvents::EncodeDomId(result->Channel(), result->EventId()); bool truncated = false; @@ -95,10 +93,10 @@ bool logged_in(false); % current_day = day; % } - + - + % }
"><& pageelems.event_timer channelid=(channel_id) eventid=(event)&>"><& pageelems.event_timer epgid=(epgid) &> "> ">
<$ start $> - <$ end $>
">">
-- cgit v1.2.3