CSS for links
This commit is contained in:
parent
a4cfd700be
commit
8da5ed7ad4
|
@ -2314,6 +2314,8 @@ class htmlLink extends htmlElement {
|
||||||
private $onClick = null;
|
private $onClick = null;
|
||||||
/** show as button */
|
/** show as button */
|
||||||
private $showAsButton = false;
|
private $showAsButton = false;
|
||||||
|
/** CSS classes */
|
||||||
|
private $cssClasses = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
|
@ -2363,7 +2365,11 @@ class htmlLink extends htmlElement {
|
||||||
$id = 'a_' . preg_replace('/[^a-zA-Z0-9_]+/', '_', $this->target);
|
$id = 'a_' . preg_replace('/[^a-zA-Z0-9_]+/', '_', $this->target);
|
||||||
$idAttr = ' id="' . $id . '"';
|
$idAttr = ' id="' . $id . '"';
|
||||||
}
|
}
|
||||||
echo '<a href="' . $this->target . '"' . $idAttr . $title . $targetWindow . $onClick . '>' . $image . $this->text . '</a>';
|
$classAttr = '';
|
||||||
|
if (sizeof($this->cssClasses) > 0) {
|
||||||
|
$classAttr = ' class="' . implode(' ', $this->cssClasses) . '"';
|
||||||
|
}
|
||||||
|
echo '<a href="' . $this->target . '"' . $idAttr . $classAttr . $title . $targetWindow . $onClick . '>' . $image . $this->text . '</a>';
|
||||||
if ($this->showAsButton) {
|
if ($this->showAsButton) {
|
||||||
echo '<script type="text/javascript">';
|
echo '<script type="text/javascript">';
|
||||||
echo ' jQuery(document).ready(function() {';
|
echo ' jQuery(document).ready(function() {';
|
||||||
|
@ -2400,6 +2406,15 @@ class htmlLink extends htmlElement {
|
||||||
public function setOnClick($event) {
|
public function setOnClick($event) {
|
||||||
$this->onClick = htmlspecialchars($event);
|
$this->onClick = htmlspecialchars($event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Adds CSS classes to this link.
|
||||||
|
*
|
||||||
|
* @param array $classes CSS class names
|
||||||
|
*/
|
||||||
|
public function setCSSClasses($classes) {
|
||||||
|
$this->cssClasses = $classes;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -73,6 +73,12 @@ a img {
|
||||||
border: 0px;
|
border: 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
a.classicBold {
|
||||||
|
color: blue;
|
||||||
|
text-decoration: none;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
fieldset {
|
fieldset {
|
||||||
background-color:#fff3c8;
|
background-color:#fff3c8;
|
||||||
border:1px solid #af8800;
|
border:1px solid #af8800;
|
||||||
|
|
Loading…
Reference in New Issue