Software /
code /
prosody
Annotate
util/dataforms.lua @ 955:98ca5a753fee
util.dataforms: Support for retriving the field value data from forms
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Sat, 04 Apr 2009 18:08:35 +0100 |
parent | 954:72e4639c9310 |
child | 956:4c3f3d60a2f4 |
rev | line source |
---|---|
951
4b9207949735
util.dataforms: Fixed to actually work, mostly
Matthew Wild <mwild1@gmail.com>
parents:
851
diff
changeset
|
1 local setmetatable = setmetatable; |
4b9207949735
util.dataforms: Fixed to actually work, mostly
Matthew Wild <mwild1@gmail.com>
parents:
851
diff
changeset
|
2 local pairs, ipairs = pairs, ipairs; |
954
72e4639c9310
util.dataforms: Fixes for hidden field type
Matthew Wild <mwild1@gmail.com>
parents:
953
diff
changeset
|
3 local tostring, type = tostring, type; |
72e4639c9310
util.dataforms: Fixes for hidden field type
Matthew Wild <mwild1@gmail.com>
parents:
953
diff
changeset
|
4 local t_concat = table.concat; |
72e4639c9310
util.dataforms: Fixes for hidden field type
Matthew Wild <mwild1@gmail.com>
parents:
953
diff
changeset
|
5 |
951
4b9207949735
util.dataforms: Fixed to actually work, mostly
Matthew Wild <mwild1@gmail.com>
parents:
851
diff
changeset
|
6 local st = require "util.stanza"; |
845
fc3dced9801e
util.dataforms: First commit, incomplete
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
7 |
fc3dced9801e
util.dataforms: First commit, incomplete
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
8 module "dataforms" |
fc3dced9801e
util.dataforms: First commit, incomplete
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
9 |
fc3dced9801e
util.dataforms: First commit, incomplete
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
10 local xmlns_forms = 'jabber:x:data'; |
fc3dced9801e
util.dataforms: First commit, incomplete
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
11 |
fc3dced9801e
util.dataforms: First commit, incomplete
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
12 local form_t = {}; |
fc3dced9801e
util.dataforms: First commit, incomplete
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
13 local form_mt = { __index = form_t }; |
fc3dced9801e
util.dataforms: First commit, incomplete
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
14 |
fc3dced9801e
util.dataforms: First commit, incomplete
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
15 function new(layout) |
fc3dced9801e
util.dataforms: First commit, incomplete
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
16 return setmetatable(layout, form_mt); |
fc3dced9801e
util.dataforms: First commit, incomplete
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
17 end |
fc3dced9801e
util.dataforms: First commit, incomplete
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
18 |
fc3dced9801e
util.dataforms: First commit, incomplete
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
19 local form_x_attr = { xmlns = xmlns_forms }; |
fc3dced9801e
util.dataforms: First commit, incomplete
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
20 |
fc3dced9801e
util.dataforms: First commit, incomplete
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
21 function form_t.form(layout, data) |
951
4b9207949735
util.dataforms: Fixed to actually work, mostly
Matthew Wild <mwild1@gmail.com>
parents:
851
diff
changeset
|
22 local form = st.stanza("x", form_x_attr); |
4b9207949735
util.dataforms: Fixed to actually work, mostly
Matthew Wild <mwild1@gmail.com>
parents:
851
diff
changeset
|
23 if layout.title then |
4b9207949735
util.dataforms: Fixed to actually work, mostly
Matthew Wild <mwild1@gmail.com>
parents:
851
diff
changeset
|
24 form:tag("title"):text(layout.title):up(); |
4b9207949735
util.dataforms: Fixed to actually work, mostly
Matthew Wild <mwild1@gmail.com>
parents:
851
diff
changeset
|
25 end |
4b9207949735
util.dataforms: Fixed to actually work, mostly
Matthew Wild <mwild1@gmail.com>
parents:
851
diff
changeset
|
26 if layout.instructions then |
4b9207949735
util.dataforms: Fixed to actually work, mostly
Matthew Wild <mwild1@gmail.com>
parents:
851
diff
changeset
|
27 form:tag("instructions"):text(layout.instructions):up(); |
4b9207949735
util.dataforms: Fixed to actually work, mostly
Matthew Wild <mwild1@gmail.com>
parents:
851
diff
changeset
|
28 end |
845
fc3dced9801e
util.dataforms: First commit, incomplete
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
29 for n, field in ipairs(layout) do |
951
4b9207949735
util.dataforms: Fixed to actually work, mostly
Matthew Wild <mwild1@gmail.com>
parents:
851
diff
changeset
|
30 local field_type = field.type or "text-single"; |
845
fc3dced9801e
util.dataforms: First commit, incomplete
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
31 -- Add field tag |
951
4b9207949735
util.dataforms: Fixed to actually work, mostly
Matthew Wild <mwild1@gmail.com>
parents:
851
diff
changeset
|
32 form:tag("field", { type = field_type, var = field.name, label = field.label }); |
845
fc3dced9801e
util.dataforms: First commit, incomplete
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
33 |
fc3dced9801e
util.dataforms: First commit, incomplete
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
34 local value = data[field.name]; |
fc3dced9801e
util.dataforms: First commit, incomplete
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
35 |
fc3dced9801e
util.dataforms: First commit, incomplete
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
36 -- Add value, depending on type |
fc3dced9801e
util.dataforms: First commit, incomplete
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
37 if field_type == "hidden" then |
fc3dced9801e
util.dataforms: First commit, incomplete
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
38 if type(value) == "table" then |
fc3dced9801e
util.dataforms: First commit, incomplete
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
39 -- Assume an XML snippet |
954
72e4639c9310
util.dataforms: Fixes for hidden field type
Matthew Wild <mwild1@gmail.com>
parents:
953
diff
changeset
|
40 form:tag("value") |
72e4639c9310
util.dataforms: Fixes for hidden field type
Matthew Wild <mwild1@gmail.com>
parents:
953
diff
changeset
|
41 :add_child(value) |
72e4639c9310
util.dataforms: Fixes for hidden field type
Matthew Wild <mwild1@gmail.com>
parents:
953
diff
changeset
|
42 :up(); |
845
fc3dced9801e
util.dataforms: First commit, incomplete
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
43 elseif value then |
954
72e4639c9310
util.dataforms: Fixes for hidden field type
Matthew Wild <mwild1@gmail.com>
parents:
953
diff
changeset
|
44 form:tag("value"):text(tostring(value)):up(); |
845
fc3dced9801e
util.dataforms: First commit, incomplete
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
45 end |
fc3dced9801e
util.dataforms: First commit, incomplete
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
46 elseif field_type == "boolean" then |
953
bed748f5dbb1
util.dataforms: Fix some field types which didn't render properly
Matthew Wild <mwild1@gmail.com>
parents:
952
diff
changeset
|
47 form:tag("value"):text((value and "1") or "0"):up(); |
845
fc3dced9801e
util.dataforms: First commit, incomplete
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
48 elseif field_type == "fixed" then |
fc3dced9801e
util.dataforms: First commit, incomplete
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
49 |
fc3dced9801e
util.dataforms: First commit, incomplete
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
50 elseif field_type == "jid-multi" then |
fc3dced9801e
util.dataforms: First commit, incomplete
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
51 for _, jid in ipairs(value) do |
fc3dced9801e
util.dataforms: First commit, incomplete
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
52 form:tag("value"):text(jid):up(); |
fc3dced9801e
util.dataforms: First commit, incomplete
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
53 end |
fc3dced9801e
util.dataforms: First commit, incomplete
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
54 elseif field_type == "jid-single" then |
fc3dced9801e
util.dataforms: First commit, incomplete
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
55 form:tag("value"):text(value):up(); |
951
4b9207949735
util.dataforms: Fixed to actually work, mostly
Matthew Wild <mwild1@gmail.com>
parents:
851
diff
changeset
|
56 elseif field_type == "text-single" or field_type == "text-private" then |
4b9207949735
util.dataforms: Fixed to actually work, mostly
Matthew Wild <mwild1@gmail.com>
parents:
851
diff
changeset
|
57 form:tag("value"):text(value):up(); |
4b9207949735
util.dataforms: Fixed to actually work, mostly
Matthew Wild <mwild1@gmail.com>
parents:
851
diff
changeset
|
58 elseif field_type == "text-multi" then |
4b9207949735
util.dataforms: Fixed to actually work, mostly
Matthew Wild <mwild1@gmail.com>
parents:
851
diff
changeset
|
59 -- Split into multiple <value> tags, one for each line |
4b9207949735
util.dataforms: Fixed to actually work, mostly
Matthew Wild <mwild1@gmail.com>
parents:
851
diff
changeset
|
60 for line in value:gmatch("([^\r\n]+)\r?\n*") do |
4b9207949735
util.dataforms: Fixed to actually work, mostly
Matthew Wild <mwild1@gmail.com>
parents:
851
diff
changeset
|
61 form:tag("value"):text(line):up(); |
4b9207949735
util.dataforms: Fixed to actually work, mostly
Matthew Wild <mwild1@gmail.com>
parents:
851
diff
changeset
|
62 end |
845
fc3dced9801e
util.dataforms: First commit, incomplete
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
63 end |
fc3dced9801e
util.dataforms: First commit, incomplete
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
64 |
952
ef648f49e734
util.dataforms: Add support for <required/> fields
Matthew Wild <mwild1@gmail.com>
parents:
951
diff
changeset
|
65 if field.required then |
ef648f49e734
util.dataforms: Add support for <required/> fields
Matthew Wild <mwild1@gmail.com>
parents:
951
diff
changeset
|
66 form:tag("required"):up(); |
ef648f49e734
util.dataforms: Add support for <required/> fields
Matthew Wild <mwild1@gmail.com>
parents:
951
diff
changeset
|
67 end |
ef648f49e734
util.dataforms: Add support for <required/> fields
Matthew Wild <mwild1@gmail.com>
parents:
951
diff
changeset
|
68 |
845
fc3dced9801e
util.dataforms: First commit, incomplete
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
69 -- Jump back up to list of fields |
fc3dced9801e
util.dataforms: First commit, incomplete
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
70 form:up(); |
fc3dced9801e
util.dataforms: First commit, incomplete
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
71 end |
851
b48c7ed3f7f8
util.dataforms: Return the form
Matthew Wild <mwild1@gmail.com>
parents:
845
diff
changeset
|
72 return form; |
845
fc3dced9801e
util.dataforms: First commit, incomplete
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
73 end |
fc3dced9801e
util.dataforms: First commit, incomplete
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
74 |
955
98ca5a753fee
util.dataforms: Support for retriving the field value data from forms
Matthew Wild <mwild1@gmail.com>
parents:
954
diff
changeset
|
75 local field_readers = {}; |
98ca5a753fee
util.dataforms: Support for retriving the field value data from forms
Matthew Wild <mwild1@gmail.com>
parents:
954
diff
changeset
|
76 |
845
fc3dced9801e
util.dataforms: First commit, incomplete
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
77 function form_t.data(layout, stanza) |
955
98ca5a753fee
util.dataforms: Support for retriving the field value data from forms
Matthew Wild <mwild1@gmail.com>
parents:
954
diff
changeset
|
78 local data = {}; |
845
fc3dced9801e
util.dataforms: First commit, incomplete
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
79 |
955
98ca5a753fee
util.dataforms: Support for retriving the field value data from forms
Matthew Wild <mwild1@gmail.com>
parents:
954
diff
changeset
|
80 for field_tag in stanza:childtags() do |
98ca5a753fee
util.dataforms: Support for retriving the field value data from forms
Matthew Wild <mwild1@gmail.com>
parents:
954
diff
changeset
|
81 local field_type = field_tag.attr.type; |
98ca5a753fee
util.dataforms: Support for retriving the field value data from forms
Matthew Wild <mwild1@gmail.com>
parents:
954
diff
changeset
|
82 |
98ca5a753fee
util.dataforms: Support for retriving the field value data from forms
Matthew Wild <mwild1@gmail.com>
parents:
954
diff
changeset
|
83 local reader = field_readers[field_type]; |
98ca5a753fee
util.dataforms: Support for retriving the field value data from forms
Matthew Wild <mwild1@gmail.com>
parents:
954
diff
changeset
|
84 if reader then |
98ca5a753fee
util.dataforms: Support for retriving the field value data from forms
Matthew Wild <mwild1@gmail.com>
parents:
954
diff
changeset
|
85 data[field_tag.attr.var] = reader(field_tag); |
98ca5a753fee
util.dataforms: Support for retriving the field value data from forms
Matthew Wild <mwild1@gmail.com>
parents:
954
diff
changeset
|
86 end |
98ca5a753fee
util.dataforms: Support for retriving the field value data from forms
Matthew Wild <mwild1@gmail.com>
parents:
954
diff
changeset
|
87 |
98ca5a753fee
util.dataforms: Support for retriving the field value data from forms
Matthew Wild <mwild1@gmail.com>
parents:
954
diff
changeset
|
88 end |
98ca5a753fee
util.dataforms: Support for retriving the field value data from forms
Matthew Wild <mwild1@gmail.com>
parents:
954
diff
changeset
|
89 return data; |
845
fc3dced9801e
util.dataforms: First commit, incomplete
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
90 end |
fc3dced9801e
util.dataforms: First commit, incomplete
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
91 |
955
98ca5a753fee
util.dataforms: Support for retriving the field value data from forms
Matthew Wild <mwild1@gmail.com>
parents:
954
diff
changeset
|
92 field_readers["text-single"] = |
98ca5a753fee
util.dataforms: Support for retriving the field value data from forms
Matthew Wild <mwild1@gmail.com>
parents:
954
diff
changeset
|
93 function (field_tag) |
98ca5a753fee
util.dataforms: Support for retriving the field value data from forms
Matthew Wild <mwild1@gmail.com>
parents:
954
diff
changeset
|
94 local value = field_tag:child_with_name("value"); |
98ca5a753fee
util.dataforms: Support for retriving the field value data from forms
Matthew Wild <mwild1@gmail.com>
parents:
954
diff
changeset
|
95 if value then |
98ca5a753fee
util.dataforms: Support for retriving the field value data from forms
Matthew Wild <mwild1@gmail.com>
parents:
954
diff
changeset
|
96 return value[1]; |
98ca5a753fee
util.dataforms: Support for retriving the field value data from forms
Matthew Wild <mwild1@gmail.com>
parents:
954
diff
changeset
|
97 end |
98ca5a753fee
util.dataforms: Support for retriving the field value data from forms
Matthew Wild <mwild1@gmail.com>
parents:
954
diff
changeset
|
98 end |
98ca5a753fee
util.dataforms: Support for retriving the field value data from forms
Matthew Wild <mwild1@gmail.com>
parents:
954
diff
changeset
|
99 |
98ca5a753fee
util.dataforms: Support for retriving the field value data from forms
Matthew Wild <mwild1@gmail.com>
parents:
954
diff
changeset
|
100 field_readers["text-private"] = |
98ca5a753fee
util.dataforms: Support for retriving the field value data from forms
Matthew Wild <mwild1@gmail.com>
parents:
954
diff
changeset
|
101 field_readers["text-single"]; |
98ca5a753fee
util.dataforms: Support for retriving the field value data from forms
Matthew Wild <mwild1@gmail.com>
parents:
954
diff
changeset
|
102 |
98ca5a753fee
util.dataforms: Support for retriving the field value data from forms
Matthew Wild <mwild1@gmail.com>
parents:
954
diff
changeset
|
103 field_readers["text-multi"] = |
98ca5a753fee
util.dataforms: Support for retriving the field value data from forms
Matthew Wild <mwild1@gmail.com>
parents:
954
diff
changeset
|
104 function (field_tag) |
98ca5a753fee
util.dataforms: Support for retriving the field value data from forms
Matthew Wild <mwild1@gmail.com>
parents:
954
diff
changeset
|
105 local result = {}; |
98ca5a753fee
util.dataforms: Support for retriving the field value data from forms
Matthew Wild <mwild1@gmail.com>
parents:
954
diff
changeset
|
106 for value_tag in field_tag:childtags() do |
98ca5a753fee
util.dataforms: Support for retriving the field value data from forms
Matthew Wild <mwild1@gmail.com>
parents:
954
diff
changeset
|
107 if value_tag.name == "value" then |
98ca5a753fee
util.dataforms: Support for retriving the field value data from forms
Matthew Wild <mwild1@gmail.com>
parents:
954
diff
changeset
|
108 result[#result+1] = value_tag[1]; |
98ca5a753fee
util.dataforms: Support for retriving the field value data from forms
Matthew Wild <mwild1@gmail.com>
parents:
954
diff
changeset
|
109 end |
98ca5a753fee
util.dataforms: Support for retriving the field value data from forms
Matthew Wild <mwild1@gmail.com>
parents:
954
diff
changeset
|
110 end |
98ca5a753fee
util.dataforms: Support for retriving the field value data from forms
Matthew Wild <mwild1@gmail.com>
parents:
954
diff
changeset
|
111 return t_concat(result, "\n"); |
98ca5a753fee
util.dataforms: Support for retriving the field value data from forms
Matthew Wild <mwild1@gmail.com>
parents:
954
diff
changeset
|
112 end |
98ca5a753fee
util.dataforms: Support for retriving the field value data from forms
Matthew Wild <mwild1@gmail.com>
parents:
954
diff
changeset
|
113 |
98ca5a753fee
util.dataforms: Support for retriving the field value data from forms
Matthew Wild <mwild1@gmail.com>
parents:
954
diff
changeset
|
114 field_readers["boolean"] = |
98ca5a753fee
util.dataforms: Support for retriving the field value data from forms
Matthew Wild <mwild1@gmail.com>
parents:
954
diff
changeset
|
115 function (field_tag) |
98ca5a753fee
util.dataforms: Support for retriving the field value data from forms
Matthew Wild <mwild1@gmail.com>
parents:
954
diff
changeset
|
116 local value = field_tag:child_with_name("value"); |
98ca5a753fee
util.dataforms: Support for retriving the field value data from forms
Matthew Wild <mwild1@gmail.com>
parents:
954
diff
changeset
|
117 if value then |
98ca5a753fee
util.dataforms: Support for retriving the field value data from forms
Matthew Wild <mwild1@gmail.com>
parents:
954
diff
changeset
|
118 if value[1] == "1" or value[1] == "true" then |
98ca5a753fee
util.dataforms: Support for retriving the field value data from forms
Matthew Wild <mwild1@gmail.com>
parents:
954
diff
changeset
|
119 return true; |
98ca5a753fee
util.dataforms: Support for retriving the field value data from forms
Matthew Wild <mwild1@gmail.com>
parents:
954
diff
changeset
|
120 else |
98ca5a753fee
util.dataforms: Support for retriving the field value data from forms
Matthew Wild <mwild1@gmail.com>
parents:
954
diff
changeset
|
121 return false; |
98ca5a753fee
util.dataforms: Support for retriving the field value data from forms
Matthew Wild <mwild1@gmail.com>
parents:
954
diff
changeset
|
122 end |
98ca5a753fee
util.dataforms: Support for retriving the field value data from forms
Matthew Wild <mwild1@gmail.com>
parents:
954
diff
changeset
|
123 end |
98ca5a753fee
util.dataforms: Support for retriving the field value data from forms
Matthew Wild <mwild1@gmail.com>
parents:
954
diff
changeset
|
124 end |
98ca5a753fee
util.dataforms: Support for retriving the field value data from forms
Matthew Wild <mwild1@gmail.com>
parents:
954
diff
changeset
|
125 |
98ca5a753fee
util.dataforms: Support for retriving the field value data from forms
Matthew Wild <mwild1@gmail.com>
parents:
954
diff
changeset
|
126 field_readers["hidden"] = |
98ca5a753fee
util.dataforms: Support for retriving the field value data from forms
Matthew Wild <mwild1@gmail.com>
parents:
954
diff
changeset
|
127 function (field_tag) |
98ca5a753fee
util.dataforms: Support for retriving the field value data from forms
Matthew Wild <mwild1@gmail.com>
parents:
954
diff
changeset
|
128 local value = field_tag:child_with_name("value"); |
98ca5a753fee
util.dataforms: Support for retriving the field value data from forms
Matthew Wild <mwild1@gmail.com>
parents:
954
diff
changeset
|
129 if value then |
98ca5a753fee
util.dataforms: Support for retriving the field value data from forms
Matthew Wild <mwild1@gmail.com>
parents:
954
diff
changeset
|
130 return value[1]; |
98ca5a753fee
util.dataforms: Support for retriving the field value data from forms
Matthew Wild <mwild1@gmail.com>
parents:
954
diff
changeset
|
131 end |
98ca5a753fee
util.dataforms: Support for retriving the field value data from forms
Matthew Wild <mwild1@gmail.com>
parents:
954
diff
changeset
|
132 end |
98ca5a753fee
util.dataforms: Support for retriving the field value data from forms
Matthew Wild <mwild1@gmail.com>
parents:
954
diff
changeset
|
133 |
951
4b9207949735
util.dataforms: Fixed to actually work, mostly
Matthew Wild <mwild1@gmail.com>
parents:
851
diff
changeset
|
134 return _M; |
845
fc3dced9801e
util.dataforms: First commit, incomplete
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
135 |
fc3dced9801e
util.dataforms: First commit, incomplete
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
136 |
951
4b9207949735
util.dataforms: Fixed to actually work, mostly
Matthew Wild <mwild1@gmail.com>
parents:
851
diff
changeset
|
137 --[=[ |
845
fc3dced9801e
util.dataforms: First commit, incomplete
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
138 |
fc3dced9801e
util.dataforms: First commit, incomplete
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
139 Layout: |
fc3dced9801e
util.dataforms: First commit, incomplete
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
140 { |
fc3dced9801e
util.dataforms: First commit, incomplete
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
141 |
fc3dced9801e
util.dataforms: First commit, incomplete
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
142 title = "MUC Configuration", |
fc3dced9801e
util.dataforms: First commit, incomplete
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
143 instructions = [[Use this form to configure options for this MUC room.]], |
fc3dced9801e
util.dataforms: First commit, incomplete
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
144 |
fc3dced9801e
util.dataforms: First commit, incomplete
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
145 { name = "FORM_TYPE", type = "hidden", required = true }; |
fc3dced9801e
util.dataforms: First commit, incomplete
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
146 { name = "field-name", type = "field-type", required = false }; |
fc3dced9801e
util.dataforms: First commit, incomplete
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
147 } |
fc3dced9801e
util.dataforms: First commit, incomplete
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
148 |
fc3dced9801e
util.dataforms: First commit, incomplete
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
149 |
951
4b9207949735
util.dataforms: Fixed to actually work, mostly
Matthew Wild <mwild1@gmail.com>
parents:
851
diff
changeset
|
150 --]=] |