Commit 63d5de70 authored by Ted Trask's avatar Ted Trask

Changes to use new htmlviewfunctions functions

parent 8c84c4c0
This diff is collapsed.
......@@ -24,7 +24,8 @@ html = require("acf.html")
<% htmlviewfunctions.displaycommandresults({"createuser", "deleteuser", "editusersettings"}, session) %>
<h1>Users</h1>
<% local header_level = htmlviewfunctions.displaysectionstart(view, page_info) %>
<% local header_level2 = htmlviewfunctions.incrementheader(header_level) %>
<table id="list" class="tablesorter"><thead>
<tr>
<th>Action</th>
......@@ -33,14 +34,17 @@ html = require("acf.html")
<th>Last Name</th>
</tr>
</thead><tbody>
<% local username = cfe({ type="hidden", value="" }) %>
<% local redir = cfe({ type="hidden", value=page_info.orig_action }) %>
<% for k,v in ipairs( view.value ) do %>
<tr>
<td>
<% username.value = v.username %>
<% if viewlibrary.check_permission("editusersettings") then %>
<%= html.link{value=page_info.script..page_info.prefix..page_info.controller.."/editusersettings?username="..v.username, label="Edit "} %>
<% htmlviewfunctions.displayitem(cfe({type="link", value={username=username, redir=redir}, label="", option="Edit", action="editusersettings"}), page_info, -1) %>
<% end %>
<% if viewlibrary.check_permission("deleteuser") then %>
<%= html.link{value=page_info.script..page_info.prefix..page_info.controller.."/deleteuser?username="..v.username.."&submit=true", label="Delete ", class="deleteuser"} %>
<% htmlviewfunctions.displayitem(cfe({type="form", value={username=username}, label="", option="Delete", action="deleteuser", class="deleteuser" }), page_info, -1) %>
<% end %>
</td>
<td><%= html.html_escape(v.username) %></td>
......@@ -59,23 +63,11 @@ html = require("acf.html")
<% end %>
<% if viewlibrary and viewlibrary.dispatch_component and viewlibrary.check_permission("createuser") then %>
<h2>Create New User</h2>
<form action="<%= html.html_escape(page_info.script .. page_info.prefix .. page_info.controller) %>/createuser" method="post">
<input class="hidden" type="hidden" name="redir" value="<%= html.html_escape(page_info.orig_action) %>" >
<div class='item'><p class='left'></p>
<div class='right'>
<input class="submit" type="submit" value="Create">
</div></div><!-- end .item -->
</form>
<% htmlviewfunctions.displayitem(cfe({type="link", value={redir=redir}, label="Create New User", option="Create", action="createuser" }), page_info, header_level2) %>
<% end %>
<% if viewlibrary and viewlibrary.dispatch_component and viewlibrary.check_permission("createmanyusers") then %>
<h2>Create Multiple Users</h2>
<form action="<%= html.html_escape(page_info.script .. page_info.prefix .. page_info.controller) %>/createmanyusers" method="post">
<input class="hidden" type="hidden" name="redir" value="<%= html.html_escape(page_info.orig_action) %>" >
<div class='item'><p class='left'></p>
<div class='right'>
<input class="submit" type="submit" value="Create">
</div></div><!-- end .item -->
</form>
<% htmlviewfunctions.displayitem(cfe({type="link", value={redir=redir}, label="Create Multiple Users", option="Create", action="createmanyusers" }), page_info, header_level2) %>
<% end %>
<% htmlviewfunctions.displaysectionend(header_level) %>
......@@ -380,7 +380,7 @@ mymodule.list_messages = function(username)
if not res and err then
errtxt = err
end
return cfe({ type="structure", value=retval, label="List of Messages", errtxt=errtxt })
return cfe({ type="structure", value=retval, label="Messages", errtxt=errtxt })
end
mymodule.get_message = function(message, username)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment