* Added support for timezone setting
[project/luci.git] / modules / admin-core / luasrc / controller / admin / system.lua
index e44e787..862a741 100644 (file)
@@ -1,56 +1,31 @@
-module("luci.controller.admin.system", package.seeall)
+--[[
+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
 
-require("luci.sys")
-require("luci.http")
-require("luci.util")
-require("luci.fs")
-require("luci.model.ipkg")
-require("luci.model.uci")
+       http://www.apache.org/licenses/LICENSE-2.0
+
+$Id$
+]]--
+module("luci.controller.admin.system", package.seeall)
 
 function index()
-       local page  = node("admin", "system")
-       page.target = template("admin_system/index")
-       page.title  = "System"  
-       page.order  = 30
-       
-       local page  = node("admin", "system", "packages")
-       page.target = action_packages
-       page.title  = "Paketverwaltung"
-       page.order  = 10
-       
-       local page  = node("admin", "system", "packages", "ipkg")
-       page.target = action_ipkg
-       page.title  = "IPKG-Konfiguration"
-       
-       local page  = node("admin", "system", "passwd")
-       page.target = action_passwd
-       page.title  = "Passwort ändern"
-       page.order  = 20
-       
-       local page  = node("admin", "system", "sshkeys")
-       page.target = action_sshkeys
-       page.title  = "SSH-Schlüssel"
-       page.order  = 30
-       
-       local page  = node("admin", "system", "hostname")
-       page.target = cbi("admin_system/hostname")
-       page.title  = "Hostname"
-       page.order  = 40
-       
-       local page  = node("admin", "system", "fstab")
-       page.target = cbi("admin_system/fstab")
-       page.title  = "Einhängepunkte"
-       page.order  = 50
-       
-       local page  = node("admin", "system", "upgrade")
-       page.target = action_upgrade
-       page.title  = "Firmwareupgrade"
-       page.order  = 60
-       
-       local page  = node("admin", "system", "reboot")
-       page.target = action_reboot
-       page.title  = "Neu starten"
-       page.order  = 70
+       luci.i18n.loadc("admin-core")
+       local i18n = luci.i18n.translate
+       
+       entry({"admin", "system"}, template("admin_system/index"), i18n("system", "System"), 30)
+       entry({"admin", "system", "packages"}, call("action_packages"), i18n("a_s_packages", "Paketverwaltung"), 10)
+       entry({"admin", "system", "packages", "ipkg"}, call("action_ipkg"), i18n("a_s_p_ipkg", "IPKG-Konfiguration"))
+       entry({"admin", "system", "passwd"}, call("action_passwd"), i18n("a_s_changepw", "Passwort ändern"), 20)
+       entry({"admin", "system", "sshkeys"}, call("action_sshkeys"), i18n("a_s_sshkeys", "SSH-Schlüssel"), 30)
+       entry({"admin", "system", "system"}, cbi("admin_system/system"), i18n("system", "System"), 40)
+       entry({"admin", "system", "fstab"}, cbi("admin_system/fstab"), i18n("a_s_fstab", "Einhängepunkte"), 50)
+       entry({"admin", "system", "upgrade"}, call("action_upgrade"), i18n("a_s_flash", "Firmwareupgrade"), 60)
+       entry({"admin", "system", "reboot"}, call("action_reboot"), i18n("reboot", "Neu starten"), 70)
 end
 
 function action_editor()
@@ -96,7 +71,7 @@ function action_ipkg()
 end
 
 function action_packages()
-       local ipkg = luci.model.ipkg
+       local ipkg = require("luci.model.ipkg")
        local void = nil
        local submit = luci.http.formvalue("submit")
        
@@ -221,6 +196,7 @@ function action_sshkeys()
 end
 
 function action_upgrade()
+       require("luci.model.uci")
        local ret  = nil
        local plat = luci.fs.mtime("/lib/upgrade/platform.sh")
        
@@ -230,7 +206,7 @@ function action_upgrade()
        if plat and image then
                local kpattern = nil
                if keepcfg then
-                       local files = luci.model.uci.sections("luci").flash_keep
+                       local files = luci.model.uci.get_all("luci", "flash_keep")
                        if files.luci and files.luci.flash_keep then
                                kpattern = ""
                                for k,v in pairs(files.luci.flash_keep) do