diff options
Diffstat (limited to 'pages')
-rw-r--r-- | pages/page_init.eh | 6 | ||||
-rw-r--r-- | pages/pageelems.ecpp | 6 | ||||
-rw-r--r-- | pages/switch_channel.ecpp | 29 | ||||
-rw-r--r-- | pages/whats_on.ecpp | 2 | ||||
-rw-r--r-- | pages/xmlresponse.ecpp | 8 |
5 files changed, 43 insertions, 8 deletions
diff --git a/pages/page_init.eh b/pages/page_init.eh index d09a392..5a367df 100644 --- a/pages/page_init.eh +++ b/pages/page_init.eh @@ -1,5 +1,7 @@ -<# do not add to Makefile #> <%pre> +// do not add to Makefile +// and do not write a ecpp comment into this file. It must produce no +// html output not even a empty line. #include <tnt/savepoint.h> #include "exception.h" </%pre> @@ -10,4 +12,4 @@ std::string pageTitle; try { reply.setHeader("Expires", "Mon, 26 Jul 1997 05:00:00 GMT"); tnt::Savepoint spoint( reply ); -</%cpp> +</%cpp>
\ No newline at end of file diff --git a/pages/pageelems.ecpp b/pages/pageelems.ecpp index 277d84c..0507b56 100644 --- a/pages/pageelems.ecpp +++ b/pages/pageelems.ecpp @@ -153,6 +153,10 @@ int update_status(1); infoWinStrings: { loadingMsg: '<$ tr("loading data") $>', errorMsg: '<$ tr("an error occured!") $>' + }, + notifyStrings: { + successMsg: '<img src="<$ LiveSetup().GetThemedLink("img", "active.png") $>" alt=""> <$ tr("Request succeeded!") $>', + errorMsg: '<img src="<$ LiveSetup().GetThemedLink("img", "del.png") $>" alt=""> <$ tr("Request failed!") $>' } }); --></script> @@ -188,7 +192,7 @@ int update_status(1); string alt; string id; </%args> -<%cpp> { </%cpp> <a <%cpp> if (!id.empty()) { </%cpp> id="<$ id $>" <%cpp> } </%cpp><& hide_element hide=(!id.empty()) &> href="javascript:LiveSimpleAjaxRequest('<$ action $>.xml', 'param', '<$ param $>');" <%cpp>if (!tip.empty()) { </%cpp><& tooltip.hint text=(tip) &> <%cpp> } </%cpp>><img src="<$ LiveSetup().GetThemedLink("img", image) $>" alt="<$ alt $>"></img></a> <%cpp> } </%cpp> +<%cpp> { </%cpp> <a <%cpp> if (!id.empty()) { </%cpp> id="<$ id $>" <%cpp> } </%cpp><& hide_element hide=(!id.empty()) &> href="vdr_request/<$ action $>?param=<$ param $>" <%cpp>if (!tip.empty()) { </%cpp><& tooltip.hint text=(tip) &> <%cpp> } </%cpp>><img src="<$ LiveSetup().GetThemedLink("img", image) $>" alt="<$ alt $>"></img></a> <%cpp> } </%cpp> </%def> <# ---------------------------------------------------------------------- #> 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> diff --git a/pages/whats_on.ecpp b/pages/whats_on.ecpp index dfba641..d724c23 100644 --- a/pages/whats_on.ecpp +++ b/pages/whats_on.ecpp @@ -21,7 +21,6 @@ type = "now"; string mode; string attime; string fixtime; - </%args> <%session scope="global"> bool logged_in(false); @@ -33,7 +32,6 @@ string current_attime; string current_fixtime; string current_displaytime; </%request> - <%include>page_init.eh</%include> <%cpp> if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); diff --git a/pages/xmlresponse.ecpp b/pages/xmlresponse.ecpp index 54fe088..4bca87f 100644 --- a/pages/xmlresponse.ecpp +++ b/pages/xmlresponse.ecpp @@ -3,6 +3,10 @@ #include "i18n.h" using namespace std; +using namespace vdrlive; + +string const XMLHEADER = "<?xml version=\"1.0\" encoding=\"" + LiveI18n().CharacterEncoding() + "\"?>"; + </%pre> <# ------------------------------------------------------------------------- #> @@ -15,7 +19,7 @@ using namespace std; bool result; string error; </%args> -<?xml version="1.0" encoding="<$ LiveI18n().CharacterEncoding() $>"?> +<$$ XMLHEADER $> <service> <request name="<$ name $>"> <param name="<$ pname $>"><$ value $></param> @@ -39,7 +43,7 @@ using namespace std; string prev_chan; string next_chan; </%args> -<?xml version="1.0" encoding="ISO-8859-1"?> +<$$ XMLHEADER $> <service> <request name="ibox"> <param name="update"><$ update $></param> |