diff --git a/lam/lib/html.inc b/lam/lib/html.inc
index c2969562..7cf2ddfe 100644
--- a/lam/lib/html.inc
+++ b/lam/lib/html.inc
@@ -1990,6 +1990,8 @@ class htmlLink extends htmlElement {
private $title = null;
/** target window */
private $targetWindow = null;
+ /** onClick event */
+ private $onClick = null;
/**
* Constructor.
@@ -2028,7 +2030,11 @@ class htmlLink extends htmlElement {
if ($this->targetWindow != null) {
$targetWindow = ' target="' . $this->targetWindow . '"';
}
- echo '' . $image . $this->text . '';
+ $onClick = '';
+ if ($this->onClick != null) {
+ $onClick = ' onclick="' . $this->onClick . '"';
+ }
+ echo '' . $image . $this->text . '';
return array();
}
@@ -2050,6 +2056,15 @@ class htmlLink extends htmlElement {
$this->targetWindow = htmlspecialchars($window);
}
+ /**
+ * Sets the onClick event.
+ *
+ * @param String $event JavaScript code
+ */
+ public function setOnClick($event) {
+ $this->onClick = htmlspecialchars($event);
+ }
+
}
/**