webmcp

view framework/env/ui_deprecated/field.lua @ 23:3a6fe8663b26

Code cleanup and documentation added; Year in copyright notice changed to 2009-2010

Details:
- Changed quoting style in auth.openid.xrds_document{...}
- Fixed documentation for auth.openid.initiate{...}
- Added documentation for mondelefant
- Code-cleanup in mondelefant:
-- removed unneccessary lines "rows = PQntuples(res); cols = PQnfields(res);"
-- avoided extra copy of first argument (self) in mondelefant_conn_query
-- no rawget in meta-method "__index" of database result lists and objects
-- removed unreachable "return 0;" in meta-method "__newindex" of database result lists and objects
- Year in copyright notice changed to 2009-2010
- Version string changed to "1.1.1"
author jbe
date Fri Jun 04 19:00:34 2010 +0200 (2010-06-04)
parents 9fdfb27f8e67
children
line source
1 --
2 -- Creates an output field
3 --
4 -- label (string) The label of the field
5 -- value (atom) The value to put out
6 -- field_type (string) The type of the field (default: 'string')
7 --
8 -- Example:
9 --
10 -- ui_deprecated.field({
11 -- label = _'Id',
12 -- value = myobject.id,
13 -- field_type = 'integer'
14 -- })
15 --
17 function ui_deprecated.field(args)
18 local value_type = args.value_type or atom.string
19 slot.put(
20 '<div class="ui_field ui_field_', value_type.name, '">',
21 '<div class="label">',
22 encode.html(args.label or ''),
23 '</div>',
24 '<div class="value">')
25 if args.value then
26 slot.put(encode.html(convert.to_human(args.value, value_type)))
27 elseif args.link then
28 ui_deprecated.link(args.link)
29 end
30 slot.put(
31 '</div>',
32 '</div>\n'
33 )
34 end

Impressum / About Us