liquid_feedback_frontend
annotate app/main/index/_motd.lua @ 62:0e75b5f04fe5
Show motd only if available
| author | bsw | 
|---|---|
| date | Thu Apr 22 16:15:23 2010 +0200 (2010-04-22) | 
| parents | 4f39f0a0d5b5 | 
| children | c553898f64cb | 
| rev | line source | 
|---|---|
| bsw@57 | 1 local lang = locale.get("lang") | 
| bsw@57 | 2 local basepath = request.get_app_basepath() | 
| bsw@57 | 3 local file_name = basepath .. "/locale/motd/" .. lang .. ".txt" | 
| bsw@57 | 4 local file = io.open(file_name) | 
| bsw@57 | 5 if file ~= nil then | 
| bsw@57 | 6 local help_text = file:read("*a") | 
| bsw@57 | 7 if #help_text > 0 then | 
| bsw@57 | 8 ui.container{ | 
| bsw@57 | 9 attr = { class = "wiki" }, | 
| bsw@57 | 10 content = function() | 
| bsw@57 | 11 slot.put(format.wiki_text(help_text)) | 
| bsw@57 | 12 end | 
| bsw@57 | 13 } | 
| bsw@57 | 14 end | 
| bsw@57 | 15 end |