diff options
author | Steven Barth <steven@midlink.org> | 2008-03-26 20:55:14 +0000 |
---|---|---|
committer | Steven Barth <steven@midlink.org> | 2008-03-26 20:55:14 +0000 |
commit | 68d142e79287e9b5e9f980f37b546070a38fc478 (patch) | |
tree | 8d165ffd6e50795b7f140efb0e7ed7f103d2e47d /src/ffluci/template.lua | |
parent | 5f9910566de7165f4bb0ee62bc3ace53c708a94e (diff) |
* CBI update
* Added some configuration pages
* Introduced contact site
* Introduced luci UCI config file
Diffstat (limited to 'src/ffluci/template.lua')
-rw-r--r-- | src/ffluci/template.lua | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/ffluci/template.lua b/src/ffluci/template.lua index 17f36194fd..f7131488ef 100644 --- a/src/ffluci/template.lua +++ b/src/ffluci/template.lua @@ -52,9 +52,9 @@ compiler_enable_bytecode = false -- Define the namespace for template modules viewns = { translate = ffluci.i18n.translate, - config = ffluci.model.uci.get, + config = function(...) return ffluci.model.uci.get(...) or "" end, controller = os.getenv("SCRIPT_NAME"), - media = ffluci.config.mediaurlbase, + media = ffluci.config.main.mediaurlbase, write = io.write, include = function(name) Template(name):render(getfenv(2)) end, } @@ -108,7 +108,7 @@ function compile(template) elseif p == "~" then re = sanitize(v):gsub("~(.-)%.(.-)%.(.+)", r_uci) elseif p == "=" then - re = r_pexec:format(string.sub(v, 2)) + re = r_pexec:format(v:sub(2)) else re = r_exec:format(v) end @@ -120,6 +120,10 @@ function compile(template) template = string.dump(tf) end + c = c or 1 + ffluci.fs.writefile("/tmp/"..tostring(c), template) + c = c+1 + return template end |