1.1 --- a/imipweb/resource.py Sun Oct 25 01:25:29 2015 +0200
1.2 +++ b/imipweb/resource.py Sun Oct 25 18:53:50 2015 +0100
1.3 @@ -262,16 +262,17 @@
1.4 else:
1.5 page.input(name=name, type=type, value=value, **kw)
1.6
1.7 - def menu(self, name, default, items, class_="", index=None):
1.8 + def menu(self, name, default, items, values=None, class_="", index=None):
1.9
1.10 """
1.11 Show a select menu having the given 'name', set to the given 'default',
1.12 - providing the given (value, label) 'items', and employing the given CSS
1.13 - 'class_' if specified.
1.14 + providing the given (value, label) 'items', selecting the given 'values'
1.15 + (or using the request parameters if not specified), and employing the
1.16 + given CSS 'class_' if specified.
1.17 """
1.18
1.19 page = self.page
1.20 - values = self.env.get_args().get(name, [default])
1.21 + values = values or self.env.get_args().get(name, [default])
1.22 if index is not None:
1.23 values = values[index:]
1.24 values = values and values[0:1] or [default]