webmcp

view framework/env/execute/filtered_action.lua @ 148:5354d836e6fb

Minor bugfix in json_newindex function of JSON library (should return nothing)
author jbe
date Wed Jul 30 22:32:33 2014 +0200 (2014-07-30)
parents 9fdfb27f8e67
children eb3e236d261d
line source
1 --[[--
2 action_status = -- status code returned by the action (a string)
3 execute.filtered_action{
4 module = module, -- module name of the action to be executed
5 action = action, -- name of the action to be executed
6 id = id, -- id to be returned by param.get_id(...) during execution
7 params = params -- parameters to be returned by param.get(...) during execution
8 }
10 Executes an action with associated filters.
11 This function is only used by by the webmcp.lua file in the cgi-bin/ directory.
13 --]]--
15 function execute.filtered_action(args)
16 local filters = {}
17 local function add_by_path(...)
18 execute._add_filters_by_path(filters, ...)
19 end
20 add_by_path("_filter")
21 add_by_path("_filter_action")
22 add_by_path(request.get_app_name(), "_filter")
23 add_by_path(request.get_app_name(), "_filter_action")
24 add_by_path(request.get_app_name(), args.module, "_filter")
25 add_by_path(request.get_app_name(), args.module, "_filter_action")
26 table.sort(filters)
27 for idx, filter_name in ipairs(filters) do
28 filters[idx] = filters[filter_name]
29 filters[filter_name] = nil
30 end
31 local result
32 execute.multi_wrapped(
33 filters,
34 function()
35 result = execute.action(args)
36 end
37 )
38 return result
39 end

Impressum / About Us