from Products.Silva.i18n import translate as _

request = context.REQUEST
model = request.model

all_errors = model.set_values_from_request(request)

if all_errors:
    msg_type = 'error'
    msg = _(
        'The data that was submitted did not validate properly '
        '(you might want to use the browser back button to adjust '
        'the form values).')
else:
    msg_type = 'feedback'
    msg = _('Layout config data saved.')

return context.tab_edit(
     form_errors=all_errors, message_type=msg_type, message=msg)
