liquid_feedback_frontend
view env/ui/order.lua @ 9:0ee1e0c42d4c
Version beta5
Minor security fix: Added missing security filter for admin section. Reading of member listing including login names was possible for all users. Write access has not been possible though.
Changing of name and login is possible while a history of these changes is written and accessible by all users.
Statistics shown in area list
Trimming of user input also converts multiple whitespaces to single space character.
Minor security fix: Added missing security filter for admin section. Reading of member listing including login names was possible for all users. Write access has not been possible though.
Changing of name and login is possible while a history of these changes is written and accessible by all users.
Statistics shown in area list
Trimming of user input also converts multiple whitespaces to single space character.
| author | bsw |
|---|---|
| date | Mon Jan 04 12:00:00 2010 +0100 (2010-01-04) |
| parents | afd9f769c7ae |
| children |
line source
1 function ui.order(args)
2 local name = args.name or "order"
3 local current_order = atom.string:load(cgi.params[name]) or args.options[1].name
4 local id = param.get_id_cgi()
5 local params = param.get_all_cgi()
6 ui.container{
7 attr = { class = "ui_order" },
8 content = function()
9 ui.container{
10 attr = { class = "ui_order_head" },
11 content = function()
12 slot.put(_"Order by")
13 slot.put(": ")
14 for i, option in ipairs(args.options) do
15 params[name] = option.name
16 local attr = {}
17 if current_order == option.name then
18 attr.class = "active"
19 if option.selector_modifier then
20 option.selector_modifier(args.selector)
21 else
22 args.selector:add_order_by(option.order_by)
23 end
24 end
25 ui.link{
26 attr = attr,
27 module = request.get_module(),
28 view = request.get_view(),
29 id = id,
30 params = params,
31 content = option.label
32 }
33 end
34 end
35 }
36 ui.container{
37 attr = { class = "ui_order_content" },
38 content = function()
39 args.content()
40 end
41 }
42 end
43 }
44 end
