diff options
author | Dieter Hametner <dh (plus) vdr (at) gekrumbel (dot) de> | 2007-07-22 17:22:00 +0000 |
---|---|---|
committer | Dieter Hametner <dh (plus) vdr (at) gekrumbel (dot) de> | 2007-07-22 17:22:00 +0000 |
commit | e53dae90e2454400d57d815086c762684cf846b9 (patch) | |
tree | 90d735e7f79bc4c00029eacc647fe6c4c021d4bc | |
parent | 213b98b4f18076c8b9e42b6868beaa3a640ae4e6 (diff) | |
download | vdr-plugin-live-e53dae90e2454400d57d815086c762684cf846b9.tar.gz vdr-plugin-live-e53dae90e2454400d57d815086c762684cf846b9.tar.bz2 |
- Some changes to enhance W3C XHTML strict compatibility.
- Timer are called with epgid instead channelid and eventid.
-rw-r--r-- | css/styles.css | 13 | ||||
-rw-r--r-- | i18n.cpp | 21 | ||||
-rw-r--r-- | i18n.h | 18 | ||||
-rw-r--r-- | pages/Makefile | 2 | ||||
-rw-r--r-- | pages/channels_widget.ecpp | 2 | ||||
-rw-r--r-- | pages/edit_searchtimer.ecpp | 2 | ||||
-rw-r--r-- | pages/edit_timer.ecpp | 17 | ||||
-rw-r--r-- | pages/pageelems.ecpp | 15 | ||||
-rw-r--r-- | pages/schedule.ecpp | 13 | ||||
-rw-r--r-- | pages/searchepg.ecpp | 2 | ||||
-rw-r--r-- | 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; @@ -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", @@ -1,6 +1,7 @@ #ifndef VDR_LIVE_I18N_H #define VDR_LIVE_I18N_H +#include <string> #include <vdr/config.h> #include <vdr/i18n.h> @@ -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(); </%cpp> -<select name="<$ name $>" <{ reply.out() << ( !onchange.empty() ? "onchange=\""+onchange+"\"" : "" ); }>> +<select name="<$ name $>" id="<$ name $>" <{ reply.out() << ( !onchange.empty() ? "onchange=\""+onchange+"\"" : "" ); }>> % 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") &> <div class="inhalt"> - <form method="POST" name="edit_searchtimer" action="edit_searchtimer.ecpp"> + <form method="post" name="edit_searchtimer" action="edit_searchtimer.ecpp"> <input type="hidden" name="searchtimerid" value="<$ searchtimerid $>"/> <input type="hidden" name="blacklistids_internal" value="<$ blacklistids_internal $>" id="blacklistids_internal"/> <table class="formular" cellpadding="0" cellspacing="0"> 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; </%request> <%include>page_init.eh</%include> -<{ -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") &> <div class="inhalt"> - <form method="POST" name="edit_timer" action="edit_timer.ecpp"> + <form method="post" name="edit_timer" action="edit_timer.ecpp"> <input type="hidden" name="timerid" value="<$ timerid $>"/> <input type="hidden" name="aux" value="<$ aux $>"/> <table class="formular" cellpadding="0" cellspacing="0"> 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; +</%args> +<%cpp> tChannelID channelid; tEventID eventid; -</%args> -<%cpp> const cTimer* timer = LiveTimerManager().GetTimer(eventid, channelid); + EpgEvents::DecodeDomId(epgid, channelid, eventid); + const cTimer* timer = LiveTimerManager().GetTimer(eventid, channelid); if (timer) { </%cpp> <a href="edit_timer.html?timerid=<$ LiveTimerManager().GetTimers().GetTimerId(*timer) $>"> <img src="<$ LiveSetup().GetThemedLink("img", "record_timer.png") $>" alt="" <& tooltip.hint text=(tr("Edit this")) &> /> <%cpp> } else { </%cpp> - <a href="edit_timer.html?channelid=<$ channelid $>&eventid=<$ eventid $>"> + <a href="edit_timer.html?epgid=<$ epgid $>"> <img src="<$ LiveSetup().GetThemedLink("img", "record.png") $>" alt="" <& tooltip.hint text=(tr("Record this")) &> /> <%cpp> } </%cpp> </a> @@ -207,7 +210,7 @@ int update_status(1); EpgEvents::DecodeDomId(epgid, channelId, eventId); if (detail) { // output for vertical toolbox </%cpp> - <& pageelems.event_timer channelid=(channelId) eventid=(eventId) &> + <& pageelems.event_timer epgid=(epgid) &> <%cpp> if (elapsed > 0) { </%cpp> @@ -225,10 +228,10 @@ int update_status(1); } else { // table output </%cpp> - <td class="action leftcol <? lastCurrentChanel ? "bottomrow"?>"><& pageelems.event_timer channelid=(channelId) eventid=(eventId) &></td> + <td class="action leftcol <? lastCurrentChanel ? "bottomrow"?>"><& pageelems.event_timer epgid=(epgid) &></td> <td class="action <? lastCurrentChanel ? "bottomrow"?>"><%cpp>if (elapsed > 0) { </%cpp><& pageelems.ajax_action_href action="switch_channel" tip=(tr("Switch to this channel.")) param=(channelId) image="zap.png" alt="" &><%cpp> } </%cpp></td> <td class="action <? lastCurrentChanel ? "bottomrow"?>"><%cpp>if (LiveFeatures<features::epgsearch>().Recent()) { </%cpp><a href="searchresults.html?searchplain=<$ StringUrlEncode(title) $>"><img src="<$ LiveSetup().GetThemedLink("img", "search.png") $>" alt="" <& tooltip.hint text=(tr("Search for repeats.")) &>></img></a><%cpp> } else { </%cpp><img src="transparent.png" width="16" height="16"><%cpp> } </%cpp></td> - <td class="action <? lastCurrentChanel ? "bottomrow"?>"><a href="http://akas.imdb.com/Tsearch?title=<$ StringUrlEncode(title) $>"><img src="<$ LiveSetup().GetThemedLink("img", "imdb.png") $>" border="0" alt="" <& tooltip.hint text=(tr("Find more at the Internet Movie Database.")) &>></img></a></td> + <td class="action <? lastCurrentChanel ? "bottomrow"?>"><a href="http://akas.imdb.com/Tsearch?title=<$ StringUrlEncode(title) $>"><img src="<$ LiveSetup().GetThemedLink("img", "imdb.png") $>" alt="" <& tooltip.hint text=(tr("Find more at the Internet Movie Database.")) &>></img></a></td> <%cpp> } </%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<string>(Event->EventID()); + string epgid = EpgEvents::EncodeDomId(Channel->GetChannelID(), Event->EventID()); + // string strEventID = lexical_cast<string>(Event->EventID()); bool truncated = false; bool lastEventCurrentDay = false; @@ -124,9 +125,9 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); } </%cpp> <tr> - <td class="action leftcol <? lastEventCurrentDay ? "bottomrow" ?>"><& pageelems.event_timer channelid=(channel_id) eventid=(strEventID) &></td> + <td class="action leftcol <? lastEventCurrentDay ? "bottomrow" ?>"><& pageelems.event_timer epgid=(epgid) &></td> <td class="action <? lastEventCurrentDay ? "bottomrow" ?>"><%cpp>if (LiveFeatures<features::epgsearch>().Recent() ) { </%cpp><a href="searchresults.html?searchplain=<$ StringUrlEncode(title) $>"><img src="<$ LiveSetup().GetThemedLink("img", "search.png") $>" alt="" <& tooltip.hint text=(tr("Search for repeats.")) &>></img></a><%cpp> } else { </%cpp><img src="transparent.png" width="16" height="16"><%cpp> } </%cpp></td> - <td class="action <? lastEventCurrentDay ? "bottomrow" ?>"><a href="http://akas.imdb.com/Tsearch?title=<$ StringUrlEncode(title) $>"><img src="<$ LiveSetup().GetThemedLink("img", "imdb.png") $>" border="0" alt="" <& tooltip.hint text=(tr("Find more at the Internet Movie Database.")) &>></img></a></td> + <td class="action <? lastEventCurrentDay ? "bottomrow" ?>"><a href="http://akas.imdb.com/Tsearch?title=<$ StringUrlEncode(title) $>"><img src="<$ LiveSetup().GetThemedLink("img", "imdb.png") $>" alt="" <& tooltip.hint text=(tr("Find more at the Internet Movie Database.")) &>></img></a></td> <td class="topaligned <? lastEventCurrentDay ? "bottomrow" ?>"><div class="withmargin"><$ start $> - <$ end $></div></td> <td class="<? (Event == PresentEvent) ? "current" ?> topaligned rightcol <? lastEventCurrentDay ? "bottomrow" ?>"><div class="more withmargin"><a <& tooltip.hint text=(StringEscapeAndBreak(StringWordTruncate(description, 300, truncated)) + "<br />" + tr("Click to view details.")) &><& tooltip.display domId=(epgEvent->Id()) &>><span class="title"><$ title $></span><br /><span class="short"><%cpp>if (short_description.empty()) { </%cpp> <%cpp> } </%cpp><$ short_description $></span></a></div></td> </tr> @@ -143,5 +144,5 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); <%include>page_exit.eh</%include> <%def channel_selection> -<form name="channels" id="channels"><span><$ tr("Show schedule of channel") $>: </span><& channels_widget name=("channel") selected=(Channel ? *Channel->GetChannelID().ToString() : "") onchange=("document.forms.channels.submit()") &></form> +<form action="." method="get" id="channels"><div><label for="channel"><$ tr("Show schedule of channel") $>: </label><& channels_widget name=("channel") selected=(Channel ? *Channel->GetChannelID().ToString() : "") onchange=("document.forms.channels.submit()") &></div></form> </%def> 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") &> <div class="inhalt"> - <form method="POST" name="searchepg" action="searchepg.ecpp"> + <form method="post" name="searchepg" action="searchepg.ecpp"> <input type="hidden" name="blacklistids_internal" value="<$ blacklistids_internal $>" id="blacklistids_internal"/> <table class="formular" cellpadding="0" cellspacing="0"> <tr class="head"> 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") $> % } - <table class="listing" cellspacing="0" callpadding="0"> + <table class="listing" cellspacing="0" cellpadding="0"> <%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; % } <tr> - <td class="action leftcol <? bottom ? "bottomrow"?>"><& pageelems.event_timer channelid=(channel_id) eventid=(event)&></td> + <td class="action leftcol <? bottom ? "bottomrow"?>"><& pageelems.event_timer epgid=(epgid) &></td> <td class="topaligned <? bottom ? "bottomrow"?>"><div class="withmargin"><a href="schedule.html?channel=<$ channelnr $>"><$ channelname $></a></div></td> <td class="topaligned <? bottom ? "bottomrow"?>"><div class="withmargin"><$ start $> - <$ end $></div></td> - <td class="topaligned rightcol <? bottom ? "bottomrow"?>"><div class="more withmargin"><a <& tooltip.hint text=(StringEscapeAndBreak(StringWordTruncate(description, 300, truncated)) + "<br />" + tr("Click to view details.")) &><& tooltip.display domId=(epgDomId) &>><span class="title"><$ result->Title() $></span><br /><span class="short"><%cpp>if (result->ShortText().empty()) { </%cpp> <%cpp> } </%cpp><$ result->ShortText() $></span></a></div></td> + <td class="topaligned rightcol <? bottom ? "bottomrow"?>"><div class="more withmargin"><a <& tooltip.hint text=(StringEscapeAndBreak(StringWordTruncate(description, 300, truncated)) + "<br />" + tr("Click to view details.")) &><& tooltip.display domId=(epgid) &>><span class="title"><$ result->Title() $></span><br /><span class="short"><%cpp>if (result->ShortText().empty()) { </%cpp> <%cpp> } </%cpp><$ result->ShortText() $></span></a></div></td> </tr> % } </table> |