From 354e4cb4a70d576a4f02e024f3c8fb1e72f09350 Mon Sep 17 00:00:00 2001 From: Sven Roederer Date: Sat, 6 Jul 2019 14:27:42 +0200 Subject: 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 --- modules/luci-base/luasrc/dispatcher.lua | 9 +++++---- .../luasrc/model/cbi/admin_system/backupfiles.lua | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'modules') diff --git a/modules/luci-base/luasrc/dispatcher.lua b/modules/luci-base/luasrc/dispatcher.lua index 57b4e12d1..560140e3d 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 c81466c87..91c654916 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] = "
  • " - files[#files+1] = luci.util.pcdata(ln) + files[#files+1] = luci.xml.pcdata(ln) files[#files+1] = "
  • " end end -- cgit v1.2.3