From c89ce7c262be85419e22a168963b30d079e13c4d Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Thu, 10 Apr 2014 06:23:54 +0000 Subject: Changes to use new htmlviewfunctions functions --- freeswitch-listfiles-html.lsp | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) (limited to 'freeswitch-listfiles-html.lsp') diff --git a/freeswitch-listfiles-html.lsp b/freeswitch-listfiles-html.lsp index 02fc1e2..92265ed 100644 --- a/freeswitch-listfiles-html.lsp +++ b/freeswitch-listfiles-html.lsp @@ -42,7 +42,7 @@ end viewlibrary.dispatch_component("status") end %> -

Configuration

+<% local header_level = htmlviewfunctions.displaysectionstart(cfe({label="Configuration"}), page_info) %> @@ -51,14 +51,17 @@ end %> +<% local filename = cfe({ type="hidden", value="" }) %> +<% local redir = cfe({ type="hidden", value=page_info.orig_action }) %> <% for k,v in ipairs( view.value ) do %> @@ -69,18 +72,14 @@ end %>
ActionLast Modified
+ <% filename.value = v.filename %> <% if viewlibrary.check_permission("editfile") then %> - <%= html.link{value=page_info.script..page_info.prefix..page_info.controller.."/editfile?filename="..v.filename.."&redir="..page_info.orig_action, label="Edit "} %> + <% htmlviewfunctions.displayitem(cfe({type="link", value={filename=filename, redir=redir}, label="", option="Edit", action="editfile"}), page_info, -1) %> <% end %> <% if viewlibrary.check_permission("deletefile") then %> - <%= html.link{value=page_info.script..page_info.prefix..page_info.controller.."/deletefile?submit=true&filename="..v.filename, label="Delete "} %> + <% htmlviewfunctions.displayitem(cfe({type="form", value={filename=filename}, label="", option="Delete", action="deletefile"}), page_info, -1) %> <% end %> <%= html.html_escape(v.filename) %>
<% if viewlibrary and viewlibrary.dispatch_component and viewlibrary.check_permission("createfile") then - local createform = viewlibrary.dispatch_component("createfile", nil, true) %> -

<%= html.html_escape(createform.label) %>

-<% + local createform = viewlibrary.dispatch_component("createfile", nil, true) createform.action = page_info.script .. page_info.prefix .. page_info.controller .. "/createfile" - htmlviewfunctions.displayform(createform) + htmlviewfunctions.displayitem(createform, page_info, htmlviewfunctions.incrementheader(header_level)) end %> +<% htmlviewfunctions.displaysectionend(header_level) %> <% if viewlibrary.check_permission("reloadxml") then %> -

Reload XML

-

Reload XML

-
-
-
-
+<% htmlviewfunctions.displaysectionstart(cfe({label="Reload XML"}), page_info, header_level) %> +<% htmlviewfunctions.displayitem(cfe({type="form", value={filename=filename}, label="Reload XML", option="Reload", action="reloadxml"}), page_info, 0) %> +<% htmlviewfunctions.displaysectionend(header_level) %> <% end %> -- cgit v1.2.3