root/luci2/cbi2/widgets/form.c @ 5708

Revision 5708, 508 bytes (checked in by blogic, 3 years ago)

give none data widgets json handlers

Line 
1#include "../cbi.h"
2
3int form_init(struct cbi_ctx *ctx, struct cbi_element *e)
4{
5    return 0;
6}
7
8json_object* form_json(struct cbi_ctx *ctx, struct cbi_element *e)
9{
10    json_object *j = json_object_new_object();
11    json_object_object_add(j, "type", json_object_new_string("section"));
12    return j;
13}
14
15struct cbi_widget_property form_props[] = {
16    { "id", PROP_REQUIRED },
17};
18
19struct cbi_widget form = {
20    .caps = CAP_PACKAGE | CAP_SECTION,
21    .init = form_init,
22    .json = form_json,
23    WPROPS(form_props),
24};
25
26WIDGET(form)
Note: See TracBrowser for help on using the browser.