From dc253f4af41caab2430fe1fbc69ff092d6fb2d04 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Sat, 20 Sep 2008 22:11:41 +0000 Subject: * luci/libs/cbi: implement commit hooks in cbi maps * luci/moules/admin-mini: reload global config namespace when change theme or language (for persistent environments) * luci/moules/admin-full: reload global config namespace when change theme or language (for persistent environments) --- modules/admin-mini/luasrc/model/cbi/mini/luci.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'modules/admin-mini/luasrc/model') diff --git a/modules/admin-mini/luasrc/model/cbi/mini/luci.lua b/modules/admin-mini/luasrc/model/cbi/mini/luci.lua index 1b0f3b1029..8d4e7053d4 100644 --- a/modules/admin-mini/luasrc/model/cbi/mini/luci.lua +++ b/modules/admin-mini/luasrc/model/cbi/mini/luci.lua @@ -15,6 +15,13 @@ $Id$ require("luci.config") m = Map("luci", translate("webui"), translate("a_i_luci1")) +-- force reload of global luci config namespace to reflect the changes +function m.commit_handler(self) + package.loaded["luci.config"] = nil + require("luci.config") +end + + c = m:section(NamedSection, "main", "core", translate("general")) l = c:option(ListValue, "lang", translate("language")) @@ -33,4 +40,4 @@ for k, v in pairs(luci.config.themes) do end end -return m \ No newline at end of file +return m -- cgit v1.2.3