diff options
author | Sven Roederer <freifunk@it-solutions.geroedel.de> | 2019-07-06 14:27:42 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2020-07-19 20:14:47 +0200 |
commit | 354e4cb4a70d576a4f02e024f3c8fb1e72f09350 (patch) | |
tree | a011f0f0e332b7d70ca8b367058d3dd21fe45723 /modules | |
parent | 68521fca04e9b2ae801cc2daa4f920a2c43bc03f (diff) |
treewide: adapt to new luci.xml class
In the previous commit the luci.xml module was created, Let's change all
references to the old functions to the new xml-module.
Signed-off-by: Sven Roederer <freifunk@it-solutions.geroedel.de>
Diffstat (limited to 'modules')
-rw-r--r-- | modules/luci-base/luasrc/dispatcher.lua | 9 | ||||
-rw-r--r-- | modules/luci-mod-system/luasrc/model/cbi/admin_system/backupfiles.lua | 2 |
2 files changed, 6 insertions, 5 deletions
diff --git a/modules/luci-base/luasrc/dispatcher.lua b/modules/luci-base/luasrc/dispatcher.lua index 57b4e12d17..560140e3d3 100644 --- a/modules/luci-base/luasrc/dispatcher.lua +++ b/modules/luci-base/luasrc/dispatcher.lua @@ -5,6 +5,7 @@ local fs = require "nixio.fs" local sys = require "luci.sys" local util = require "luci.util" +local xml = require "luci.xml" local http = require "luci.http" local nixio = require "nixio", require "nixio.util" @@ -276,7 +277,7 @@ local function tree_to_json(node, json) if type(node.nodes) == "table" then for subname, subnode in pairs(node.nodes) do local spec = { - title = util.striptags(subnode.title), + title = xml.striptags(subnode.title), order = subnode.order } @@ -741,7 +742,7 @@ local function init_template_engine(ctx) (scope and type(scope[key]) ~= "function" and scope[key]) or "") if noescape ~= true then - val = util.pcdata(val) + val = xml.pcdata(val) end return string.format(' %s="%s"', tostring(key), val) @@ -756,8 +757,8 @@ local function init_template_engine(ctx) translate = i18n.translate; translatef = i18n.translatef; export = function(k, v) if tpl.context.viewns[k] == nil then tpl.context.viewns[k] = v end end; - striptags = util.striptags; - pcdata = util.pcdata; + striptags = xml.striptags; + pcdata = xml.pcdata; media = media; theme = fs.basename(media); resource = luci.config.main.resourcebase; diff --git a/modules/luci-mod-system/luasrc/model/cbi/admin_system/backupfiles.lua b/modules/luci-mod-system/luasrc/model/cbi/admin_system/backupfiles.lua index c81466c874..91c6549163 100644 --- a/modules/luci-mod-system/luasrc/model/cbi/admin_system/backupfiles.lua +++ b/modules/luci-mod-system/luasrc/model/cbi/admin_system/backupfiles.lua @@ -68,7 +68,7 @@ else break else files[#files+1] = "<li>" - files[#files+1] = luci.util.pcdata(ln) + files[#files+1] = luci.xml.pcdata(ln) files[#files+1] = "</li>" end end |