'API call for fetching toolbox filters data. Toolbox filters are specified in galaxy.ini.
The user can activate them and the choice is stored in user_preferences.'

@expose_api
def get_toolbox_filters(self, trans, id, payload={}, **kwd):

    user = self._get_user(trans, id)
    filter_types = self._get_filter_types(trans)
    saved_values = {}
    for (name, value) in user.preferences.items():
        if (name in filter_types):
            saved_values[name] = listify(value, do_strip=True)
    inputs = []
    factory = FilterFactory(trans.app.toolbox)
    for filter_type in filter_types:
        self._add_filter_inputs(factory, filter_types, inputs, filter_type, saved_values)
    return {'message': 'Toolbox    filters    unchanged.', 'inputs': inputs}
