liquid_feedback_frontend

view config/init.lua @ 817:ab468c8f234b

Going to version 2.0.1
author bsw
date Fri Jul 06 14:20:03 2012 +0200 (2012-07-06)
parents ea2449916c12
children 944d1fe51ecd
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.1"
8 if config.enabled_languages == nil then
9 config.enabled_languages = { 'en', 'de', 'eo', 'el', 'hu' }
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 request.set_404_route{ module = 'index', view = '404' }
41 -- open and set default database handle
42 db = assert(mondelefant.connect(config.database))
43 at_exit(function()
44 db:close()
45 end)
46 function mondelefant.class_prototype:get_db_conn() return db end
48 -- enable output of SQL commands in trace system
49 function db:sql_tracer(command)
50 return function(error_info)
51 local error_info = error_info or {}
52 trace.sql{ command = command, error_position = error_info.position }
53 end
54 end
56 request.set_absolute_baseurl(config.absolute_base_url)
59 -- TODO abstraction
60 -- get record by id
61 function mondelefant.class_prototype:by_id(id)
62 local selector = self:new_selector()
63 selector:add_where{ 'id = ?', id }
64 selector:optional_object_mode()
65 return selector:exec()
66 end

Impressum / About Us