bsw/jbe@4: local image_type = param.get("image_type") bsw/jbe@4: local record = MemberImage:by_pk(param.get_id(), image_type, true) bsw/jbe@4: bsw/jbe@4: if record == nil then bsw/jbe@4: local default_file = config.member_image_default_file[image_type] bsw/jbe@4: if default_file then bsw/jbe@4: print('Location: ' .. encode.url{ static = default_file } .. '\n\n') bsw/jbe@4: else bsw/jbe@4: print('Location: ' .. encode.url{ static = 'icons/16/lightning.png' } .. '\n\n') bsw/jbe@4: end bsw/jbe@4: exit() bsw/jbe@4: end bsw/jbe@4: bsw/jbe@52: assert(record.content_type, "No content-type set for image.") bsw/jbe@52: bsw/jbe@52: slot.set_layout(nil, record.content_type) bsw/jbe@4: bsw/jbe@4: if record then bsw/jbe@52: slot.put_into("data", record.data) bsw/jbe@4: end