From b2671410bf5468443d6eb49f525d6c3e3fd7e28f Mon Sep 17 00:00:00 2001 From: Steven Barth Date: Sat, 31 Oct 2009 17:27:07 +0000 Subject: NIU: Fixes, System --- .../niu/luasrc/model/cbi/niu/system/general.lua | 17 ++++++++ .../niu/luasrc/model/cbi/niu/system/general1.lua | 45 ++++++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 modules/niu/luasrc/model/cbi/niu/system/general.lua create mode 100644 modules/niu/luasrc/model/cbi/niu/system/general1.lua (limited to 'modules/niu/luasrc/model') 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 + +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 UI")) + + +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 -- cgit v1.2.3