summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorTheTroll <trolldev@gmail.com>2010-02-23 14:23:54 +0100
committerTheTroll <trolldev@gmail.com>2010-02-23 14:23:54 +0100
commitf53d604d4c363ff1336f9ff2faccefced45b2108 (patch)
tree07e0f1ea9abc1c3d7557545452831317d1c25fa5 /includes
parent75b7738afd351d33097805c94942b12e80eabcb0 (diff)
downloadistreamdev-f53d604d4c363ff1336f9ff2faccefced45b2108.tar.gz
istreamdev-f53d604d4c363ff1336f9ff2faccefced45b2108.tar.bz2
Implemented timer activation function
Diffstat (limited to 'includes')
-rwxr-xr-xincludes/inc_edittimer.php13
-rwxr-xr-xincludes/inc_vdr.php10
-rwxr-xr-xincludes/include.php7
3 files changed, 17 insertions, 13 deletions
diff --git a/includes/inc_edittimer.php b/includes/inc_edittimer.php
index c736c03..b2ffb36 100755
--- a/includes/inc_edittimer.php
+++ b/includes/inc_edittimer.php
@@ -10,20 +10,19 @@ print "<div id=\"title\">iStream</div>\r\n";
print "</div>\r\n";
$timer = $_REQUEST['timer'];
if ($timer == -1)
-{
-print "<div id=\"content\"> <span class=\"graytitle\">New Timer</span>\r\n";
-}
+ print "<div id=\"content\"> <span class=\"graytitle\">New Timer</span>\r\n";
else
-{
-print "<div id=\"content\"> <span class=\"graytitle\">Edit Timer</span>\r\n";
-}
+ print "<div id=\"content\"> <span class=\"graytitle\">Edit Timer</span>\r\n";
list($type, $channame, $date, $stime, $etime, $desc) = vdrgettimerinfo($timer);
// Timer name
print "<form name=\"timer\" id=\"timer\" method=\"post\" action=\"index.php\">\r\n";
print " <ul class=\"pageitem\">\r\n";
-print " <li class=\"checkbox\"><span class=\"name\">Active</span><input name=\"active\" type=\"checkbox\" checked/></li>\r\n";
+if ($type & 0x1)
+ print " <li class=\"checkbox\"><span class=\"name\">Active</span><input name=\"timer_active\" type=\"checkbox\" checked/></li>\r\n";
+else
+ print " <li class=\"checkbox\"><span class=\"name\">Active</span><input name=\"timer_active\" type=\"checkbox\"/></li>\r\n";
print " </ul>\r\n";
print " <ul class=\"pageitem\">\r\n";
print " <li class=\"textbox\"><span class=\"header\">Recording name</span></li>\r\n";
diff --git a/includes/inc_vdr.php b/includes/inc_vdr.php
index ca89b87..7f1f408 100755
--- a/includes/inc_vdr.php
+++ b/includes/inc_vdr.php
@@ -351,16 +351,20 @@ function vdrdeltimer($timer=0)
return $ret;
}
-function vdrsettimer($prevtimer, $channame, $date, $stime, $etime, $desc)
+function vdrsettimer($prevtimer, $channame, $date, $stime, $etime, $desc, $active)
{
global $svdrpip, $svdrpport;
$channum = vdrgetchannum($channame);
+ if ($active)
+ $type = "1";
+ else
+ $type = "0";
if ($prevtimer == -1)
- $command = "NEWT 1:" .$channum .":" .$date .":" .$stime .":" .$etime .":99:99:" .$desc;
+ $command = "NEWT " .$type .":" .$channum .":" .$date .":" .$stime .":" .$etime .":99:99:" .$desc;
else
- $command = "MODT " .$prevtimer ." 1:" .$channum .":" .$date .":" .$stime .":" .$etime .":99:99:" .$desc;
+ $command = "MODT " .$prevtimer ." " .$type .":" .$channum .":" .$date .":" .$stime .":" .$etime .":99:99:" .$desc;
$svdrp = new SVDRP($svdrpip, $svdrpport);
$svdrp->Connect();
diff --git a/includes/include.php b/includes/include.php
index 6fe31ad..d244ba5 100755
--- a/includes/include.php
+++ b/includes/include.php
@@ -56,13 +56,14 @@ function selectpage()
delete_timer($timer);
break;
case ("addtimer"):
+ $active = $_REQUEST['timer_active'];
$channame = $_REQUEST['timer_chan'];
$date = $_REQUEST['timer_date'];
$stime = $_REQUEST['timer_starttime'];
$etime = $_REQUEST['timer_endtime'];
$desc = $_REQUEST['timer_name'];
$prevtimer = $_REQUEST['prevtimer'];
- set_timer($channame, $date, $stime, $etime, $desc, $prevtimer);
+ set_timer($active, $channame, $date, $stime, $etime, $desc, $prevtimer);
break;
case ("startstream"):
$type = $_REQUEST['type'];
@@ -163,9 +164,9 @@ function delete_timer($timer)
include('includes/inc_timers.php');
}
-function set_timer($channame, $date, $stime, $etime, $desc, $prevtimer)
+function set_timer($active, $channame, $date, $stime, $etime, $desc, $prevtimer)
{
- $ret = vdrsettimer($prevtimer, $channame, $date, $stime, $etime, $desc);
+ $ret = vdrsettimer($prevtimer, $channame, $date, $stime, $etime, $desc, $active);
if ($prevtimer == -1)
$settype = "creat";