FORM_VALID = 1
FORM_INVALID = -1
FORM_CHANGED = 2
+FORM_SKIP = 4
AUTO = true
-- Use optimized UCI writing
function Map.parse(self, readinput, ...)
self.readinput = (readinput ~= false)
+
+ if self:formvalue("cbi.skip") then
+ self.state = FORM_SKIP
+ return self:state_handler(self.state)
+ end
+
Node.parse(self, ...)
if self.save then
for i, config in ipairs(self.parsechain) do
self.uci:save(config)
end
- if self:submitstate() and not self.proceed and (self.autoapply or luci.http.formvalue("cbi.apply")) then
+ if self:submitstate() and not self.proceed and (self.flow.autoapply or luci.http.formvalue("cbi.apply")) then
for i, config in ipairs(self.parsechain) do
self.uci:commit(config)
function SimpleForm.parse(self, readinput, ...)
self.readinput = (readinput ~= false)
+
+ if self:formvalue("cbi.skip") then
+ return FORM_SKIP
+ end
+
if self:submitstate() then
Node.parse(self, 1, ...)
end
-%>
<%- if pageaction then -%>
<div class="cbi-page-actions">
+ <% if flow.skip then %>
+ <input class="cbi-button cbi-button-skip" type="submit" name="cbi.skip" value="<%:skip Skip%>" />
+ <% end %>
<% if not autoapply then%>
<input class="cbi-button cbi-button-apply" type="submit" name="cbi.apply" value="<%:saveapply%>" />
<% end %>
<%- end %>
<% if not self.embedded then %>
<div>
+<%- if self.flow.skip then %>
+ <input class="cbi-button cbi-button-skip" type="submit" name="cbi.skip" value="<%:skip Skip%>" />
+<% end %>
<%- if self.submit ~= false then %>
<input class="cbi-button-save" type="submit" value="
<%- if not self.submit then -%><%-:submit-%><%-else-%><%=self.submit%><%end-%>
local state = nil
for i, res in ipairs(maps) do
- if config.autoapply then
- res.autoapply = config.autoapply
- end
+ res.flow = config
local cstate = res:parse()
if cstate and (not state or cstate < state) then
state = cstate
end
end
if not config.nofooter then
- tpl.render("cbi/footer", {pageaction=pageaction, state = state, autoapply = config.autoapply})
+ tpl.render("cbi/footer", {flow = config, pageaction=pageaction, state = state, autoapply = config.autoapply})
end
end