webmcp
view framework/env/request/get_json_request_slots.lua @ 14:a29c8ffb3f82
New function ui.filters{...}
Also changed version information to "1.0.8"
Also changed version information to "1.0.8"
| author | jbe/bsw | 
|---|---|
| date | Sat Feb 20 21:00:58 2010 +0100 (2010-02-20) | 
| parents | 985024b16520 | 
| children | 605488fbf809 | 
 line source
     1 --[[--
     2 slot_idents =                    -- list of names of slots to be returned as JSON data
     3 request.get_json_request_slots()
     5 If the current request is no JSON request, this function returns nil, otherwise a list of names of all slots to be returned in JSON format. This function also throws an error, if JSON data was requested, but request.set_allowed_json_request_slots(...) has not been called.
     7 --]]--
     9 function request.get_json_request_slots(slot_idents)
    10   local slot_idents = cgi.params["_webmcp_json_slots[]"]
    11   if slot_idents and not request._json_requests_allowed then
    12     error("JSON requests have not been allowed using request.set_allowed_json_request_slots(...).")
    13   end
    14   return slot_idents
    15 end
