Globally reduce copyright headers
[project/luci.git] / applications / luci-app-freifunk-widgets / luasrc / model / cbi / freifunk / widgets / html.lua
1 -- Copyright 2012 Manuel Munz <freifunk at somakoma dot de>
2 -- Licensed to the public under the Apache License 2.0.
3
4 local map, section = ...
5 local utl = require "luci.util"
6 local fs = require "nixio.fs"
7 local file = "/usr/share/customtext/" .. arg[1] .. ".html"
8
9 local form, ferr = loadfile(utl.libpath() .. "/model/cbi/freifunk/widgets/heightwidth.lua")
10 if form then
11         setfenv(form, getfenv(1))(m, wdg)
12 end
13
14 t = wdg:option(TextValue, "_text")
15 t.rmempty = true
16 t.rows = 20
17
18
19 function t.cfgvalue()
20         return fs.readfile(file) or ""
21 end
22
23 function t.write(self, section, value)
24         return fs.writefile(file, value)
25 end
26
27 function t.remove(self, section)
28         return fs.unlink(file)
29 end
30
31