Update my email addresses in the license headers
[project/luci.git] / modules / luci-mod-admin-mini / luasrc / model / cbi / mini / luci.lua
1 -- Copyright 2008 Steven Barth <steven@midlink.org>
2 -- Copyright 2008 Jo-Philipp Wich <jow@openwrt.org>
3 -- Licensed to the public under the Apache License 2.0.
4
5 require "luci.config"
6 local fs = require "nixio.fs"
7
8 m = Map("luci", translate("Web <abbr title=\"User Interface\">UI</abbr>"), translate("Here you can customize the settings and the functionality of <abbr title=\"Lua Configuration Interface\">LuCI</abbr>."))
9
10 -- force reload of global luci config namespace to reflect the changes
11 function m.commit_handler(self)
12         package.loaded["luci.config"] = nil
13         require "luci.config"
14 end
15
16
17 c = m:section(NamedSection, "main", "core", translate("General"))
18
19 l = c:option(ListValue, "lang", translate("Language"))
20 l:value("auto")
21
22 local i18ndir = luci.i18n.i18ndir .. "base."
23 for k, v in luci.util.kspairs(luci.config.languages) do
24         local file = i18ndir .. k:gsub("_", "-")
25         if k:sub(1, 1) ~= "." and fs.access(file .. ".lmo") then
26                 l:value(k, v)
27         end
28 end
29
30 t = c:option(ListValue, "mediaurlbase", translate("Design"))
31 for k, v in pairs(luci.config.themes) do
32         if k:sub(1, 1) ~= "." then
33                 t:value(v, k)
34         end
35 end
36
37 return m