<%pre> #include #include "exception.h" #include "tasks.h" #include "tools.h" using namespace std; using namespace vdrlive; <%args> tChannelID param; string async; <%cpp> bool ajaxReq = !async.empty() && (lexical_cast(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); } Normale Seite:
channel: <$ param $>
result: <$ (task.Result()) $>
error: <$ (task.Error()) $>
Seitenende! <%cpp> } else { <& xmlresponse.ajax name=("switch_channel") pname=("channel") value=(param) result=(task.Result()) error=(task.Error()) &> <%cpp> }