From 6ba1aef019e891bf10bd4bdcb34cd61cf813f881 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Sun, 8 Nov 2009 02:30:35 +0000 Subject: [PATCH] libs/cbi: - support hidden fields for SimpleForm, NamedSection and TypedSection instances - add support for on_cancel event in SimpleForm instances --- libs/cbi/luasrc/view/cbi/nullsection.htm | 11 ++++++++++- libs/cbi/luasrc/view/cbi/simpleform.htm | 22 ++++++++++++++++++---- libs/cbi/luasrc/view/cbi/ucisection.htm | 2 +- 3 files changed, 29 insertions(+), 6 deletions(-) diff --git a/libs/cbi/luasrc/view/cbi/nullsection.htm b/libs/cbi/luasrc/view/cbi/nullsection.htm index 9520b47ca..f1c715b40 100644 --- a/libs/cbi/luasrc/view/cbi/nullsection.htm +++ b/libs/cbi/luasrc/view/cbi/nullsection.htm @@ -20,4 +20,13 @@ $Id$ <% self:render_children(1, scope or {}) %>
- \ No newline at end of file + + <%- + if type(self.hidden) == "table" then + for k, v in pairs(self.hidden) do + -%> + + <%- + end + end + %> diff --git a/libs/cbi/luasrc/view/cbi/simpleform.htm b/libs/cbi/luasrc/view/cbi/simpleform.htm index d927660da..a0bb0f02b 100644 --- a/libs/cbi/luasrc/view/cbi/simpleform.htm +++ b/libs/cbi/luasrc/view/cbi/simpleform.htm @@ -33,17 +33,31 @@ $Id$ <%- end %> <% if not self.embedded then %>
+<%- + if type(self.hidden) == "table" then + for k, v in pairs(self.hidden) do +-%> + +<%- + end + end +%> <%- if self.flow and self.flow.skip then %> <% end %> <%- if self.submit ~= false then %> - <% end %> <%- if self.reset ~= false then %> - +<% end %> +<%- if self.cancel ~= false and self.on_cancel then %> + <% end %> diff --git a/libs/cbi/luasrc/view/cbi/ucisection.htm b/libs/cbi/luasrc/view/cbi/ucisection.htm index fa083c68f..b184908b0 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 -- 2.25.1