Module: check_mk
Branch: master
Commit: e6b3310f0213bca0aa4c163ead8a50f340b27540
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e6b3310f0213bc…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Oct 28 13:01:09 2011 +0200
extra_buttons can now register a function to gather the URL to link to
---
ChangeLog | 1 +
web/htdocs/wato.py | 2 ++
2 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index e63e5ba..e51ba3e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -22,6 +22,7 @@
* Added API function num_hosts_in_folder() to count the number of hosts
below the given folder
* Added option to download "latest" snapshot
+ * extra_buttons can now register a function to gather the URL to link to
Multisite:
* FIX: Fixed encoding problem when opening dashboard
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 8456f75..ca2072a 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -370,6 +370,8 @@ def page_handler():
modefunc("buttons")
for inmode, buttontext, target in extra_buttons:
if inmode == current_mode:
+ if hasattr(target, '__call__'):
+ target = target()
if '/' == target[0] or target.startswith('../') or
'://' in target:
html.context_button(buttontext, target)
else: