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 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'modules/luci-base/luasrc/dispatcher.lua') 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; -- cgit v1.2.3