liquid_feedback_frontend

changeset 1229:f853aa830f0d

Removed code which is not used
author bsw
date Tue Dec 01 17:53:01 2015 +0100 (2015-12-01)
parents 554b739f86d6
children 02772bc49467
files app/main/help/_action/update.lua app/main/help/show.lua
line diff
     1.1 --- a/app/main/help/_action/update.lua	Tue Dec 01 17:43:16 2015 +0100
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,15 +0,0 @@
     1.4 -local help_ident = param.get("help_ident")
     1.5 -local hide = param.get("hide", atom.boolean)
     1.6 -
     1.7 -local setting_key = "liquidfeedback_frontend_hidden_help_" .. help_ident
     1.8 -local setting = Setting:by_pk(app.session.member.id, setting_key)
     1.9 -
    1.10 -if hide == true and not setting then
    1.11 -  setting = Setting:new()
    1.12 -  setting.member_id = app.session.member.id
    1.13 -  setting.key = setting_key
    1.14 -  setting.value = "hidden"
    1.15 -  setting:save()
    1.16 -elseif hide == false and setting then
    1.17 -  setting:destroy()
    1.18 -end
     2.1 --- a/app/main/help/show.lua	Tue Dec 01 17:43:16 2015 +0100
     2.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.3 @@ -1,37 +0,0 @@
     2.4 -local id = param.get_id(atom.string)
     2.5 -
     2.6 -if not id then
     2.7 -  id = "index"
     2.8 -else
     2.9 -  -- sanity check. Only allow letters, digits and _-
    2.10 -  id = string.match(id, "[%a%d_-]*")
    2.11 -end
    2.12 -
    2.13 -if not app.html_title.title then
    2.14 -  app.html_title.title = _("Help #{id}", { id = id })
    2.15 -end
    2.16 -
    2.17 -local basepath = request.get_app_basepath() 
    2.18 -local found_help = false
    2.19 --- we try to load any help file that fits best
    2.20 -for x,lang in ipairs{locale.get("lang"), "en"} do
    2.21 -  local file_name = basepath .. "/locale/help/" .. id .. "." .. lang .. ".txt.html"
    2.22 -  local file = io.open(file_name)
    2.23 -  if file ~= nil then
    2.24 -    local help_text = file:read("*a")
    2.25 -    if #help_text > 0 then
    2.26 -      found_help = true
    2.27 -      ui.container{
    2.28 -        attr = { class = "wiki" },
    2.29 -        content = function()
    2.30 -          slot.put(help_text)
    2.31 -        end
    2.32 -      }
    2.33 -      break
    2.34 -    end
    2.35 -  end
    2.36 -end
    2.37 -
    2.38 -if not found_help then
    2.39 -  ui.field.text{ value = _("Missing help text: #{id}.#{lang}.txt", { id = id, lang = locale.get("lang") }) }
    2.40 -end

Impressum / About Us