Module: check_mk
Branch: master
Commit: 74f35c7b0d970e3534d4cb036270c7a1d149e887
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=74f35c7b0d970e…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Aug 17 11:53:20 2011 +0200
WATO: extra_buttons supports external URLs now
---
web/htdocs/wato.py | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 3ed2786..32002f0 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -150,9 +150,12 @@ def page_handler():
# Show contexts buttons
html.begin_context_buttons()
modefunc("buttons")
- for inmode, buttontext, targetmode in extra_buttons:
+ for inmode, buttontext, target in extra_buttons:
if inmode == current_mode:
- html.context_button(buttontext, make_link([("mode",
targetmode)]))
+ if '/' == target[0] or target.startswith('../') or
'://' in target:
+ html.context_button(buttontext, target)
+ else:
+ html.context_button(buttontext, make_link([("mode",
target)]))
html.end_context_buttons()
# Show outcome of action