summaryrefslogtreecommitdiff
path: root/pages
diff options
context:
space:
mode:
authorDieter Hametner <dh (plus) vdr (at) gekrumbel (dot) de>2007-05-31 23:44:01 +0000
committerDieter Hametner <dh (plus) vdr (at) gekrumbel (dot) de>2007-05-31 23:44:01 +0000
commit4bb2cc172549bcf9f86a94e5d3d0d5ade5f91dfe (patch)
tree1594cf050f0f23da64c41b02d739a9e4e1808e21 /pages
parent5d74b90e216827453c87eeb0addae5bb081c40f5 (diff)
downloadvdr-plugin-live-4bb2cc172549bcf9f86a94e5d3d0d5ade5f91dfe.tar.gz
vdr-plugin-live-4bb2cc172549bcf9f86a94e5d3d0d5ade5f91dfe.tar.bz2
- 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.
Diffstat (limited to 'pages')
-rw-r--r--pages/Makefile4
-rw-r--r--pages/content.ecpp17
-rw-r--r--pages/edit_searchtimer.ecpp50
-rw-r--r--pages/edit_timer.ecpp2
-rw-r--r--pages/error.ecpp10
-rw-r--r--pages/login.ecpp2
-rw-r--r--pages/pageelems.ecpp7
-rw-r--r--pages/recordings.ecpp2
-rw-r--r--pages/remote.ecpp2
-rw-r--r--pages/schedule.ecpp2
-rw-r--r--pages/searchepg.ecpp4
-rw-r--r--pages/searchresults.ecpp10
-rw-r--r--pages/searchtimers.ecpp2
-rw-r--r--pages/setup.ecpp6
-rw-r--r--pages/timers.ecpp2
-rw-r--r--pages/whats_on.ecpp6
16 files changed, 70 insertions, 58 deletions
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<extEPGInfos.size(); i++)
{
if (i<infos.size())
- {
+ {
vector< string > 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"));
- }
+ }
</%cpp>
<& pageelems.doc_type &>
<html>
<head>
<title>VDR Live - <$ editsearchtimer ? tr("Edit search timer") : tr("New search timer") $></title>
- <link rel="stylesheet" type="text/css" href="styles.css" />
+ <& pageelems.stylesheets &>
<& tooltip.javascript var=("domTT_styleClass") value=("domTTepg") &>
<& pageelems.ajax_js &>
<script type="text/javascript"><!--
@@ -446,7 +446,7 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html");
}
function changeddirselection(selection)
{
- document.getElementById("directory").value = selection.value;
+ document.getElementById("directory").value = selection.value;
}
//--></script>
</head>
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");
<html>
<head>
<title>VDR Live - <$ timer ? tr("Edit timer") : tr("New timer") $></title>
- <link rel="stylesheet" type="text/css" href="styles.css" />
+ <& pageelems.stylesheets &>
<& tooltip.javascript var=("domTT_styleClass") value=("domTTepg") &>
<& pageelems.ajax_js &>
</head>
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");
<html>
<head>
<title>VDR-Live - <$ pageTitle $></title>
- <link rel="stylesheet" type="text/css" href="/styles.css" />
+ <& pageelems.stylesheets &>
</head>
<body>
- <div class="left_area">
- <& pageelems.logo &>
- <& menu &>
- </div>
- <div class="right_area">
+ <& pageelems.logo &>
+ <& menu &>
<div class="inhalt">
<& error.error_widget errorTitle=(errorTitle) errorMessage=(errorMessage) &>
</div>
- </div>
</body>
</html>
<%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
<html>
<head>
<title>VDR-Live - <$ tr("Login") $></title>
- <link rel="stylesheet" type="text/css" href="styles.css" />
+ <& pageelems.stylesheets &>
<& tooltip.javascript var=("domTT_styleClass") value=("domTTepg") &>
<& pageelems.ajax_js &>
</head>
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>
+<link rel="stylesheet" type="text/css" href="styles.css"/>
+<link rel="stylesheet" type="text/css" href="css/siteprefs.css"/>
+</%def>
+
+<# ---------------------------------------------------------------------- #>
+
<%def logo>
<div class="page_header">
<img src="logo.png" alt="VDR Live!" class="logo"></img>
diff --git a/pages/recordings.ecpp b/pages/recordings.ecpp
index ebc68e7..b1b6b55 100644
--- a/pages/recordings.ecpp
+++ b/pages/recordings.ecpp
@@ -32,7 +32,7 @@ EpgEvents epgEvents;
<html>
<head>
<title>VDR-Live - <$ pageTitle $></title>
- <link rel="stylesheet" type="text/css" href="styles.css" />
+ <& pageelems.stylesheets &>
<& tooltip.javascript var=("domTT_styleClass") value=("domTTepg") &>
<& pageelems.ajax_js &>
<script type="text/javascript" src="treeview.js"></script>
diff --git a/pages/remote.ecpp b/pages/remote.ecpp
index bbe51ae..12850f0 100644
--- a/pages/remote.ecpp
+++ b/pages/remote.ecpp
@@ -20,7 +20,7 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html");
<html>
<head>
<title>VDR-Live - <$ pageTitle $></title>
- <link rel="stylesheet" type="text/css" href="/styles.css" />
+ <& pageelems.stylesheets &>
<& tooltip.javascript var=("domTT_styleClass") value=("domTTepg") &>
<& pageelems.ajax_js &>
<script type="text/javascript"><!--
diff --git a/pages/schedule.ecpp b/pages/schedule.ecpp
index e231a21..a02c32c 100644
--- a/pages/schedule.ecpp
+++ b/pages/schedule.ecpp
@@ -52,7 +52,7 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html");
<html>
<head>
<title>VDR Live - <$ pageTitle $></title>
- <link rel="stylesheet" type="text/css" href="styles.css" />
+ <& pageelems.stylesheets &>
<& tooltip.javascript var=("domTT_styleClass") value=("domTTepg") &>
<& pageelems.ajax_js &>
</head>
diff --git a/pages/searchepg.ecpp b/pages/searchepg.ecpp
index ef734c5..6e4d2f4 100644
--- a/pages/searchepg.ecpp
+++ b/pages/searchepg.ecpp
@@ -151,7 +151,7 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html");
<html>
<head>
<title>VDR Live - <$ tr("Search") $></title>
- <link rel="stylesheet" type="text/css" href="styles.css" />
+ <& pageelems.stylesheets &>
<& tooltip.javascript var=("domTT_styleClass") value=("domTTepg") &>
<& pageelems.ajax_js &>
<script type="text/javascript"><!--
@@ -308,7 +308,7 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html");
<input type="checkbox" name="usetitle" value="1" <{ CHECKIF(usetitle) }> />
<label for="usetitle"><$ tr("Title") $> </label>
</div>
-
+
<div class="dotted">
<input type="checkbox" name="usesubtitle" value="1" <{ CHECKIF(usesubtitle) }> />
<label for="usesubtitle"><$ tr("Episode") $> </label>
diff --git a/pages/searchresults.ecpp b/pages/searchresults.ecpp
index 4a183ef..9c395e1 100644
--- a/pages/searchresults.ecpp
+++ b/pages/searchresults.ecpp
@@ -37,9 +37,9 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html");
s.SetId(0);
s.SetSearch(searchplain);
s.SetSearchMode(0);
- s.SetUseTitle(true);
+ s.SetUseTitle(true);
s.SetUseSubtitle(false);
- s.SetUseDescription(false);
+ s.SetUseDescription(false);
results.GetByQuery(s.ToText());
}
</%cpp>
@@ -47,7 +47,7 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html");
<html>
<head>
<title>VDR-Live - <$ pageTitle $></title>
- <link rel="stylesheet" type="text/css" href="/styles.css" />
+ <& pageelems.stylesheets &>
<& tooltip.javascript var=("domTT_styleClass") value=("domTTepg") &>
<& pageelems.ajax_js &>
</head>
@@ -76,7 +76,7 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html");
tChannelID channel_id(result->Channel());
string description = result->Description();
-
+
string evntId("eventId_");
evntId += lexical_cast<std::string, int>(++evntNr);
EpgEventPtr epgEvent(new EpgEvent(evntId, channelname, result->Title(), result->ShortText(), description, result->StartTime(), result->StopTime()));
@@ -105,7 +105,7 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html");
<td>
<div class="more"<& tooltip.hint text=(StringEscapeAndBreak(StringWordTruncate(description, 300, truncated)) + string("<br />") + string(tr("Click to view details."))) &><& tooltip.display domId=(epgEvent->Id()) &>><strong><$ result->Title() $></strong></div><$ result->ShortText() $><br />
</td>
-
+
<td style="border-right: 1px solid black">&nbsp;</td>
</tr>
% }
diff --git a/pages/searchtimers.ecpp b/pages/searchtimers.ecpp
index 1c23347..d54fd5c 100644
--- a/pages/searchtimers.ecpp
+++ b/pages/searchtimers.ecpp
@@ -35,7 +35,7 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html");
<html>
<head>
<title>VDR-Live - <$ pageTitle $></title>
- <link rel="stylesheet" type="text/css" href="styles.css">
+ <& pageelems.stylesheets &>
<& tooltip.javascript var=("domTT_styleClass") value=("domTTepg") &>
<& pageelems.ajax_js &>
</head>
diff --git a/pages/setup.ecpp b/pages/setup.ecpp
index 1650211..1c0393f 100644
--- a/pages/setup.ecpp
+++ b/pages/setup.ecpp
@@ -24,7 +24,7 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html");
<%cpp>
#define SELECTIF(x) reply.out() << ( (x) ? "selected=\"selected\"" : "" );
- if ( request.getMethod() == "POST") {
+ if ( request.getMethod() == "POST") {
LiveSetup().SetLastChannel(lastchannel != "" ? lexical_cast< int >(lastchannel):0);
LiveSetup().SetUseAuth(useauth);
if (useauth) {
@@ -34,7 +34,7 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html");
}
LiveSetup().SetTimes(times);
LiveSetup().SetStartScreen(startscreen);
- LiveSetup().SaveSetup();
+ LiveSetup().SaveSetup();
}
pageTitle = tr("Setup");
int ilastchannel = LiveSetup().GetLastChannel();
@@ -53,7 +53,7 @@ if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html");
<html>
<head>
<title>VDR-Live - <$ pageTitle $></title>
- <link rel="stylesheet" type="text/css" href="/styles.css" />
+ <& pageelems.stylesheets &>
<& tooltip.javascript var=("domTT_styleClass") value=("domTTepg") &>
<& pageelems.ajax_js &>
<script type="text/javascript"><!--
diff --git a/pages/timers.ecpp b/pages/timers.ecpp
index eebcb7e..dc67178 100644
--- a/pages/timers.ecpp
+++ b/pages/timers.ecpp
@@ -45,7 +45,7 @@ using namespace vdrlive;
<html>
<head>
<title>VDR-Live - <$ pageTitle $></title>
- <link rel="stylesheet" type="text/css" href="styles.css" />
+ <& pageelems.stylesheets &>
<& tooltip.javascript var=("domTT_styleClass") value=("domTTepg") &>
<& pageelems.ajax_js &>
</head>
diff --git a/pages/whats_on.ecpp b/pages/whats_on.ecpp
index 0af929b..e975551 100644
--- a/pages/whats_on.ecpp
+++ b/pages/whats_on.ecpp
@@ -69,7 +69,7 @@ if (type == "now") {
<html>
<head>
<title>VDR-Live - <$ head $></title>
- <link rel="stylesheet" type="text/css" href="styles.css" />
+ <& pageelems.stylesheets &>
<& tooltip.javascript var=("domTT_styleClass") value=("domTTepg") &>
<& pageelems.ajax_js &>
<script type="text/javascript"><!--
@@ -105,7 +105,7 @@ if (type == "now") {
for (cChannel *Channel = Channels.First(); Channel && Channel->Number() <= LiveSetup().GetLastChannel(); Channel = Channels.Next(Channel)) {
if (!Channel->GroupSep()) {
const cSchedule *Schedule = Schedules->GetSchedule(Channel);
- if (Schedule) {
+ if (Schedule) {
const cEvent *Event = NULL;
if (type == "now")
Event = Schedule->GetPresentEvent();
@@ -113,7 +113,7 @@ if (type == "now") {
Event = Schedule->GetFollowingEvent();
else if (type == "at")
Event = Schedule->GetEventAround(seektime);
-
+
if (Event) {
string evntId("eventId_");
evntId += lexical_cast<std::string, int>(++evntNr);