diff options
author | Ted Trask <ttrask01@yahoo.com> | 2015-01-31 11:02:43 -0500 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2015-01-31 11:02:43 -0500 |
commit | a2282961bdfc320ba2d0041a0a599c1505ba166b (patch) | |
tree | 380dee765016099b882026109df9125d8d7e27b2 /app/template-stream.lsp | |
parent | 8877abc6a86e33fe02cfea92f842e146c100f834 (diff) | |
download | acf-core-a2282961bdfc320ba2d0041a0a599c1505ba166b.tar.bz2 acf-core-a2282961bdfc320ba2d0041a0a599c1505ba166b.tar.xz |
Modify stream template to handle group cfes by sending the raw cfe in the group
Diffstat (limited to 'app/template-stream.lsp')
-rw-r--r-- | app/template-stream.lsp | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/app/template-stream.lsp b/app/template-stream.lsp index 17693af..9ed4ab7 100644 --- a/app/template-stream.lsp +++ b/app/template-stream.lsp @@ -1,4 +1,19 @@ -<% local viewtable, viewlibrary, pageinfo, session = ... %> +<% local view, viewlibrary, page_info, session = ... %> +<% +local viewtable = view +if view.type == "group" then + viewtable = nil + for name,value in pairs(view.value) do + if value.type == "raw" then + viewtable = value + break + end + end + if not viewtable then + return + end +end +%> Status: 200 OK Content-Type: <% print(viewtable.option or "application/octet-stream") %> <% if viewtable.length then %> @@ -9,4 +24,4 @@ Content-Length: <%= viewtable.length %> Content-Disposition: attachment; filename="<%= viewtable.label %>" <% end %> <% io.write("\n") %> -<% pageinfo.viewfunc(viewtable, viewlibrary, pageinfo, session) %> +<% page_info.viewfunc(viewtable, viewlibrary, page_info, session) %> |