util.dataforms: Add optional type parameters (defaults to 'form')
authorMatthew Wild <mwild1@gmail.com>
Fri, 22 Jan 2010 14:58:31 +0000 (14:58 +0000)
committerMatthew Wild <mwild1@gmail.com>
Fri, 22 Jan 2010 14:58:31 +0000 (14:58 +0000)
util/dataforms.lua

index a3bde8caab1c8879965efef52a9b42a715b03a2c..56671347a86eb4b6fe96cef917f66e5b6c8f90a8 100644 (file)
@@ -23,8 +23,8 @@ function new(layout)
        return setmetatable(layout, form_mt);
 end
 
-function form_t.form(layout, data)
-       local form = st.stanza("x", { xmlns = xmlns_forms, type = "form" });
+function form_t.form(layout, data, formtype)
+       local form = st.stanza("x", { xmlns = xmlns_forms, type = formtype or "form" });
        if layout.title then
                form:tag("title"):text(layout.title):up();
        end