webmcp
diff framework/env/execute/filtered_view.lua @ 206:eb3e236d261d
Code cleanup and work on Moonbridge integration
author | jbe |
---|---|
date | Fri Jan 09 22:28:39 2015 +0100 (2015-01-09) |
parents | 9fdfb27f8e67 |
children |
line diff
1.1 --- a/framework/env/execute/filtered_view.lua Fri Jan 09 21:32:23 2015 +0100 1.2 +++ b/framework/env/execute/filtered_view.lua Fri Jan 09 22:28:39 2015 +0100 1.3 @@ -5,28 +5,26 @@ 1.4 } 1.5 1.6 Executes a view with associated filters. 1.7 -This function is only used by by the webmcp.lua file in the cgi-bin/ directory. 1.8 1.9 --]]-- 1.10 1.11 function execute.filtered_view(args) 1.12 - local filters = {} 1.13 - local function add_by_path(...) 1.14 - execute._add_filters_by_path(filters, ...) 1.15 - end 1.16 - add_by_path("_filter") 1.17 - add_by_path("_filter_view") 1.18 - add_by_path(request.get_app_name(), "_filter") 1.19 - add_by_path(request.get_app_name(), "_filter_view") 1.20 - add_by_path(request.get_app_name(), args.module, "_filter") 1.21 - add_by_path(request.get_app_name(), args.module, "_filter_view") 1.22 - table.sort(filters) 1.23 - for idx, filter_name in ipairs(filters) do 1.24 - filters[idx] = filters[filter_name] 1.25 - filters[filter_name] = nil 1.26 - end 1.27 execute.multi_wrapped( 1.28 - filters, 1.29 + execute._create_sorted_execution_list( 1.30 + function(add_by_path) 1.31 + add_by_path("_filter") 1.32 + add_by_path("_filter_view") 1.33 + add_by_path(WEBMCP_APP_NAME, "_filter") 1.34 + add_by_path(WEBMCP_APP_NAME, "_filter_view") 1.35 + add_by_path(WEBMCP_APP_NAME, args.module, "_filter") 1.36 + add_by_path(WEBMCP_APP_NAME, args.module, "_filter_view") 1.37 + end, 1.38 + function(full_path, relative_path) 1.39 + trace.enter_filter{ path = relative_path } 1.40 + execute.file_path{ file_path = full_path } 1.41 + trace.execution_return() 1.42 + end 1.43 + ), 1.44 function() 1.45 execute.view(args) 1.46 end