From: Jo-Philipp Wich Date: Thu, 13 Aug 2009 17:14:25 +0000 (+0000) Subject: libs/cbi: attach pcdata() to template scope and use it X-Git-Tag: 0.10.0~1196 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=892ed55ba08d3d5553e621e57d69a3eb8ffa4efc;p=oweals%2Fluci.git libs/cbi: attach pcdata() to template scope and use it --- diff --git a/libs/cbi/luasrc/cbi.lua b/libs/cbi/luasrc/cbi.lua index 83f5c27e7..044993a6a 100644 --- a/libs/cbi/luasrc/cbi.lua +++ b/libs/cbi/luasrc/cbi.lua @@ -1340,6 +1340,7 @@ function AbstractValue.render(self, s, scope) scope.section = s scope.cbid = self:cbid(s) scope.striptags = luci.util.striptags + scope.pcdata = luci.util.pcdata scope.ifattr = function(cond,key,val) if cond then diff --git a/libs/cbi/luasrc/view/cbi/dvalue.htm b/libs/cbi/luasrc/view/cbi/dvalue.htm index 28cd9ab94..819860a06 100644 --- a/libs/cbi/luasrc/view/cbi/dvalue.htm +++ b/libs/cbi/luasrc/view/cbi/dvalue.htm @@ -15,8 +15,8 @@ $Id$ <%+cbi/valueheader%> <% if self.href then %><% end -%> - <%=luci.util.pcdata(self:cfgvalue(section))%> + <%=pcdata(self:cfgvalue(section))%> <%- if self.href then %><%end%>   - + <%+cbi/valuefooter%> diff --git a/libs/cbi/luasrc/view/cbi/dynlist.htm b/libs/cbi/luasrc/view/cbi/dynlist.htm index 1f3b90141..cbde2efb3 100644 --- a/libs/cbi/luasrc/view/cbi/dynlist.htm +++ b/libs/cbi/luasrc/view/cbi/dynlist.htm @@ -18,7 +18,7 @@ $Id$ for i=1, #vals + 1 do local val = vals[i] %> - /> + /> <% if i <= #vals then %> " alt="<%:cbi_del%>" title="<%:cbi_del%>" src="<%=resource%>/cbi/remove.gif" /> <% else %> diff --git a/libs/cbi/luasrc/view/cbi/map.htm b/libs/cbi/luasrc/view/cbi/map.htm index 949edea5c..0b5ac5881 100644 --- a/libs/cbi/luasrc/view/cbi/map.htm +++ b/libs/cbi/luasrc/view/cbi/map.htm @@ -24,7 +24,7 @@ $Id$ self._apply = nil local line = fp:read() while line do - write("
  • " .. luci.util.pcdata(line) .. "
  • \n") + write("
  • " .. pcdata(line) .. "
  • \n") line = fp:read() end fp:close() diff --git a/libs/cbi/luasrc/view/cbi/tblsection.htm b/libs/cbi/luasrc/view/cbi/tblsection.htm index 029ad661c..99b5b97b5 100644 --- a/libs/cbi/luasrc/view/cbi/tblsection.htm +++ b/libs/cbi/luasrc/view/cbi/tblsection.htm @@ -109,7 +109,7 @@ end <% if self.error then %>
    <% end %> diff --git a/libs/cbi/luasrc/view/cbi/tvalue.htm b/libs/cbi/luasrc/view/cbi/tvalue.htm index 36782d82d..b628c5c52 100644 --- a/libs/cbi/luasrc/view/cbi/tvalue.htm +++ b/libs/cbi/luasrc/view/cbi/tvalue.htm @@ -14,6 +14,6 @@ $Id$ -%> <%+cbi/valueheader%> <%+cbi/valuefooter%> diff --git a/libs/cbi/luasrc/view/cbi/ucisection.htm b/libs/cbi/luasrc/view/cbi/ucisection.htm index 7e8467cfc..241681f26 100644 --- a/libs/cbi/luasrc/view/cbi/ucisection.htm +++ b/libs/cbi/luasrc/view/cbi/ucisection.htm @@ -17,7 +17,7 @@ $Id$ if type(self.hidden) == "table" then for k, v in pairs(self.hidden) do -%> - + <%- end end @@ -27,7 +27,7 @@ $Id$ <% if self.error and self.error[section] then -%>
    - +
    <%- end %>