Rewrote state based redirection
[project/luci.git] / libs / web / luasrc / config.lua
index 854b128..258f5e6 100644 (file)
@@ -25,24 +25,9 @@ limitations under the License.
 
 ]]--
 
-module("luci.config", package.seeall)
-require("luci.model.uci")
-require("luci.util")
-require("luci.sys")
-
--- Warning! This is only for fallback and compatibility purporses! --
-main = {}
-
--- This is where stylesheets and images go
-main.mediaurlbase = "/luci/media"
-
--- Does anybody think about browser autodetect here?
--- Too bad busybox doesn't populate HTTP_ACCEPT_LANGUAGE
-main.lang = "de"
-
-
--- Now overwrite with UCI values
-local ucidata = luci.model.uci.sections("luci")
-if ucidata then
-       luci.util.update(luci.config, ucidata)
-end
\ No newline at end of file
+module("luci.config",
+               function(m)
+                       if pcall(require, "luci.model.uci") then
+                               setmetatable(m, {__index = luci.model.uci.cursor():get_all("luci")})
+                       end
+               end)
\ No newline at end of file