2 LuCI - Lua Configuration Interface
4 Copyright 2008 Steven Barth <steven@midlink.org>
5 Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
6 Copyright 2010 Manuel Munz <freifunk@somakoma.de>
8 Licensed under the Apache License, Version 2.0 (the "License");
9 you may not use this file except in compliance with the License.
10 You may obtain a copy of the License at
12 http://www.apache.org/licenses/LICENSE-2.0
15 local fs = require "nixio.fs"
16 luci.i18n.loadc("splash")
18 local splashtextfile = "/usr/lib/luci-splash/splashtext.html"
20 f = SimpleForm("splashtext", translate("Edit Splash text"),
21 translate("You can enter your own text that is displayed to clients here.<br />" ..
22 "It is possible to use the following markers: " ..
23 "###COMMUNITY###, ###COMMUNITY_URL###, ###CONTACTURL###, ###LEASETIME###, ###LIMIT### and ###ACCEPT###."))
25 t = f:field(TextValue, "text")
29 return fs.readfile(splashtextfile) or ""
32 function f.handle(self, state, data)
33 if state == FORM_VALID then
35 fs.writefile(splashtextfile, data.text:gsub("\r\n", "\n"))