liquid_feedback_frontend

view config/init.lua @ 877:46c8736b95ad

Going to version 2.0.5
author bsw
date Sat Aug 18 23:17:00 2012 +0200 (2012-08-18)
parents 1eb36d7b04a7
children e3887fea39fa
line source
1 -- ========================================================================
2 -- DO NOT CHANGE ANYTHING IN THIS FILE
3 -- (except when you really know what you are doing!)
4 -- ========================================================================
6 config.app_version = "2.0.5"
8 if config.enabled_languages == nil then
9 config.enabled_languages = { 'en', 'de', 'eo', 'el', 'hu', 'it', 'nl', 'zh-Hans', 'zh-TW' }
10 end
12 if config.default_lang == nil then
13 config.default_lang = "en"
14 end
16 if config.mail_subject_prefix == nil then
17 config.mail_subject_prefix = "[LiquidFeedback] "
18 end
20 if config.member_image_content_type == nil then
21 config.member_image_content_type = "image/jpeg"
22 end
24 if config.member_image_convert_func == nil then
25 config.member_image_convert_func = {
26 avatar = function(data) return extos.pfilter(data, "convert", "jpeg:-", "-thumbnail", "48x48", "jpeg:-") end,
27 photo = function(data) return extos.pfilter(data, "convert", "jpeg:-", "-thumbnail", "240x240", "jpeg:-") end
28 }
29 end
31 if config.locked_profile_fields == nil then
32 config.locked_profile_fields = {}
33 end
35 if not config.database then
36 config.database = { engine='postgresql', dbname='liquid_feedback' }
37 end
39 if not config.enable_debug_trace then
40 trace.disable()
41 else
42 slot.put_into('trace_button', '<div id="trace_show" onclick="document.getElementById(\'trace_content\').style.display=\'block\';this.style.display=\'none\';">TRACE</div>')
43 end
46 request.set_404_route{ module = 'index', view = '404' }
48 -- open and set default database handle
49 db = assert(mondelefant.connect(config.database))
50 at_exit(function()
51 db:close()
52 end)
53 function mondelefant.class_prototype:get_db_conn() return db end
55 -- enable output of SQL commands in trace system
56 function db:sql_tracer(command)
57 return function(error_info)
58 local error_info = error_info or {}
59 trace.sql{ command = command, error_position = error_info.position }
60 end
61 end
63 request.set_absolute_baseurl(config.absolute_base_url)
66 -- TODO abstraction
67 -- get record by id
68 function mondelefant.class_prototype:by_id(id)
69 local selector = self:new_selector()
70 selector:add_where{ 'id = ?', id }
71 selector:optional_object_mode()
72 return selector:exec()
73 end

Impressum / About Us