webmcp
view framework/env/execute/multi_wrapped.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 |
line source
1 --[[--
2 execute.multi_wrapped(
3 wrapper_funcs, -- multiple wrapper functions (i.e. filters)
4 inner_func -- inner function (i.e. an action or view)
5 )
7 This function does the same as execute.wrapped(...), but with multiple wrapper functions, instead of just one wrapper function. It is used by execute.filtered_view{...} and execute.filtered_action{...} to wrap multiple filters around the view or action.
9 --]]--
11 function execute.multi_wrapped(wrapper_funcs, inner_func)
12 local function wrapped_execution(pos)
13 local wrapper_func = wrapper_funcs[pos]
14 if wrapper_func then
15 return execute.wrapped(
16 wrapper_func,
17 function()
18 wrapped_execution(pos+1)
19 end
20 )
21 else
22 return inner_func()
23 end
24 end
25 return wrapped_execution(1)
26 end