summaryrefslogtreecommitdiffhomepage
path: root/libs/cbi
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2008-08-15 20:42:25 +0000
committerSteven Barth <steven@midlink.org>2008-08-15 20:42:25 +0000
commit8e4afe121087c05833ee7d567fe45f2ba270e54d (patch)
tree20d64661cd0c2bb67b2e440886ae3bae55b31f07 /libs/cbi
parent1d4196b3ff1bceaa858ffbee637bf212d5b5d428 (diff)
Several escaping fixes
Updated XML translation system Use the new Table widget for DHCP leases
Diffstat (limited to 'libs/cbi')
-rw-r--r--libs/cbi/luasrc/cbi.lua10
1 files changed, 6 insertions, 4 deletions
diff --git a/libs/cbi/luasrc/cbi.lua b/libs/cbi/luasrc/cbi.lua
index 7bcfceb2ef..ab342feec1 100644
--- a/libs/cbi/luasrc/cbi.lua
+++ b/libs/cbi/luasrc/cbi.lua
@@ -92,10 +92,10 @@ function Node._i18n(self, config, section, option, title, description)
-- i18n loaded?
if type(luci.i18n) == "table" then
- local key = config:gsub("[^%w]+", "")
+ local key = config and config:gsub("[^%w]+", "") or ""
if section then key = key .. "_" .. section:lower():gsub("[^%w]+", "") end
- if option then key = key .. "_" .. option:lower():gsub("[^%w]+", "") end
+ if option then key = key .. "_" .. tostring(option):lower():gsub("[^%w]+", "") end
self.title = title or luci.i18n.translate( key, option or section or config )
self.description = description or luci.i18n.translate( key .. "_desc", "" )
@@ -483,13 +483,15 @@ Table = class(AbstractSection)
function Table.__init__(self, form, data, ...)
local datasource = {}
+ datasource.config = "table"
self.data = data
function datasource.get(self, section, option)
- return data[option]
+ return data[section][option]
end
- AbstractSection.__init__(self, datasource, nil, ...)
+ AbstractSection.__init__(self, datasource, "table", ...)
+ self.template = "cbi/tblsection"
end
function Table.cfgsections(self)