summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2008-07-29 14:01:19 +0000
committerSteven Barth <steven@midlink.org>2008-07-29 14:01:19 +0000
commit43ffb3aacbe78fd7ed19217c23438f14acaa27f5 (patch)
tree47c2f458dc599b1186e264dc1b8197774fddbbb5
parent1f3700085c59ea3b3ed162277948771d41a57ccc (diff)
libs/cbi: Added "Save & Apply" button to CBI forms
-rw-r--r--i18n/english/luasrc/i18n/cbi.en.lua1
-rw-r--r--i18n/german/luasrc/i18n/cbi.de.lua1
-rw-r--r--libs/cbi/luasrc/cbi.lua3
-rw-r--r--libs/cbi/luasrc/view/cbi/footer.htm1
4 files changed, 6 insertions, 0 deletions
diff --git a/i18n/english/luasrc/i18n/cbi.en.lua b/i18n/english/luasrc/i18n/cbi.en.lua
index 14153989f..4cebd2488 100644
--- a/i18n/english/luasrc/i18n/cbi.en.lua
+++ b/i18n/english/luasrc/i18n/cbi.en.lua
@@ -4,3 +4,4 @@ cbi_invalid = "Error: Invalid input value"
cbi_addopt = "-- Additional Field --"
cbi_optional = " (optional)"
cbi_sectempty = "This section contains no values yet"
+cbi_saveapply = "Save & Apply"
diff --git a/i18n/german/luasrc/i18n/cbi.de.lua b/i18n/german/luasrc/i18n/cbi.de.lua
index f3ed31900..f0eb7b6ae 100644
--- a/i18n/german/luasrc/i18n/cbi.de.lua
+++ b/i18n/german/luasrc/i18n/cbi.de.lua
@@ -3,3 +3,4 @@ cbi_del = "Eintrag entfernen"
cbi_invalid = "Error: Ungültige Eingabe"
cbi_addopt = "-- Zusätzliches Feld --"
cbi_sectempty = "Diese Sektion enthält noch keine Einträge"
+cbi_saveapply = "Speichern & Anwenden" \ No newline at end of file
diff --git a/libs/cbi/luasrc/cbi.lua b/libs/cbi/luasrc/cbi.lua
index 6aec2fbbb..e6952899f 100644
--- a/libs/cbi/luasrc/cbi.lua
+++ b/libs/cbi/luasrc/cbi.lua
@@ -154,6 +154,9 @@ end
function Map.parse(self, ...)
Node.parse(self, ...)
uci.save(self.config)
+ if luci.http.formvalue("cbi.apply") then
+ uci.commit(self.config)
+ end
uci.unload(self.config)
end
diff --git a/libs/cbi/luasrc/view/cbi/footer.htm b/libs/cbi/luasrc/view/cbi/footer.htm
index 4d21fd168..9ff8de7fd 100644
--- a/libs/cbi/luasrc/view/cbi/footer.htm
+++ b/libs/cbi/luasrc/view/cbi/footer.htm
@@ -14,6 +14,7 @@ $Id$
-%>
<div>
+ <input type="submit" name="cbi.apply" value="<%:cbi_saveapply%>" />
<input type="submit" value="<%:save%>" />
<input type="reset" value="<%:reset%>" />
<script type="text/javascript">cbi_d_init();</script>