summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2015-01-31 11:02:43 -0500
committerTed Trask <ttrask01@yahoo.com>2015-01-31 11:02:43 -0500
commita2282961bdfc320ba2d0041a0a599c1505ba166b (patch)
tree380dee765016099b882026109df9125d8d7e27b2
parent8877abc6a86e33fe02cfea92f842e146c100f834 (diff)
downloadacf-core-a2282961bdfc320ba2d0041a0a599c1505ba166b.tar.bz2
acf-core-a2282961bdfc320ba2d0041a0a599c1505ba166b.tar.xz
Modify stream template to handle group cfes by sending the raw cfe in the group
-rw-r--r--app/template-stream.lsp19
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) %>