diff options
Diffstat (limited to 'pages')
-rw-r--r-- | pages/edit_timer.ecpp | 23 | ||||
-rw-r--r-- | pages/timers.ecpp | 10 |
2 files changed, 26 insertions, 7 deletions
diff --git a/pages/edit_timer.ecpp b/pages/edit_timer.ecpp index 7b92551..f1c6ca2 100644 --- a/pages/edit_timer.ecpp +++ b/pages/edit_timer.ecpp @@ -20,6 +20,7 @@ using namespace vdrlive; // input parameters string timerid; string epgid; + string async; // form parameters tChannelID channel; bool active = true; @@ -53,6 +54,8 @@ cTimer* timer; <%cpp> if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); + bool ajaxReq = !async.empty() && (lexical_cast<int>(async) != 0); + tChannelID channelid = tChannelID(); tEventID eventid = tEventID(); @@ -62,7 +65,9 @@ cTimer* timer; timer = 0; if ( !timerid.empty() ) { - timer = timers.GetByTimerId( timerid ); + string tId = SortedTimers::DecodeDomId(timerid); + dsyslog("DEBUG: TIMER: tId = %s", tId.c_str()); + timer = timers.GetByTimerId(tId); if ( timer == 0 ) throw HtmlError( tr("Couldn't find timer. Maybe you mistyped your request?") ); } @@ -134,19 +139,31 @@ cTimer* timer; <html> <head> <title>VDR Live - <$ timer ? tr("Edit timer") : tr("New timer") $></title> +<%cpp> + if (!ajaxReq) { +</%cpp> <& pageelems.stylesheets &> <& pageelems.ajax_js &> +<%cpp> + } +</%cpp> </head> <body> +<%cpp> + if (!ajaxReq) { +</%cpp> <& pageelems.logo &> <& menu active=("timers") &> +<%cpp> + } +</%cpp> <div class="inhalt"> - <form method="post" name="edit_timer" action="edit_timer.ecpp"> + <form method="post" name="edit_timer" id="<$ timerid $>" 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"> <tr class="head"> - <td class="toprow leftcol rightcol" colspan="2"><div class="boxheader"><div><div><$ timer ? tr("Edit timer") : tr("New timer") $></div></div></div></td> + <td class="toprow leftcol rightcol" colspan="2"><div class="boxheader"><div><div class="caption"><$ timer ? tr("Edit timer") : tr("New timer") $></div></div></div></td> </tr> <tr> diff --git a/pages/timers.ecpp b/pages/timers.ecpp index 9af9425..654484f 100644 --- a/pages/timers.ecpp +++ b/pages/timers.ecpp @@ -38,7 +38,9 @@ static const size_t maximumDescriptionLength = 300; timer = 0; if ( !timerid.empty() ) { - timer = timers.GetByTimerId( timerid ); + string tId = SortedTimers::DecodeDomId(timerid); + dsyslog("DEBUG: TIMER: tId = %s", tId.c_str()); + timer = timers.GetByTimerId(tId); if ( timer == 0 ) throw HtmlError( tr("Couldn't find timer. Maybe you mistyped your request?") ); if (action == "delete") { @@ -143,9 +145,9 @@ static const size_t maximumDescriptionLength = 300; % } ><$ timer->File() $></a></div> </td> - <td class="action <? bottom ? "bottomrow" ?>"><a href="timers.html?timerid=<$ timers.GetTimerId(*timer) $>&action=toggle"><img src="<$ LiveSetup().GetThemedLink("img", (timer->Flags() & tfActive) ? "active.png" : "inactive.png") $>" alt="" <& tooltip.hint text=(tr("Toggle timer active/inactive")) &>></img></a></td> - <td class="action <? bottom ? "bottomrow" ?>"><a href="edit_timer.html?timerid=<$ timers.GetTimerId(*timer) $>"><img src="<$ LiveSetup().GetThemedLink("img", "edit.png") $>" alt="" <& tooltip.hint text=(tr("Edit timer")) &>></img></a></td> - <td class="action rightcol <? bottom ? "bottomrow" ?>"><a href="timers.html?timerid=<$ timers.GetTimerId(*timer) $>&action=delete"><img src="<$ LiveSetup().GetThemedLink("img", "del.png") $>" alt="" <& tooltip.hint text=(tr("Delete timer")) &>></img></a></td> + <td class="action <? bottom ? "bottomrow" ?>"><a href="timers.html?timerid=<$ SortedTimers::EncodeDomId(timers.GetTimerId(*timer)) $>&action=toggle"><img src="<$ LiveSetup().GetThemedLink("img", (timer->Flags() & tfActive) ? "active.png" : "inactive.png") $>" alt="" <& tooltip.hint text=(tr("Toggle timer active/inactive")) &>></img></a></td> + <td class="action <? bottom ? "bottomrow" ?>"><a href="edit_timer.html?timerid=<$ SortedTimers::EncodeDomId(timers.GetTimerId(*timer)) $>"><img src="<$ LiveSetup().GetThemedLink("img", "edit.png") $>" alt="" <& tooltip.hint text=(tr("Edit timer")) &>></img></a></td> + <td class="action rightcol <? bottom ? "bottomrow" ?>"><a href="timers.html?timerid=<$ SortedTimers::EncodeDomId(timers.GetTimerId(*timer)) $>&action=delete"><img src="<$ LiveSetup().GetThemedLink("img", "del.png") $>" alt="" <& tooltip.hint text=(tr("Delete timer")) &>></img></a></td> </tr> <%cpp> } |