From 4bb2cc172549bcf9f86a94e5d3d0d5ade5f91dfe Mon Sep 17 00:00:00 2001 From: Dieter Hametner Date: Thu, 31 May 2007 23:44:01 +0000 Subject: - Added doc/ChangeLog - Added doc/css-themeing.txt - Implemented support for site wide style overrides. Fixes Bug #339 - Updated all pages to use the override mechanism. - Added needed files to Makefile - Introduced USRDIR configuration variable to Makefile. --- pages/Makefile | 4 ++-- pages/content.ecpp | 17 +++++++++++---- pages/edit_searchtimer.ecpp | 50 ++++++++++++++++++++++----------------------- pages/edit_timer.ecpp | 2 +- pages/error.ecpp | 10 +++------ pages/login.ecpp | 2 +- pages/pageelems.ecpp | 7 +++++++ pages/recordings.ecpp | 2 +- pages/remote.ecpp | 2 +- pages/schedule.ecpp | 2 +- pages/searchepg.ecpp | 4 ++-- pages/searchresults.ecpp | 10 ++++----- pages/searchtimers.ecpp | 2 +- pages/setup.ecpp | 6 +++--- pages/timers.ecpp | 2 +- pages/whats_on.ecpp | 6 +++--- 16 files changed, 70 insertions(+), 58 deletions(-) (limited to 'pages') diff --git a/pages/Makefile b/pages/Makefile index 55cb633..da62cb8 100644 --- a/pages/Makefile +++ b/pages/Makefile @@ -22,7 +22,7 @@ OBJS = menu.o channels.o recordings.o schedule.o \ searchtimers.o edit_searchtimer.o searchresults.o \ searchepg.o login.o ibox.o xmlresponse.o \ play_recording.o pause_recording.o stop_recording.o \ - ffw_recording.o rwd_recording.o setup.o + ffw_recording.o rwd_recording.o setup.o content.o ### Default rules: @@ -53,4 +53,4 @@ libpages.a: $(OBJS) $(AR) r $@ $^ clean: - @rm -f *~ *.o core* libpages.a $(OBJS:%.o=%.cpp) $(DEPFILE) + @rm -f *~ *.o core* libpages.a $(OBJS:%.o=%.cpp) diff --git a/pages/content.ecpp b/pages/content.ecpp index 666b5a6..1390b08 100644 --- a/pages/content.ecpp +++ b/pages/content.ecpp @@ -15,12 +15,21 @@ bool logged_in(false); <%cpp> //if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); -reply.setContentType("image/png"); +string mime("image/png"); +if (request.getArgsCount() > 0) { + mime = request.getArg(0); + dsyslog("vdrlive::content found mime arg (%s)", mime.c_str()); +} +reply.setContentType(mime); +dsyslog("vdrlive::content::mimetype(%s)", mime.c_str()); -FileCache::ptr_type f = LiveFileCache().get("/tmp/live/" + request.getPathInfo()); -if (f.get() == 0) - throw tnt::NotFoundException(request.getUrl()); +// FileCache::ptr_type f = LiveFileCache().get("/tmp/live/" + request.getPathInfo()); +string path(request.getPathInfo()); +FileCache::ptr_type f = LiveFileCache().get(USRDIR "/" + path); +if (f.get() == 0) { + throw tnt::NotFoundException(request.getUrl()); +} string ctime = tnt::HttpMessage::htdate(f->ctime()); string browserTime = request.getHeader(tnt::httpheader::ifModifiedSince); if (browserTime == ctime) diff --git a/pages/edit_searchtimer.ecpp b/pages/edit_searchtimer.ecpp index 3049e94..75d2e6a 100644 --- a/pages/edit_searchtimer.ecpp +++ b/pages/edit_searchtimer.ecpp @@ -127,7 +127,7 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); infos.push_back(os.str()); } searchtimer.SetExtEPGInfo(infos); - } + } searchtimer.SetUseChannel((SearchTimer::eUseChannel)usechannel); if (usechannel == SearchTimer::Interval) { @@ -136,19 +136,19 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); } if (usechannel == SearchTimer::Group) searchtimer.SetChannelText(changrpsel); - + searchtimer.SetUseTime(usetime); if (usetime) { searchtimer.SetStartTime(StringToInt(start_h) * 100 + StringToInt(start_m)); searchtimer.SetStopTime(StringToInt(stop_h) * 100 + StringToInt(stop_m)); - } + } searchtimer.SetUseDuration(useduration); if (useduration) { searchtimer.SetMinDuration(durationmin); searchtimer.SetMaxDuration(durationmax); - } + } searchtimer.SetUseDayOfWeek(useweekday); if (useweekday) { @@ -164,7 +164,7 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); } searchtimer.SetUseInFavorites(useinfavorites); searchtimer.SetUseAsSearchTimer(useassearchtimer); - searchtimer.SetSearchTimerAction(searchtimeraction); + searchtimer.SetSearchTimerAction(searchtimeraction); searchtimer.SetUseSeriesRecording(seriesrecording); searchtimer.SetDirectory(directory); searchtimer.SetDelRecsAfterDays(delrecafterdays); @@ -173,8 +173,8 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); searchtimer.SetBlacklistMode(blacklistmode); if (blacklistmode == 1) searchtimer.ParseBlacklist(blacklistids_internal); - - searchtimer.SetSwitchMinBefore(switchminbefore); + + searchtimer.SetSwitchMinBefore(switchminbefore); searchtimer.SetAvoidRepeats(avoidrepeats); if (avoidrepeats) { @@ -183,8 +183,8 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); searchtimer.SetCompareTitle(comparetitle); searchtimer.SetCompareSubtitle(comparesubtitle); searchtimer.SetCompareSummary(comparesummary); - } - unsigned long catsselected = 0; + } + unsigned long catsselected = 0; for (unsigned int i=0; i< avoidrepeatscatselected.size(); i++) catsselected |= (1<< (avoidrepeatscatselected[i]-1)); searchtimer.SetCompareCategories(catsselected); @@ -193,10 +193,10 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); searchtimer.SetMarginStart(marginstart); searchtimer.SetMarginStop(marginstop); searchtimer.SetUseVPS(usevps); - + if (!testmode) { - searchtimers.Save(&searchtimer); + searchtimers.Save(&searchtimer); return reply.redirect("searchtimers.html"); } else @@ -213,7 +213,7 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); if ( searchtimer == 0 ) throw HtmlError( tr("Couldn't find searchtimer. Maybe you mistyped your request?") ); - search = searchtimer->Search(); + search = searchtimer->Search(); mode = searchtimer->SearchMode(); tolerance = searchtimer->Tolerance(); matchcase = searchtimer->MatchCase(); @@ -262,18 +262,18 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); } else { - wday_sun = -dayofweek & 0x01; - wday_mon = -dayofweek & 0x02; - wday_tue = -dayofweek & 0x04; - wday_wed = -dayofweek & 0x08; - wday_thu = -dayofweek & 0x10; - wday_fri = -dayofweek & 0x20; - wday_sat = -dayofweek & 0x40; + wday_sun = -dayofweek & 0x01; + wday_mon = -dayofweek & 0x02; + wday_tue = -dayofweek & 0x04; + wday_wed = -dayofweek & 0x08; + wday_thu = -dayofweek & 0x10; + wday_fri = -dayofweek & 0x20; + wday_sat = -dayofweek & 0x40; } - } + } useinfavorites = searchtimer->UseInFavorites(); useassearchtimer = searchtimer->UseAsSearchTimer(); - searchtimeraction = searchtimer->SearchTimerAction(); + searchtimeraction = searchtimer->SearchTimerAction(); seriesrecording = searchtimer->UseSeriesRecording(); directory = searchtimer->Directory(); delrecafterdays = searchtimer->DelRecsAfterDays(); @@ -286,7 +286,7 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); for(unsigned int i=0; i parts = StringSplit( infos[i], '#' ); extepgvalues.push_back(parts.size() > 1?parts[1]:""); } @@ -324,13 +324,13 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); lifetime = lexical_cast< int >(EPGSearchSetupValues::ReadValue("DefLifetime")); marginstart = lexical_cast< int >(EPGSearchSetupValues::ReadValue("DefMarginStart")); marginstop = lexical_cast< int >(EPGSearchSetupValues::ReadValue("DefMarginStop")); - } + } <& pageelems.doc_type &> VDR Live - <$ editsearchtimer ? tr("Edit search timer") : tr("New search timer") $> - + <& pageelems.stylesheets &> <& tooltip.javascript var=("domTT_styleClass") value=("domTTepg") &> <& pageelems.ajax_js &> diff --git a/pages/edit_timer.ecpp b/pages/edit_timer.ecpp index 2ed8863..8b775cb 100644 --- a/pages/edit_timer.ecpp +++ b/pages/edit_timer.ecpp @@ -116,7 +116,7 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); VDR Live - <$ timer ? tr("Edit timer") : tr("New timer") $> - + <& pageelems.stylesheets &> <& tooltip.javascript var=("domTT_styleClass") value=("domTTepg") &> <& pageelems.ajax_js &> diff --git a/pages/error.ecpp b/pages/error.ecpp index bb82887..df24dd4 100644 --- a/pages/error.ecpp +++ b/pages/error.ecpp @@ -20,18 +20,14 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); VDR-Live - <$ pageTitle $> - + <& pageelems.stylesheets &> -
- <& pageelems.logo &> - <& menu &> -
-
+ <& pageelems.logo &> + <& menu &>
<& error.error_widget errorTitle=(errorTitle) errorMessage=(errorMessage) &>
-
<%def error_widget> diff --git a/pages/login.ecpp b/pages/login.ecpp index 20624a8..e517963 100644 --- a/pages/login.ecpp +++ b/pages/login.ecpp @@ -35,7 +35,7 @@ if (logged_in || !LiveSetup().UseAuth()) return reply.redirect(LiveSetup().GetSt VDR-Live - <$ tr("Login") $> - + <& pageelems.stylesheets &> <& tooltip.javascript var=("domTT_styleClass") value=("domTTepg") &> <& pageelems.ajax_js &> diff --git a/pages/pageelems.ecpp b/pages/pageelems.ecpp index c823042..99b6882 100644 --- a/pages/pageelems.ecpp +++ b/pages/pageelems.ecpp @@ -32,6 +32,13 @@ static bool HasEpgsearch() <# ---------------------------------------------------------------------- #> +<%def stylesheets> + + + + +<# ---------------------------------------------------------------------- #> + <%def logo>