allow to create links
This commit is contained in:
parent
d2d2cc9f5c
commit
1a0175249f
|
@ -1592,11 +1592,12 @@ class htmlHiddenInput extends htmlElement {
|
|||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param String $label label
|
||||
* @param String $name input name
|
||||
* @param String $value input value
|
||||
*/
|
||||
function __construct($name, $value) {
|
||||
$this->name = $name;
|
||||
$this->value = $value;
|
||||
$this->name = htmlspecialchars($name);
|
||||
$this->value = htmlspecialchars($value);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1617,4 +1618,52 @@ class htmlHiddenInput extends htmlElement {
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates a link.
|
||||
* The link can include an optional image in front of the link text.
|
||||
*
|
||||
* @package metaHTML
|
||||
*/
|
||||
class htmlLink extends htmlElement {
|
||||
|
||||
/** link text */
|
||||
private $text = null;
|
||||
/** link target */
|
||||
private $target = null;
|
||||
/** optional image */
|
||||
private $image = null;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param String $label label
|
||||
*/
|
||||
function __construct($text, $target, $image = null) {
|
||||
$this->text = htmlspecialchars($text);
|
||||
$this->target = htmlspecialchars($target);
|
||||
$this->image = htmlspecialchars($image);
|
||||
}
|
||||
|
||||
/**
|
||||
* Prints the HTML code for this element.
|
||||
*
|
||||
* @param string $module Name of account module
|
||||
* @param array $input List of meta-HTML elements
|
||||
* @param array $values List of values which override the defaults in $input (name => value)
|
||||
* @param boolean $restricted If true then no buttons will be displayed
|
||||
* @param integer $tabindex Start value of tabulator index for input fields
|
||||
* @param string $scope Account type
|
||||
* @return array List of input field names and their type (name => type)
|
||||
*/
|
||||
function generateHTML($module, $input, $values, $restricted, &$tabindex, $scope) {
|
||||
$image = '';
|
||||
if ($this->image != null) {
|
||||
$image = '<img src="' . $this->image . '" alt="' . $this->text . '"> ';
|
||||
}
|
||||
echo '<a href="' . $this->target . '">' . $image . $this->text . '</a>';
|
||||
return array();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
Loading…
Reference in New Issue