Module: check_mk
Branch: master
Commit: 062bab9f39cf5d54ae16ccd6b8b09422f39cbff8
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=062bab9f39cf5d…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Sun Jun 3 19:04:22 2012 +0200
New helper function in html for adding variables
---
web/htdocs/htmllib.py | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/web/htdocs/htmllib.py b/web/htdocs/htmllib.py
index a18ab72..f9c679f 100644
--- a/web/htdocs/htmllib.py
+++ b/web/htdocs/htmllib.py
@@ -971,6 +971,12 @@ class html:
else:
return []
+ # Adds a variable to listvars and also set it
+ def add_var(self, varname, value):
+ self.req.listvars.setdefault(varname, [])
+ self.req.listvars[varname].append(value)
+ self.req.vars[varname] = value
+
def set_var(self, varname, value):
if value == None:
self.del_var(varname)