Module: check_mk
Branch: master
Commit: 8a6b784069a720bbc1a6aa93e18823fd5e030be3
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=8a6b784069a720…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Jan 4 16:45:20 2011 +0100
Added code to handle multiple vars of same name as lists
---
web/htdocs/htmllib.py | 3 +++
web/htdocs/index.py | 3 ++-
2 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/web/htdocs/htmllib.py b/web/htdocs/htmllib.py
index aeba1c8..1b4b8a5 100644
--- a/web/htdocs/htmllib.py
+++ b/web/htdocs/htmllib.py
@@ -471,6 +471,9 @@ class html:
def var(self, varname, deflt = None):
return self.req.vars.get(varname, deflt)
+ def multivar(self, varname, deflt = None):
+ return self.req.multivars.get(varname, deflt)
+
def var_utf8(self, varname, deflt = None):
return unicode(self.req.vars.get(varname, deflt), "utf-8")
diff --git a/web/htdocs/index.py b/web/htdocs/index.py
index c6b0cc8..765e05b 100644
--- a/web/htdocs/index.py
+++ b/web/htdocs/index.py
@@ -48,13 +48,14 @@ if defaults.omd_root:
execfile(local_pagehandlers_dir + "/" + fn)
def read_get_vars(req):
+ req.multivars = {}
req.vars = {}
if req.args:
req.rawvars = util.parse_qs(req.args, True)
for (key,values) in req.rawvars.items():
if len(values) >= 1:
req.vars[key] = values[-1]
-
+ req.multivars[key] = values
def connect_to_livestatus(html):
html.site_status = {}