Module: check_mk
Branch: master
Commit: 89552cfc01d9a8b6c548c81306d0b371805e9477
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=89552cfc01d9a8…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Sun May 6 18:47:57 2012 +0200
FIX: convert more buttons to new graphical style
---
ChangeLog | 1 +
web/htdocs/htmllib.py | 15 ++++++++++++---
2 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 917f731..1d329f9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,6 +6,7 @@
Multisite:
* FIX: fixed filter of recent event views (4 hours didn't catch)
+ * FIX: convert more buttons to new graphical style
Mobile GUI:
* FIX: commands can be executed again
diff --git a/web/htdocs/htmllib.py b/web/htdocs/htmllib.py
index 30add17..1482521 100644
--- a/web/htdocs/htmllib.py
+++ b/web/htdocs/htmllib.py
@@ -176,6 +176,7 @@ class html:
self.buffering = True
self.transformations = []
self.final_javascript_code = ""
+ self.auto_id = 0
def set_buffering(self, b):
self.buffering = b
@@ -186,6 +187,10 @@ class html:
def pop_transformation(self):
del self.transformations[-1]
+ def some_id(self):
+ self.auto_id += 1
+ return "id_%d" % self.auto_id
+
def plugin_stylesheets(self):
global plugin_stylesheets
try:
@@ -343,8 +348,9 @@ class html:
def buttonlink(self, href, text, add_transid=False, obj_id='',
style='', title='', disabled=''):
if add_transid:
href += "&_transid=%s" % self.fresh_transid()
- if obj_id:
- obj_id = ' id=%s' % obj_id
+ if not obj_id:
+ obj_id = self.some_id()
+ obj_id = ' id=%s' % obj_id
if style:
style = ' style="%s"' % style
if title:
@@ -352,9 +358,12 @@ class html:
if disabled:
title = ' disabled="%s"' % disabled
+ if not self.mobile:
+ self.write('<label for="%s" class=image_button>' %
obj_id)
self.write('<input%s%s%s%s value="%s" class=buttonlink
type=button onclick="location.href=\'%s\'">' % \
(obj_id, style, title, disabled, text, href))
- # self.write("<a href=\"%s\"
class=button%s%s>%s</a>" % (href, obj_id, style, text))
+ if not self.mobile:
+ self.write('</label>')
def icon(self, help, icon):
self.write('<img align=absmiddle class=icon title="%s"
src="images/icon_%s.png">' % (