summaryrefslogtreecommitdiffhomepage
path: root/libs/web
diff options
context:
space:
mode:
Diffstat (limited to 'libs/web')
-rw-r--r--libs/web/luasrc/dispatcher.lua17
-rw-r--r--libs/web/root/etc/config/luci21
2 files changed, 23 insertions, 15 deletions
diff --git a/libs/web/luasrc/dispatcher.lua b/libs/web/luasrc/dispatcher.lua
index e769fd7b1..e9d3b24d1 100644
--- a/libs/web/luasrc/dispatcher.lua
+++ b/libs/web/luasrc/dispatcher.lua
@@ -128,9 +128,6 @@ function dispatch()
tpl.viewns.media = luci.config.main.mediaurlbase
tpl.viewns.resource = luci.config.main.resourcebase
- -- Load default translation
- require("luci.i18n").loadc("default")
-
if c and type(c.target) == "function" then
dispatched = c
@@ -224,10 +221,20 @@ function createtree()
end
require("luci.i18n")
+
+ -- Load default translation
+ luci.i18n.loadc("default")
+
+ local scope = _G
+ for k,v in pairs(_M) do
+ if type(v) == "function" then
+ scope[k] = v
+ end
+ end
for k, v in pairs(index) do
- luci.util.updfenv(v, _M)
- luci.util.extfenv(v, "_NAME", k)
+ scope._NAME = k
+ setfenv(v, scope)
local stat, err = pcall(v)
if not stat then
diff --git a/libs/web/root/etc/config/luci b/libs/web/root/etc/config/luci
index 701c93938..5fefe5b27 100644
--- a/libs/web/root/etc/config/luci
+++ b/libs/web/root/etc/config/luci
@@ -1,33 +1,33 @@
config core main
option lang de
- option mediaurlbase /luci-static/fledermaus
+ option mediaurlbase /luci-static/openwrt.org
option resourcebase /luci-static/resources
config core brand
- option title "OpenWRT Kamikaze"
- option subtitle Freifunkedition
- option firmware "OpenWRT Kamikaze"
- option distro "Freifunk Firmware 2.x"
+ option title "OpenWRT Kamikaze"
+ option subtitle "Lua Configuration Interface"
+ option firmware "OpenWRT Kamikaze"
+ option distro "Development Snapshot"
config extern flash_keep
- option uci "/etc/config"
+ option uci "/etc/config"
option dropbear "/etc/dropbear"
option openvpn "/etc/openvpn"
option passwd "/etc/passwd"
- option ipkg "/etc/ipkg.conf"
+ option ipkg "/etc/ipkg.conf"
option httpd "/etc/httpd.conf"
option firewall "/etc/firewall.user"
config event uci_oncommit
option network "/etc/init.d/network restart"
option wireless "/etc/init.d/network restart"
- option olsr "/sbin/reboot"
- option dhcp "/etc/init.d/dnsmasq restart"
+ option olsr "/etc/init.d/olsrd restart"
+ option dhcp "/etc/init.d/dnsmasq restart"
option luci_fw "/etc/init.d/luci_fw restart"
option dropbear "/etc/init.d/dropbear restart"
option httpd "/etc/init.d/httpd restart"
option fstab "/etc/init.d/fstab restart"
- option qos "/etc/init.d/qos restart"
+ option qos "/etc/init.d/qos restart"
option luci_splash "/etc/init.d/luci_splash restart"
option freifunk "/etc/init.d/luci_freifunk restart"
@@ -36,4 +36,5 @@ config internal languages
option en "English"
config internal themes
+ option OpenWRT "/luci-static/openwrt.org"
option Fledermaus "/luci-static/fledermaus"