local fs = require "luci.fs"
local has_custom_splash = fs.access("/usr/lib/luci-splash/splashtext.html")
-function expand (e)
+function expand (e, R)
return (string.gsub(e, "###([A-Z_]+)###", R))
end
-local community, homepage, leasetime, limit_up, limit_down, R
+local community, homepage, leasetime, limit_up, limit_down
local contacturl = luci.dispatcher.build_url("freifunk", "contact")
end
if has_custom_splash then
-
- R = {
+ local R = {
COMMUNITY = community,
COMMUNITY_URL = homepage,
LEASETIME = leasetime,
LIMIT = limit_text,
CONTACTURL = contacturl
}
-
- local splashtext = expand(fs.readfile("/usr/lib/luci-splash/splashtext.html"))
+ local splashtext = expand(fs.readfile("/usr/lib/luci-splash/splashtext.html"), R)
%>
<%=splashtext%>