ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilJsLinkButton.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2012 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4require_once "Services/UIComponent/Button/classes/class.ilButton.php";
5
13{
14 protected $target;
15
16 public static function getInstance()
17 {
18 return new self(self::TYPE_LINK);
19 }
20
25 public function setTarget($a_value)
26 {
27 $this->target = trim($a_value);
28 }
29
34 public function getTarget()
35 {
36 return $this->target;
37 }
38
43 protected function renderCaption()
44 {
45 return '&nbsp;' . $this->getCaption() . '&nbsp;';
46 }
47
48 public function render()
49 {
50 $this->prepareRender();
51
52 $attr = array();
53
54 $attr["target"] = $this->getTarget();
55 $attr["name"] = $this->getName();
56 $attr["onclick"] = $this->getOnClick();
57
58 return '<a' . $this->renderAttributes($attr) . '>' .
59 $this->renderCaption() . '</a>';
60 }
61}
An exception for terminatinating execution or to throw for unit testing.
renderAttributes(array $a_additional_attr=null)
Render current HTML attributes.
getOnClick()
Get onclick.
prepareRender()
Prepare render.
getCaption($a_translate=true)
Get caption.
setTarget($a_value)
Set target.
render()
Render HTML.
getTarget()
Get target.
renderCaption()
Prepare caption for render.