summaryrefslogtreecommitdiffhomepage
path: root/modules/niu/luasrc/model
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2009-10-31 17:27:07 +0000
committerSteven Barth <steven@midlink.org>2009-10-31 17:27:07 +0000
commitb2671410bf5468443d6eb49f525d6c3e3fd7e28f (patch)
treea30a7a6fa499bde367fe4696a786bf3f06a356fa /modules/niu/luasrc/model
parentbd43ccc886b54dbfa3e6fc41d1a132d289884a87 (diff)
NIU: Fixes, System
Diffstat (limited to 'modules/niu/luasrc/model')
-rw-r--r--modules/niu/luasrc/model/cbi/niu/system/general.lua17
-rw-r--r--modules/niu/luasrc/model/cbi/niu/system/general1.lua45
2 files changed, 62 insertions, 0 deletions
diff --git a/modules/niu/luasrc/model/cbi/niu/system/general.lua b/modules/niu/luasrc/model/cbi/niu/system/general.lua
new file mode 100644
index 0000000000..df438e8b5a
--- /dev/null
+++ b/modules/niu/luasrc/model/cbi/niu/system/general.lua
@@ -0,0 +1,17 @@
+local cursor = require "luci.model.uci".cursor()
+local d = Delegator()
+d.allow_finish = true
+d.allow_back = true
+d.allow_cancel = true
+
+d:add("general1", load("niu/system/general1"))
+
+function d.on_cancel()
+ cursor:revert("system")
+end
+
+function d.on_done()
+ cursor:commit("system")
+end
+
+return d \ No newline at end of file
diff --git a/modules/niu/luasrc/model/cbi/niu/system/general1.lua b/modules/niu/luasrc/model/cbi/niu/system/general1.lua
new file mode 100644
index 0000000000..532583828e
--- /dev/null
+++ b/modules/niu/luasrc/model/cbi/niu/system/general1.lua
@@ -0,0 +1,45 @@
+--[[
+LuCI - Lua Configuration Interface
+
+Copyright 2008 Steven Barth <steven@midlink.org>
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+$Id$
+]]--
+
+local fs = require "nixio.fs"
+local i18n = require "luci.i18n"
+local util = require "luci.util"
+local config = require "luci.config"
+
+m = Map("system", translate("System"))
+
+s = m:section(TypedSection, "system", "")
+s.anonymous = true
+s.addremove = false
+
+hn = s:option(Value, "hostname", translate("Hostname"))
+
+
+
+m2 = Map("luci", translate("Web <abbr title=\"User Interface\">UI</abbr>"))
+
+
+c = m2:section(NamedSection, "main", "core")
+
+l = c:option(ListValue, "lang", translate("Language"))
+l:value("auto")
+
+local i18ndir = i18n.i18ndir .. "default."
+for k, v in util.kspairs(config.languages) do
+ local file = i18ndir .. k:gsub("_", "-")
+ if k:sub(1, 1) ~= "." and fs.access(file .. ".lmo") then
+ l:value(k, v)
+ end
+end
+return m, m2