allow title attribute for buttons
This commit is contained in:
parent
27e94d9ec0
commit
e731076829
|
@ -485,6 +485,8 @@ class htmlButton extends htmlElement {
|
||||||
protected $value;
|
protected $value;
|
||||||
/** image button or text button */
|
/** image button or text button */
|
||||||
protected $isImageButton;
|
protected $isImageButton;
|
||||||
|
/** title */
|
||||||
|
private $title = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
|
@ -514,6 +516,7 @@ class htmlButton extends htmlElement {
|
||||||
$value = '';
|
$value = '';
|
||||||
$style = '';
|
$style = '';
|
||||||
$class = '';
|
$class = '';
|
||||||
|
$title = '';
|
||||||
$name = ' name="' . $this->name . '"';
|
$name = ' name="' . $this->name . '"';
|
||||||
// image button
|
// image button
|
||||||
if ($this->isImageButton) {
|
if ($this->isImageButton) {
|
||||||
|
@ -527,10 +530,22 @@ class htmlButton extends htmlElement {
|
||||||
$value = ' value="' . $this->value . '"';
|
$value = ' value="' . $this->value . '"';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
echo '<input type="submit"' . $name . $value . $style . $class . '>';
|
if ($this->title != null) {
|
||||||
|
$title = ' title="' . $this->title . '"';
|
||||||
|
}
|
||||||
|
echo '<input type="submit"' . $name . $value . $style . $class . $title . '>';
|
||||||
return array($this->name => 'submit');
|
return array($this->name => 'submit');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the button title (tooltip).
|
||||||
|
*
|
||||||
|
* @param String $title title
|
||||||
|
*/
|
||||||
|
public function setTitle($title) {
|
||||||
|
$this->title = htmlspecialchars($title);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue