liquid_feedback_frontend

diff app/main/draft/_action/add.lua @ 1045:701a5cf6b067

Imported LiquidFeedback Frontend 3.0 branch
author bsw
date Thu Jul 10 01:19:48 2014 +0200 (2014-07-10)
parents 1997cf1da04b
children 24f4c23f76ff
line diff
     1.1 --- a/app/main/draft/_action/add.lua	Thu Jul 10 01:02:43 2014 +0200
     1.2 +++ b/app/main/draft/_action/add.lua	Thu Jul 10 01:19:48 2014 +0200
     1.3 @@ -25,19 +25,24 @@
     1.4    return false
     1.5  end
     1.6  
     1.7 -local formatting_engine = param.get("formatting_engine")
     1.8 +local formatting_engine
     1.9 +if config.enforce_formatting_engine then
    1.10 +  formatting_engine = config.enforce_formatting_engine 
    1.11 +else
    1.12 +  formatting_engine = param.get("formatting_engine")
    1.13  
    1.14 -local formatting_engine_valid = false
    1.15 -for fe, dummy in pairs(config.formatting_engine_executeables) do
    1.16 -  if formatting_engine == fe then
    1.17 -    formatting_engine_valid = true
    1.18 +  local formatting_engine_valid = false
    1.19 +  for i, fe in pairs(config.formatting_engines) do
    1.20 +    if formatting_engine == fe.id then
    1.21 +      formatting_engine_valid = true
    1.22 +    end
    1.23 +  end
    1.24 +  if not formatting_engine_valid then
    1.25 +    error("invalid formatting engine!")
    1.26    end
    1.27  end
    1.28 -if not formatting_engine_valid then
    1.29 -  error("invalid formatting engine!")
    1.30 -end
    1.31  
    1.32 -if param.get("preview") then
    1.33 +if param.get("preview") or param.get("edit") then
    1.34    return false
    1.35  end
    1.36  
    1.37 @@ -57,5 +62,5 @@
    1.38  
    1.39  draft:render_content()
    1.40  
    1.41 -slot.put_into("notice", _"New draft has been added to initiative")
    1.42 +slot.put_into("notice", _"The initiative text has been updated")
    1.43  

Impressum / About Us