20d50cceb5d452dd3b7049d58f43f6c499ababdc
[project/luci.git] / modules / admin-full / luasrc / model / cbi / admin_index / luci.lua
1 --[[
2 LuCI - Lua Configuration Interface
3
4 Copyright 2008 Steven Barth <steven@midlink.org>
5
6 Licensed under the Apache License, Version 2.0 (the "License");
7 you may not use this file except in compliance with the License.
8 You may obtain a copy of the License at
9
10 http://www.apache.org/licenses/LICENSE-2.0
11
12 $Id$
13 ]]--
14 require("luci.config")
15 m = Map("luci", translate("webui"), translate("a_i_luci1",
16 "Hier können Eigenschaften und die Funktionalität der Oberfläche angepasst werden."))
17
18 -- force reload of global luci config namespace to reflect the changes
19 function m.commit_handler(self)
20 package.loaded["luci.config"] = nil
21 require("luci.config")
22 end
23
24
25 c = m:section(NamedSection, "main", "core", translate("general"))
26
27 l = c:option(ListValue, "lang", translate("language"))
28 l:value("auto")
29
30 local i18ndir = luci.i18n.i18ndir .. "default."
31 for k, v in pairs(luci.config.languages) do
32 if k:sub(1, 1) ~= "." and luci.fs.access(i18ndir .. k:gsub("_", "-") .. ".lua") then
33 l:value(k, v)
34 end
35 end
36
37 t = c:option(ListValue, "mediaurlbase", translate("design"))
38 for k, v in pairs(luci.config.themes) do
39 if k:sub(1, 1) ~= "." then
40 t:value(v, k)
41 end
42 end
43
44 u = m:section(NamedSection, "uci_oncommit", "event", translate("a_i_ucicommit"),
45 translate("a_i_ucicommit1"))
46 u.dynamic = true
47
48 f = m:section(NamedSection, "flash_keep", "extern", translate("a_i_keepflash"),
49 translate("a_i_keepflash1"))
50 f.dynamic = true
51
52 return m