simpleform.htm 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <% if not self.embedded then %>
  2. <form method="post" enctype="multipart/form-data" action="<%=REQUEST_URI%>">
  3. <div>
  4. <script type="text/javascript" src="<%=resource%>/cbi.js"></script>
  5. <input type="hidden" name="cbi.submit" value="1" />
  6. </div>
  7. <% end %>
  8. <div class="cbi-map" id="cbi-<%=self.config%>">
  9. <% if self.title and #self.title > 0 then %><h2><a id="content" name="content"><%=self.title%></a></h2><% end %>
  10. <% if self.description and #self.description > 0 then %><div class="cbi-map-descr"><%=self.description%></div><% end %>
  11. <% self:render_children() %>
  12. <br />
  13. </div>
  14. <%- if self.message then %>
  15. <div><%=self.message%></div>
  16. <%- end %>
  17. <%- if self.errmessage then %>
  18. <div class="error"><%=self.errmessage%></div>
  19. <%- end %>
  20. <% if not self.embedded then %>
  21. <div class="cbi-page-actions">
  22. <%-
  23. if type(self.hidden) == "table" then
  24. for k, v in pairs(self.hidden) do
  25. -%>
  26. <input type="hidden" id="<%=k%>" name="<%=k%>" value="<%=pcdata(v)%>" />
  27. <%-
  28. end
  29. end
  30. %>
  31. <% if redirect then %>
  32. <div style="float:left">
  33. <input class="cbi-button cbi-button-link" type="button" value="<%:Back to Overview%>" onclick="location.href='<%=pcdata(redirect)%>'" />
  34. </div>
  35. <% end %>
  36. <%- if self.flow and self.flow.skip then %>
  37. <input class="cbi-button cbi-button-skip" type="submit" name="cbi.skip" value="<%:Skip%>" />
  38. <% end %>
  39. <%- if self.submit ~= false then %>
  40. <input class="cbi-button cbi-button-save" type="submit" value="
  41. <%- if not self.submit then -%><%-:Submit-%><%-else-%><%=self.submit%><%end-%>
  42. " />
  43. <% end %>
  44. <%- if self.reset ~= false then %>
  45. <input class="cbi-button cbi-button-reset" type="reset" value="
  46. <%- if not self.reset then -%><%-:Reset-%><%-else-%><%=self.reset%><%end-%>
  47. " />
  48. <% end %>
  49. <%- if self.cancel ~= false and self.on_cancel then %>
  50. <input class="cbi-button cbi-button-reset" type="submit" name="cbi.cancel" value="
  51. <%- if not self.cancel then -%><%-:Cancel-%><%-else-%><%=self.cancel%><%end-%>
  52. " />
  53. <% end %>
  54. <script type="text/javascript">cbi_d_update();</script>
  55. </div>
  56. </form>
  57. <% end %>