'Parse the "<inputs>" element and create appropriate `ToolParameter`s.
This implementation supports multiple pages and grouping constructs.'

def parse_inputs(self, tool_source):

    pages = tool_source.parse_input_pages()
    enctypes = set()
    if pages.inputs_defined:
        if hasattr(pages, 'input_elem'):
            input_elem = pages.input_elem
            self.check_values = string_as_bool(input_elem.get('check_values', self.check_values))
            self.nginx_upload = string_as_bool(input_elem.get('nginx_upload', self.nginx_upload))
            self.action = input_elem.get('action', self.action)
            if (self.nginx_upload and self.app.config.nginx_upload_path):
                if ('?' in unquote_plus(self.action)):
                    raise Exception('URL    parameters    in    a    non-default    tool    action    can    not    be    used    in    conjunction    with    nginx    upload.        Please    convert    them    to    hidden    POST    parameters')
                self.action = ((self.app.config.nginx_upload_path + '?nginx_redir='), unquote_plus(self.action))
            self.target = input_elem.get('target', self.target)
            self.method = input_elem.get('method', self.method)
        for page_source in pages.page_sources:
            inputs = self.parse_input_elem(page_source, enctypes)
            display = page_source.parse_display()
            self.inputs_by_page.append(inputs)
            self.inputs.update(inputs)
            self.display_by_page.append(display)
    else:
        self.inputs_by_page.append(self.inputs)
        self.display_by_page.append(None)
    self.display = self.display_by_page[0]
    self.npages = len(self.inputs_by_page)
    self.last_page = (len(self.inputs_by_page) - 1)
    self.has_multiple_pages = bool(self.last_page)
    if (len(enctypes) == 0):
        self.enctype = 'application/x-www-form-urlencoded'
    elif (len(enctypes) == 1):
        self.enctype = enctypes.pop()
    else:
        raise Exception(('Conflicting    required    enctypes:    %s' % str(enctypes)))
    template_macros = {}
    if hasattr(tool_source, 'root'):
        template_macros = template_macro_params(tool_source.root)
    self.template_macro_params = template_macros
    for param in self.inputs.values():
        if (not isinstance(param, (HiddenToolParameter, BaseURLToolParameter))):
            self.input_required = True
            break
