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
<%+cbi/valueheader%>
<% if self.href then %><a href="<%=self.href%>"><% end -%>
- <%=luci.util.pcdata(self:cfgvalue(section))%>
+ <%=pcdata(self:cfgvalue(section))%>
<%- if self.href then %></a><%end%>
 
-<input type="hidden" id="<%=cbid%>" value="<%=luci.util.pcdata(self:cfgvalue(section))%>" />
+<input type="hidden" id="<%=cbid%>" value="<%=pcdata(self:cfgvalue(section))%>" />
<%+cbi/valuefooter%>
for i=1, #vals + 1 do
local val = vals[i]
%>
- <input class="cbi-input-text" value="<%=luci.util.pcdata(val)%>" onchange="cbi_d_update(this.id)" type="text"<%= attr("id", cbid .. "." .. i) .. attr("name", cbid) .. ifattr(self.size, "size")%> />
+ <input class="cbi-input-text" value="<%=pcdata(val)%>" onchange="cbi_d_update(this.id)" type="text"<%= attr("id", cbid .. "." .. i) .. attr("name", cbid) .. ifattr(self.size, "size")%> />
<% if i <= #vals then %>
<input class="cbi-input-image" type="image" value="<%:cbi_del%>" name="cbi.rle.<%=section .. "." .. self.option .. "." .. i%>" alt="<%:cbi_del%>" title="<%:cbi_del%>" src="<%=resource%>/cbi/remove.gif" />
<% else %>
self._apply = nil
local line = fp:read()
while line do
- write("<li>" .. luci.util.pcdata(line) .. "</li>\n")
+ write("<li>" .. pcdata(line) .. "</li>\n")
line = fp:read()
end
fp:close()
<% if self.error then %>
<div class="cbi-section-error">
<ul><% for _, c in pairs(self.error) do for _, e in ipairs(c) do -%>
- <li><%=luci.util.pcdata(e):gsub("\n","<br />")%></li>
+ <li><%=pcdata(e):gsub("\n","<br />")%></li>
<%- end end %></ul>
</div>
<% end %>
-%>
<%+cbi/valueheader%>
<textarea class="cbi-input-textarea" <% if not self.size then %> style="width: 100%"<% else %> cols="<%=self.size%>"<% end %> onchange="cbi_d_update(this.id)"<%= attr("name", cbid) .. attr("id", cbid) .. ifattr(self.rows, "rows") .. ifattr(self.wrap, "wrap") %>>
- <%-=luci.util.pcdata(self:cfgvalue(section))-%>
+ <%-=pcdata(self:cfgvalue(section))-%>
</textarea>
<%+cbi/valuefooter%>
if type(self.hidden) == "table" then
for k, v in pairs(self.hidden) do
-%>
- <input type="hidden" id="cbid.<%=self.config%>.<%=section%>.<%=k%>" name="cbid.<%=self.config%>.<%=section%>.<%=k%>" value="<%=luci.util.pcdata(v)%>" />
+ <input type="hidden" id="cbid.<%=self.config%>.<%=section%>.<%=k%>" name="cbid.<%=self.config%>.<%=section%>.<%=k%>" value="<%=pcdata(v)%>" />
<%-
end
end
<% if self.error and self.error[section] then -%>
<div class="cbi-section-error">
- <ul><% for _, e in ipairs(self.error[section]) do %><li><%=luci.util.pcdata(e):gsub("\n","<br />")%></li><% end %></ul>
+ <ul><% for _, e in ipairs(self.error[section]) do %><li><%=pcdata(e):gsub("\n","<br />")%></li><% end %></ul>
</div>
<%- end %>