summaryrefslogtreecommitdiff
path: root/pages/switch_channel.ecpp
diff options
context:
space:
mode:
Diffstat (limited to 'pages/switch_channel.ecpp')
-rw-r--r--pages/switch_channel.ecpp29
1 files changed, 28 insertions, 1 deletions
diff --git a/pages/switch_channel.ecpp b/pages/switch_channel.ecpp
index 0031f4e..9b8b48b 100644
--- a/pages/switch_channel.ecpp
+++ b/pages/switch_channel.ecpp
@@ -4,16 +4,43 @@
#include "tasks.h"
#include "tools.h"
+using namespace std;
using namespace vdrlive;
</%pre>
<%args>
tChannelID param;
+ string async;
</%args>
<%cpp>
- reply.setContentType( "application/xml" );
+ bool ajaxReq = !async.empty() && (lexical_cast<int>(async) != 0);
+ string referrer;
+
+ if (ajaxReq) {
+ reply.setContentType( "application/xml" );
+ }
+ else {
+ referrer = request.getHeader("Referer:");
+ }
SwitchChannelTask task( param );
LiveTaskManager().Execute( task );
+
+ if (!ajaxReq) {
+ if (!referrer.empty()) {
+ return reply.redirect(referrer);
+ }
+</%cpp>
+Normale Seite:<br/>
+channel: <$ param $><br/>
+result: <$ (task.Result()) $><br/>
+error: <$ (task.Error()) $><br />
+Seitenende!
+<%cpp>
+ }
+ else {
</%cpp>
<& xmlresponse.ajax name=("switch_channel") pname=("channel") value=(param) result=(task.Result()) error=(task.Error()) &>
+<%cpp>
+ }
+</%cpp>