summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2014-04-10 07:04:00 +0000
committerTed Trask <ttrask01@yahoo.com>2014-04-10 07:04:00 +0000
commitf89b6d884af1ce1507fea24675b360cdf6e3a1c0 (patch)
tree902bee89a1c94a580f1adeaee8183c0256d16fe7
parent8483bc397f2e6adb2befa2153b8c375684bae441 (diff)
downloadacf-iptables-f89b6d884af1ce1507fea24675b360cdf6e3a1c0.tar.bz2
acf-iptables-f89b6d884af1ce1507fea24675b360cdf6e3a1c0.tar.xz
Changes to use new htmlviewfunctions functions
-rw-r--r--iptables-details-html.lsp9
-rw-r--r--iptables-editrule-html.lsp28
-rw-r--r--iptables-filterrules-html.lsp3
3 files changed, 22 insertions, 18 deletions
diff --git a/iptables-details-html.lsp b/iptables-details-html.lsp
index 8b6fbe0..49b6f21 100644
--- a/iptables-details-html.lsp
+++ b/iptables-details-html.lsp
@@ -1,14 +1,17 @@
-<% local data, viewlibrary = ...
+<% local data, viewlibrary, page_info, session = ...
html = require("acf.html")
%>
<% viewlibrary.dispatch_component("status") %>
-<h2><%= html.html_escape(data.label) %></h2>
+<% local header_level = htmlviewfunctions.displaysectionstart(data, page_info) %>
+<% local header_level2 = htmlviewfunctions.incrementheader(header_level) %>
<% for i,tab in ipairs({"filter", "nat", "mangle"}) do %>
- <h3><%= html.html_escape(tab) %></h3>
+ <% htmlviewfunctions.displaysectionstart(cfe({label=tab}), page_info, header_level2) %>
<table>
<tr><td><%= html.html_escape(data.value[tab].chains) %> Chains</td></tr>
<tr><td><%= html.html_escape(data.value[tab].rules) %> Rules</td></tr>
</table>
+ <% htmlviewfunctions.displaysectionend(header_level2) %>
<% end %>
+<% htmlviewfunctions.displaysectionend(header_level) %>
diff --git a/iptables-editrule-html.lsp b/iptables-editrule-html.lsp
index 42f64df..98f3966 100644
--- a/iptables-editrule-html.lsp
+++ b/iptables-editrule-html.lsp
@@ -3,25 +3,23 @@ htmlviewfunctions = require("htmlviewfunctions")
html = require("acf.html")
%>
-<h1><%= html.html_escape(form.label) %></h1>
<%
+local header_level = htmlviewfunctions.displaysectionstart(form, page_info)
+local header_level2 = htmlviewfunctions.incrementheader(header_level)
for name,val in pairs(form.value) do val.name = name end
form.value.table.readonly = true
form.value.table.type = "text"
form.value.chain.readonly = true
form.value.position.readonly = true
-form.action = page_info.script .. page_info.prefix .. page_info.controller .. "/" .. page_info.action
-htmlviewfunctions.displayformstart(form)
-%>
+htmlviewfunctions.displayformstart(form, page_info)
-<h2>Rule Identification</h2>
-<%
+htmlviewfunctions.displaysectionstart(cfe({label="Rule Identification"}), page_info, header_level2)
htmlviewfunctions.displayformitem(form.value.table)
htmlviewfunctions.displayformitem(form.value.chain)
htmlviewfunctions.displayformitem(form.value.position)
-%>
-<h2>Basic Parameters</h2>
-<%
+htmlviewfunctions.displaysectionend(header_level2)
+
+htmlviewfunctions.displaysectionstart(cfe({label="Basic Parameters"}), page_info, header_level2)
htmlviewfunctions.displayformitem(form.value.jump)
htmlviewfunctions.displayformitem(form.value.protocol)
htmlviewfunctions.displayformitem(form.value.in_interface)
@@ -31,9 +29,9 @@ htmlviewfunctions.displayformitem(form.value.destination)
htmlviewfunctions.displayformitem(form.value.goto)
htmlviewfunctions.displayformitem(form.value.fragment)
htmlviewfunctions.displayformitem(form.value.set_counters)
-%>
-<h2>Extended Parameters</h2>
-<%
+htmlviewfunctions.displaysectionend(header_level2)
+
+htmlviewfunctions.displaysectionstart(cfe({label="Extended Parameters"}), page_info, header_level2)
htmlviewfunctions.displayformitem(form.value.comment)
htmlviewfunctions.displayformitem(form.value.addrtype_src_type)
htmlviewfunctions.displayformitem(form.value.addrtype_dst_type)
@@ -49,6 +47,8 @@ htmlviewfunctions.displayformitem(form.value.tcp_sport)
htmlviewfunctions.displayformitem(form.value.tcp_dport)
htmlviewfunctions.displayformitem(form.value.udp_sport)
htmlviewfunctions.displayformitem(form.value.udp_dport)
+htmlviewfunctions.displaysectionend(header_level2)
+
+htmlviewfunctions.displayformend(form, header_level2)
+htmlviewfunctions.displaysectionend(header_level)
%>
-<h2><%= html.html_escape(form.option) %></h2>
-<% htmlviewfunctions.displayformend(form) %>
diff --git a/iptables-filterrules-html.lsp b/iptables-filterrules-html.lsp
index ce84799..2b89ece 100644
--- a/iptables-filterrules-html.lsp
+++ b/iptables-filterrules-html.lsp
@@ -4,7 +4,7 @@
<% htmlviewfunctions.displaycommandresults({"editchain", "deletechain", "createrule", "deleterule", "editrule", "createchain"}, session) %>
-<h1><%= html.html_escape(data.label) %></h1>
+<% local header_level = htmlviewfunctions.displaysectionstart(data, page_info) %>
<table>
<% local tab = data.value.table %>
<% for j,chain in ipairs(data.value) do %>
@@ -38,3 +38,4 @@
<% end %>
<tr><td><a href="<%= html.html_escape(page_info.script..page_info.prefix..page_info.controller.."/createchain?table="..tab.."&redir="..page_info.orig_action) %>"><img src='<%= html.html_escape(page_info.wwwprefix..page_info.staticdir) %>/tango/16x16/actions/list-add.png' width='16' height='16' title="Create Chain"></a></td></tr>
</table>
+<% htmlviewfunctions.displaysectionend(header_level) %>