webmcp
view framework/env/execute/filtered_action.lua @ 2:72860d232f32
Version 1.0.2
Fixed bug with explicit garbage collection (requests > 256kB caused an error)
Views prefixed with an underscore can't be called externally
ui.paginate now displays the last page, if the selected page number is too high.
Fixed bug with explicit garbage collection (requests > 256kB caused an error)
Views prefixed with an underscore can't be called externally
ui.paginate now displays the last page, if the selected page number is too high.
author | jbe/bsw |
---|---|
date | Thu Dec 10 12:00:00 2009 +0100 (2009-12-10) |
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