webmcp

diff framework/cgi-bin/webmcp.lua @ 113:ca88032cb37c

Anchor (#) support for redirect and routing
author jbe
date Sun Jan 19 14:47:08 2014 +0100 (2014-01-19)
parents 4747ddffdeff
children 30391b40722f
line diff
     1.1 --- a/framework/cgi-bin/webmcp.lua	Mon Jan 13 21:40:27 2014 +0100
     1.2 +++ b/framework/cgi-bin/webmcp.lua	Sun Jan 19 14:47:08 2014 +0100
     1.3 @@ -319,11 +319,13 @@
     1.4            routing_mode   = cgi.params["_webmcp_routing." .. action_status .. ".mode"]
     1.5            routing_module = cgi.params["_webmcp_routing." .. action_status .. ".module"]
     1.6            routing_view   = cgi.params["_webmcp_routing." .. action_status .. ".view"]
     1.7 +          routing_anchor = cgi.params["_webmcp_routing." .. action_status .. ".anchor"]
     1.8            if not (routing_mode or routing_module or routing_view) then
     1.9              action_status = "default"
    1.10              routing_mode   = cgi.params["_webmcp_routing.default.mode"]
    1.11              routing_module = cgi.params["_webmcp_routing.default.module"]
    1.12              routing_view   = cgi.params["_webmcp_routing.default.view"]
    1.13 +            routing_anchor = cgi.params["_webmcp_routing.default.anchor"]
    1.14            end
    1.15            assert(routing_module, "Routing information has no module.")
    1.16            assert(routing_view,   "Routing information has no view.")
    1.17 @@ -341,7 +343,8 @@
    1.18                module = routing_module,
    1.19                view   = routing_view,
    1.20                id     = cgi.params["_webmcp_routing." .. action_status .. ".id"],
    1.21 -              params = routing_params
    1.22 +              params = routing_params,
    1.23 +              anchor = routing_anchor
    1.24              }
    1.25            elseif routing_mode == "forward" then
    1.26              request.forward{ module = routing_module, view = routing_view }
    1.27 @@ -452,7 +455,8 @@
    1.28        module = redirect_data.module,
    1.29        view   = redirect_data.view,
    1.30        id     = redirect_data.id,
    1.31 -      params = redirect_params
    1.32 +      params = redirect_params,
    1.33 +      anchor = redirect_data.anchor
    1.34      }
    1.35    )
    1.36    cgi.send_data()

Impressum / About Us