diff options
author | Ted Trask <ttrask01@yahoo.com> | 2014-04-25 07:00:06 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2014-04-25 07:00:06 +0000 |
commit | a15984cf2eacb65eed22a39cacc9641a7b39032a (patch) | |
tree | 8ba1b75db959f4439daf28809f5249435f4bc245 /tinydns-edit-html.lsp | |
parent | 8c98538ce0b76fe67c4d29ae53232cbcd618d830 (diff) | |
download | acf-tinydns-a15984cf2eacb65eed22a39cacc9641a7b39032a.tar.bz2 acf-tinydns-a15984cf2eacb65eed22a39cacc9641a7b39032a.tar.xz |
Changes to use new htmlviewfunctions functions
Diffstat (limited to 'tinydns-edit-html.lsp')
-rw-r--r-- | tinydns-edit-html.lsp | 55 |
1 files changed, 39 insertions, 16 deletions
diff --git a/tinydns-edit-html.lsp b/tinydns-edit-html.lsp index 2dcfc81..3ea17a7 100644 --- a/tinydns-edit-html.lsp +++ b/tinydns-edit-html.lsp @@ -18,6 +18,8 @@ var addEntry = '<tr><td> \ <a href="javascript:;"><img src="<%= html.html_escape(page_info.wwwprefix..page_info.staticdir) %>/tango/16x16/actions/list-add.png" width="16" height="16" title="Insert record"></a> \ </td></tr>'; + <% local replaceableItem = cfe({label="ReplaceLabel", value="ReplaceValue", name="ReplaceName", descr="ReplaceExtra"}) %> + var replaceableEntry = '<% htmlviewfunctions.displayformitem(replaceableItem) %>'; function Entry(entryType,descr,num,descr0,descr1,descr2,descr3,descr4,descr5,descr6,descr7,descr8,descr9,descr10){ this.entryType=entryType; @@ -121,7 +123,7 @@ name = "testme"; } - form = form + '<div class='item'><p class='left'>' + entryType.descriptions[i] + '</p>\n<div class='right'>\n<input type="text" value="' + value + '" name="' + name + '">' + extra + '\n</div></div><!-- end .item -->'; + form = form + replaceableEntry.replace("ReplaceLabel", entryType.descriptions[i]).replace("ReplaceValue", value).replace("ReplaceName", name).replace("ReplaceExtra", extra); } form = form + "\n</dl>"; entry.empty().append(form); @@ -192,18 +194,34 @@ }); </script> -<h1>Configuration</h1> -<h2>Expert Configuration</h2> -<h3>File Details</h3> -<% +<% +local header_level0, header_level, header_level2 +if form.type == "form" then + header_level0 = htmlviewfunctions.displaysectionstart(cfe({label="Configuration"}), page_info) + header_level = htmlviewfunctions.displaysectionstart(cfe({label="Expert Configuration"}), page_info, htmlviewfunctions.incrementheader(header_level0)) +else + header_level = htmlviewfunctions.displaysectionstart(cfe({label="View File"}), page_info) +end +header_level2 = htmlviewfunctions.displaysectionstart(cfe({label="File Details"}), page_info, htmlviewfunctions.incrementheader(header_level)) + htmlviewfunctions.displayitem(form.value.filename) htmlviewfunctions.displayitem(form.value.filesize) htmlviewfunctions.displayitem(form.value.mtime) -%> +if form.value.grep and form.value.grep.value and form.value.grep.value ~= "" then + htmlviewfunctions.displayitem(form.value.grep) +end + +htmlviewfunctions.displaysectionend(header_level2) -<h3>File Entries</h3> -<% if form.descr then %><p class='descr'><%= string.gsub(html.html_escape(form.descr), "\n", "<br/>") %></p><% end %> -<% if form.errtxt then %><p class='error'><%= string.gsub(html.html_escape(form.errtxt), "\n", "<br/>") %></p><% end %> +htmlviewfunctions.displaysectionstart(cfe({label="File Entries"}), page_info, header_level2) +if form.type == "form" then + htmlviewfunctions.displayformstart(form, page_info) + form.value.filename.type = "hidden" + htmlviewfunctions.displayformitem(form.value.filename, "filename") + form.value.filecontent.type = "hidden" + htmlviewfunctions.displayformitem(form.value.filecontent, "filecontent") +end +%> <table id="entries"> <% for line in string.gmatch(html.html_escape(form.value.filecontent.value), "([^\n]*)\n?") do %> <tr> @@ -211,11 +229,16 @@ htmlviewfunctions.displayitem(form.value.mtime) </tr> <% end %> </table> -<% if form.value.filecontent.errtxt then %><p class='error'><%= string.gsub(html.html_escape(form.value.filecontent.errtxt), "\n", "<br/>") %></p><% end %> +<% +htmlviewfunctions.displayinfo(form.value.filecontent) + +if form.type == "form" then + htmlviewfunctions.displayformend(form) +end +htmlviewfunctions.displaysectionend(header_level2) -<% form.action = page_info.script .. page_info.prefix .. page_info.controller .. "/" .. page_info.action %> -<% htmlviewfunctions.displayformstart(form) %> -<input type="hidden" name="filename" value="<%= html.html_escape(form.value.filename.value) %>"> -<input type="hidden" name="filecontent" value="<%= html.html_escape(form.value.filecontent.value) %>"> -<h2>Save and Apply Above Settings</h2> -<% htmlviewfunctions.displayformend(form) %> +htmlviewfunctions.displaysectionend(header_level) +if form.type == "form" then + htmlviewfunctions.displaysectionend(header_level0) +end +%> |