Author: eallen
Date: 2008-11-08 12:50:53 -0500 (Sat, 08 Nov 2008)
New Revision: 2769
Modified:
mgmt/trunk/cumin/python/cumin/formats.py
Log:
Added optional onclick hander to fmt_link.
Modified: mgmt/trunk/cumin/python/cumin/formats.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/formats.py 2008-11-08 17:50:07 UTC (rev 2768)
+++ mgmt/trunk/cumin/python/cumin/formats.py 2008-11-08 17:50:53 UTC (rev 2769)
@@ -119,11 +119,17 @@
return string
-def fmt_link(href, content, class_="", id="",
link_title="", bm=""):
- return "<a %s href=\"%s%s\"%s%s>%s</a>" % \
- (id and "id=\"%s\"" % id or "", href, bm and
"#%s" % bm or "", class_ and " class=\"%s\" " %
class_ or " ",
- link_title and "title=\"%s\"" % link_title or
"", content)
+def fmt_link(href, content, class_="", id="",
link_title="", bm="", click=""):
+ full_id = id and " id=\"%s\"" % id or ""
+ full_bm = bm and "#%s" % bm or ""
+ full_class = class_ and " class=\"%s\"" % class_ or ""
+ full_title = link_title and " title=\"%s\"" % link_title or
""
+ full_click = click and " onclick=\"%s\"" % click or ""
+ return "<a%s href=\"%s%s\"%s%s%s>%s</a>" % \
+ (full_id, href, full_bm, full_class,
+ full_title, full_click, content)
+
def fmt_olink(session, object, selected=False, name=None, pre=16, post=0):
if name is None:
name = getattr(object, "name", fmt_none())
Show replies by date