summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Keil <tkeil (at) datacrystal (dot) de>2007-04-24 10:44:13 +0000
committerThomas Keil <tkeil (at) datacrystal (dot) de>2007-04-24 10:44:13 +0000
commit5eeb166cf3401bfd8c63083d4fce8e88236bc416 (patch)
tree5f938b6fc50595e83da106be6944d5e276f24b0c
parent613c0f504635d2dc19c567045e329a66d137821d (diff)
downloadvdr-plugin-live-5eeb166cf3401bfd8c63083d4fce8e88236bc416.tar.gz
vdr-plugin-live-5eeb166cf3401bfd8c63083d4fce8e88236bc416.tar.bz2
Added functionality to delete a timer
-rw-r--r--pages/timers.ecpp25
1 files changed, 23 insertions, 2 deletions
diff --git a/pages/timers.ecpp b/pages/timers.ecpp
index f0a40a2..debea13 100644
--- a/pages/timers.ecpp
+++ b/pages/timers.ecpp
@@ -3,15 +3,34 @@
#include "timers.h"
#include "tools.h"
+using namespace std;
using namespace vdrlive;
</%pre>
+<%args>
+ // input parameters
+ string timerid;
+ string action;
+</%args>
+<%request scope="page">
+cTimer* timer;
+</%request>
<%include>page_init.eh</%include>
<%cpp>
pageTitle = tr("Timers");
cMutexLock timersLock( &LiveTimerManager() );
SortedTimers& timers = LiveTimerManager().GetTimers();
+
+ timer = 0;
+ if ( !timerid.empty() ) {
+ timer = timers.GetByTimerId( timerid );
+ if ( timer == 0 )
+ throw HtmlError( tr("Couldn't find timer. Maybe you mistyped your request?") );
+ if (action == "delete")
+ LiveTimerManager().DelTimer(timer);
+ }
+
</%cpp>
<& pageelems.doc_type &>
<html>
@@ -31,7 +50,6 @@ using namespace vdrlive;
<table class="timers" cellspacing="0" cellpadding="0">
<tr class="head">
<td style="background: url(bg_box_l.png); width: 3px;"/></td>
- <td>&nbsp;</td>
<td><$ tr("Active") $></td>
<td><$ tr("Channel") $></td>
<td><$ tr("Date") $></td>
@@ -39,6 +57,8 @@ using namespace vdrlive;
<td><$ tr("Stop") $></td>
<td>&nbsp;</td>
<td><$ tr("File") $></td>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
<td style="background: url(bg_box_r.png); width: 3px;" /></td>
</tr>
<{
@@ -47,7 +67,6 @@ using namespace vdrlive;
}>
<tr class="<$ active ? "active" : "" $>">
<td class="border" style="border-left: 1px solid black"></td>
- <td><button type="button" class="smallbutton" onclick="location.href='edit_timer.html?timerid=<$ timers.GetTimerId(*timer) $>';"><$ tr("Edit") $></button></td>
<td><img src="/<$ (timer->Flags() & tfActive) ? "active" : "inactive" $>.png" alt="Aktiv?" /></td>
<td><$ timer->Channel()->Name() $></td>
<td><$ timer->WeekDays() > 0 ? *cTimer::PrintDay(0, timer->WeekDays()) : FormatDateTime(tr("%a, %b %d"), timer->Day()) $></td>
@@ -55,6 +74,8 @@ using namespace vdrlive;
<td><$ FormatDateTime(tr("%I:%M %p"), timer->StopTime()) $></td>
<td><{ if (timer->Recording()) { }><img src="/record.png" alt="Record" /><{ } }></td>
<td><$ timer->File() $></td>
+ <td><button type="button" class="smallbutton" onclick="location.href='edit_timer.html?timerid=<$ timers.GetTimerId(*timer) $>';"><$ tr("Edit") $></button></td>
+ <td><a href="timers.html?timerid=<$ timers.GetTimerId(*timer) $>&action=delete"><img src="del.png" border="0"></a></td>
<td class="border" style="border-right: 1px solid black"></td>
</tr>
<{