diff options
author | TheTroll <trolldev@gmail.com> | 2010-02-23 13:58:42 +0100 |
---|---|---|
committer | TheTroll <trolldev@gmail.com> | 2010-02-23 13:58:42 +0100 |
commit | 902ee1ab48b46fa117aad0e3508f58df40bcbe3e (patch) | |
tree | 69bff970e7b4d54c111adabbb265a044ffd25775 /includes/inc_vdr.php | |
parent | 99ebedf5abf6b064fd413512a4df06b3b78f9f62 (diff) | |
download | istreamdev-902ee1ab48b46fa117aad0e3508f58df40bcbe3e.tar.gz istreamdev-902ee1ab48b46fa117aad0e3508f58df40bcbe3e.tar.bz2 |
Fixed empty or lonely timers
Print the status of the timer modifications
Diffstat (limited to 'includes/inc_vdr.php')
-rwxr-xr-x | includes/inc_vdr.php | 37 |
1 files changed, 29 insertions, 8 deletions
diff --git a/includes/inc_vdr.php b/includes/inc_vdr.php index d6eb269..be2f798 100755 --- a/includes/inc_vdr.php +++ b/includes/inc_vdr.php @@ -299,7 +299,17 @@ function vdrlisttimers() $timers = $svdrp->Command("LSTT"); $svdrp->Disconnect(); - foreach($timers as $timer) + if (gettype($timers) == "string") + { + if ($timers == "") + return; + else + $timersarray[] = $timers; + } + else + $timersarray = $timers; + + foreach($timersarray as $timer) { // Extract timer # $timerarray = explode(" ", $timer); @@ -309,7 +319,13 @@ function vdrlisttimers() print "<li class=\"menu\">"; print " <a href=\"javascript:sendForm('timer {$timernum}')\">"; - print " <img alt=\"list\" src=\"images/pictos/timers.png\" />"; + + if ($type & 0x8) + print " <img alt=\"list\" src=\"images/pictos/timerrec.png\" />"; + else if ($type & 0x1) + print " <img alt=\"list\" src=\"images/pictos/timeron.png\" />"; + else + print " <img alt=\"list\" src=\"images/pictos/timeroff.png\" />"; print " <span class=\"name\">{$date}: {$channame}</span><span class=\"arrow\"></span>"; @@ -329,24 +345,29 @@ function vdrdeltimer($timer=0) $svdrp = new SVDRP($svdrpip, $svdrpport); $svdrp->Connect(); - $svdrp->Command("DELT " .$timer); + $ret = $svdrp->Command("DELT " .$timer); $svdrp->Disconnect(); + + return $ret; } -function vdrsettimer($channame, $date, $stime, $etime, $desc) +function vdrsettimer($prevtimer, $channame, $date, $stime, $etime, $desc) { global $svdrpip, $svdrpport; $channum = vdrgetchannum($channame); - $timer = "1:" .$channum .":" .$date .":" .$stime .":" .$etime .":99:99:" .$desc; - - print $timer; + if ($prevtimer == -1) + $command = "NEWT 1:" .$channum .":" .$date .":" .$stime .":" .$etime .":99:99:" .$desc; + else + $command = "MODT " .$prevtimer ." 1:" .$channum .":" .$date .":" .$stime .":" .$etime .":99:99:" .$desc; $svdrp = new SVDRP($svdrpip, $svdrpport); $svdrp->Connect(); - $svdrp->Command("NEWT " .$timer); + $ret = $svdrp->Command($command); $svdrp->Disconnect(); + + return $ret; } ?> |