summaryrefslogtreecommitdiff
path: root/pages/xmlresponse.ecpp
blob: bf0a6c1113b44ea627d2360fdafdabec23e5c820 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<%pre>
#include <string>
#include "i18n.h"

using namespace std;
using namespace vdrlive;

string const XMLHEADER = "<?xml version=\"1.0\" encoding=\"" + LiveI18n().CharacterEncoding() + "\"?>";

</%pre>

<# ------------------------------------------------------------------------- #>

<%def ajax>
<%args>
	string name;
	string pname;
	string value;
	bool result;
	string error;
</%args>
<$$ XMLHEADER $>
<service>
  <request name="<$ name $>">
     <param name="<$ pname $>"><$ value $></param>
  </request>
  <response><$ result $></response>
  <error><$ error $></error>
</service>
</%def>

<# ------------------------------------------------------------------------- #>

<%def ibox>
<%args>
	int update;
	string type;
	string currentTime;
	string caption;
	string title;
	string duration;
	int elapsed;
	string prev_chan;
	string next_chan;
	string infoMsg;
	string infoUrl;
</%args>
<$$ XMLHEADER $>
<service>
  <request name="ibox">
	<param name="update"><$ update $></param>
  </request>
  <response>1</response>
  <error></error>
  <values>
	<update><$ update $></update>
	<epginfo>
	  <type><$ type $></type>
	  <caption><$ caption $></caption>
	  <timenow><$ currentTime $></timenow>
	  <name><$ title $></name>
	  <duration><$ duration $></duration>
	  <elapsed><$ elapsed $></elapsed>
	  <nextchan><$ next_chan $></nextchan>
	  <prevchan><$ prev_chan $></prevchan>
	</epginfo>
  </values>
<%cpp>
if (!infoMsg.empty()) {
</%cpp>
  <info>
	<message><$ infoMsg $></message>
    <url><$ infoUrl $></url>
  </info>
<%cpp>
}
</%cpp>
</service>
</%def>