diff options
| author | Dieter Hametner <dh (plus) vdr (at) gekrumbel (dot) de> | 2007-07-29 17:41:38 +0000 |
|---|---|---|
| committer | Dieter Hametner <dh (plus) vdr (at) gekrumbel (dot) de> | 2007-07-29 17:41:38 +0000 |
| commit | 6bd91ddffe86ebeb10420f05a232f8e779eaf86d (patch) | |
| tree | 09fe2c9617c08799e2689afa2fc9d0366bd16ff9 /pages/switch_channel.ecpp | |
| parent | c6754ca96830f5034ca56a4ca2987df4c50375db (diff) | |
| download | vdr-plugin-live-6bd91ddffe86ebeb10420f05a232f8e779eaf86d.tar.gz vdr-plugin-live-6bd91ddffe86ebeb10420f05a232f8e779eaf86d.tar.bz2 | |
- Made vdr ajax requests work also via a static page. This is for
browsers that don't support javascript (e.g. PDA browsers)
- Implemented for AJAX request a visual notification how requested action
performed.
- Adapted styles for this.
- Moded images for rounded boxes (formerly tip-hint-??.png) to central
image directory and renamed them according to their color. This
makes them reusable in different themes.
- Adapted themes to this move.
Diffstat (limited to 'pages/switch_channel.ecpp')
| -rw-r--r-- | pages/switch_channel.ecpp | 29 |
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> |
