diff options
Diffstat (limited to 'freeswitch-listfiles-html.lsp')
-rw-r--r-- | freeswitch-listfiles-html.lsp | 25 |
1 files changed, 12 insertions, 13 deletions
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 %> -<h1>Configuration</h1> +<% local header_level = htmlviewfunctions.displaysectionstart(cfe({label="Configuration"}), page_info) %> <table id="list" class="tablesorter"><thead> <tr> <th>Action</th> @@ -51,14 +51,17 @@ end %> <th>Last Modified</th> </tr> </thead><tbody> +<% local filename = cfe({ type="hidden", value="" }) %> +<% local redir = cfe({ type="hidden", value=page_info.orig_action }) %> <% for k,v in ipairs( view.value ) do %> <tr> <td> + <% 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 %> </td> <td><%= html.html_escape(v.filename) %></td> @@ -69,18 +72,14 @@ end %> </tbody></table> <% if viewlibrary and viewlibrary.dispatch_component and viewlibrary.check_permission("createfile") then - local createform = viewlibrary.dispatch_component("createfile", nil, true) %> -<h2><%= html.html_escape(createform.label) %></h2> -<% + 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 %> -<h1>Reload XML</h1> - <div class='item'><p class='left'>Reload XML</p> - <div class='right'> - <form action="<%= html.html_escape(page_info.script .. page_info.prefix) %>freeswitch/reloadxml" method="post"> - <input class="submit" type="submit" name="submit" value="Reload"></form> - </div></div><!-- end .item --> +<% 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 %> |