libs/cbi: attach pcdata() to template scope and use it
[project/luci.git] / libs / cbi / luasrc / view / cbi / dvalue.htm
index c218783..819860a 100644 (file)
@@ -14,14 +14,9 @@ $Id$
 -%>
 
 <%+cbi/valueheader%>
-<% if self.value then
-       if type(self.value) == "function" then %>
-       <%=luci.util.pcdata(self:value(section))%>
-<% else %>
-       <%=luci.util.pcdata(self.value)%>
-<%     end
-else %>
-       <%=luci.util.pcdata(self:cfgvalue(section))%>
-<% end %>
+<% if self.href then %><a href="<%=self.href%>"><% end -%>
+       <%=pcdata(self:cfgvalue(section))%>
+<%- if self.href then %></a><%end%>
 &#160;
+<input type="hidden" id="<%=cbid%>" value="<%=pcdata(self:cfgvalue(section))%>" />
 <%+cbi/valuefooter%>