liquid_feedback_frontend
view app/main/timeline/_action/save.lua @ 154:6b6c82f9ca9f
speedup member image loading when non set
we can add the location of the default file directy instead of going through another slow request
we can add the location of the default file directy instead of going through another slow request
| author | Daniel Poelzleithner <poelzi@poelzi.org> |
|---|---|
| date | Fri Oct 08 15:25:10 2010 +0200 (2010-10-08) |
| parents | 7c3e8a1678fc |
| children |
line source
1 local id = param.get("id", atom.number)
3 local setting_key = "liquidfeedback_frontend_timeline_current_options"
4 local setting = Setting:by_pk(app.session.member.id, setting_key)
5 local options_string = setting.value
7 local timeline_filter
9 local subkey = param.get("name")
11 if not subkey or subkey == "" then
12 slot.put_into("error", _"This name is really too short!")
13 request.redirect{
14 module = "timeline",
15 view = "save_filter",
16 }
17 return
18 end
20 app.session.member:set_setting_map("timeline_filters", subkey, options_string)
22 local timeline_params = {}
23 if options_string then
24 for event_ident, filter_idents in setting.value:gmatch("(%S+):(%S+)") do
25 timeline_params["option_" .. event_ident] = true
26 if filter_idents ~= "*" then
27 for filter_ident in filter_idents:gmatch("([^\|]+)") do
28 timeline_params["option_" .. event_ident .. "_" .. filter_ident] = true
29 end
30 end
31 end
32 end
34 local setting_key = "liquidfeedback_frontend_timeline_current_date"
35 local setting = Setting:by_pk(app.session.member.id, setting_key)
37 if setting then
38 timeline_params.date = setting.value
39 end
41 request.redirect{
42 module = "timeline",
43 view = "index",
44 params = timeline_params
45 }
