1 local fs = require "nixio.fs"
2 local file = "/www/luci-static/index_user.html"
3 luci.i18n.loadc("freifunk")
5 m = Map("freifunk", translate("Edit index page"), translate("You can display additional content on the public index page by inserting valid XHTML in the form below.<br />Headlines should be enclosed between <h2> and </h2>."))
7 s = m:section(NamedSection, "community", "public", "")
10 di = s:option(Flag, "DefaultText", translate("Disable default content"), translate("If selected then the default content element is not shown."))
11 di.enabled = "disabled"
12 di.disabled = "enabled"
15 t = s:option(TextValue, "_text")
20 return fs.readfile(file) or ""
23 function t.write(self, section, value)
24 return fs.writefile(file, value)
27 function t.remove(self, section)
28 return fs.unlink(file)